From 8c1de3a39905b0bd93ee6e7b7072bc41a0b90424 Mon Sep 17 00:00:00 2001 From: "red-hat-konflux[bot]" <126015336+red-hat-konflux[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 13:36:54 +0000 Subject: [PATCH] fix(deps): update module gitlab.com/gitlab-org/api/client-go to v1 Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com> --- go.mod | 12 +- go.sum | 25 +- .../google/go-querystring/query/encode.go | 73 +- .../gitlab-org/api/client-go/.gitignore | 1 + .../gitlab-org/api/client-go/.gitlab-ci.yml | 80 +- .../gitlab-org/api/client-go/.golangci.yml | 27 +- .../gitlab-org/api/client-go/.tool-versions | 2 +- .../gitlab-org/api/client-go/AGENTS.md | 42 +- .../gitlab-org/api/client-go/CHANGELOG.md | 383 +++ .../gitlab-org/api/client-go/Makefile | 15 + .../gitlab-org/api/client-go/README.md | 13 + .../api/client-go/access_requests.go | 39 +- .../admin_compliance_policy_settings.go | 85 + .../api/client-go/alert_management.go | 18 +- .../api/client-go/application_statistics.go | 22 +- .../gitlab-org/api/client-go/applications.go | 10 +- .../gitlab-org/api/client-go/attestations.go | 64 + .../gitlab-org/api/client-go/audit_events.go | 23 +- .../gitlab-org/api/client-go/avatar.go | 2 +- .../gitlab-org/api/client-go/award_emojis.go | 131 +- .../gitlab-org/api/client-go/boards.go | 116 +- .../api/client-go/broadcast_messages.go | 18 +- .../gitlab-org/api/client-go/bulk_imports.go | 2 +- .../api/client-go/ci_yml_templates.go | 4 +- .../api/client-go/cluster_agents.go | 48 +- .../gitlab-org/api/client-go/commits.go | 30 +- .../api/client-go/container_registry.go | 58 +- .../container_registry_protection_rules.go | 23 +- .../api/client-go/custom_attributes.go | 56 +- .../api/client-go/database_migrations.go | 4 +- .../gitlab-org/api/client-go/dependencies.go | 4 +- .../api/client-go/dependency_list_export.go | 14 +- .../gitlab-org/api/client-go/deploy_keys.go | 50 +- .../gitlab-org/api/client-go/deploy_tokens.go | 35 +- .../gitlab-org/api/client-go/deployments.go | 92 +- .../client-go/deployments_merge_requests.go | 4 +- .../gitlab-org/api/client-go/discussions.go | 155 +- .../api/client-go/docker-compose.yml | 61 + .../api/client-go/dockerfile_templates.go | 4 +- .../gitlab-org/api/client-go/draft_notes.go | 36 +- .../api/client-go/enterprise_users.go | 41 +- .../gitlab-org/api/client-go/environments.go | 49 +- .../gitlab-org/api/client-go/epic_issues.go | 61 +- .../gitlab-org/api/client-go/epics.go | 69 +- .../api/client-go/error_tracking.go | 14 +- .../gitlab-org/api/client-go/event_parsing.go | 10 +- .../api/client-go/event_systemhook_types.go | 258 +- .../api/client-go/event_webhook_types.go | 2136 +++++++++-------- .../gitlab-org/api/client-go/events.go | 204 +- .../api/client-go/external_status_checks.go | 129 +- .../api/client-go/feature_flag_user_lists.go | 18 +- .../api/client-go/freeze_periods.go | 18 +- .../api/client-go/generic_packages.go | 48 +- .../gitlab-org/api/client-go/geo_nodes.go | 310 +-- .../gitlab-org/api/client-go/geo_sites.go | 400 +-- .../api/client-go/gitignore_templates.go | 4 +- .../gitlab-org/api/client-go/gitlab.go | 54 +- .../api/client-go/group_access_tokens.go | 150 +- .../api/client-go/group_activity_analytics.go | 63 +- .../gitlab-org/api/client-go/group_badges.go | 14 +- .../gitlab-org/api/client-go/group_boards.go | 290 +-- .../api/client-go/group_clusters.go | 14 +- .../api/client-go/group_credentials.go | 140 ++ .../api/client-go/group_epic_boards.go | 60 +- .../gitlab-org/api/client-go/group_hooks.go | 35 +- .../api/client-go/group_import_export.go | 26 +- .../api/client-go/group_iterations.go | 10 +- .../gitlab-org/api/client-go/group_labels.go | 14 +- .../api/client-go/group_markdown_uploads.go | 18 +- .../gitlab-org/api/client-go/group_members.go | 314 +-- .../api/client-go/group_milestones.go | 46 +- .../client-go/group_protected_environments.go | 172 +- .../group_repository_storage_move.go | 130 +- .../api/client-go/group_security_settings.go | 4 +- .../api/client-go/group_serviceaccounts.go | 49 +- .../api/client-go/group_ssh_certificates.go | 6 +- .../api/client-go/group_variables.go | 118 +- .../gitlab-org/api/client-go/group_wikis.go | 114 +- .../gitlab-org/api/client-go/groups.go | 112 +- .../gitlab-org/api/client-go/import.go | 42 +- .../api/client-go/instance_clusters.go | 14 +- .../api/client-go/instance_variables.go | 4 +- .../gitlab-org/api/client-go/integrations.go | 8 +- .../gitlab-org/api/client-go/invites.go | 2 +- .../gitlab-org/api/client-go/issue_links.go | 28 +- .../gitlab-org/api/client-go/issues.go | 222 +- .../api/client-go/issues_statistics.go | 42 +- .../api/client-go/job_token_scope.go | 20 +- .../gitlab-org/api/client-go/jobs.go | 551 ++--- .../gitlab-org/api/client-go/keys.go | 6 +- .../gitlab-org/api/client-go/labels.go | 14 +- .../gitlab-org/api/client-go/license.go | 70 +- .../api/client-go/markdown_uploads.go | 121 +- .../gitlab-org/api/client-go/member_roles.go | 131 +- .../merge_request_approval_settings.go | 29 +- .../api/client-go/merge_request_approvals.go | 106 +- .../api/client-go/merge_requests.go | 946 +++----- .../gitlab-org/api/client-go/merge_trains.go | 113 +- .../gitlab-org/api/client-go/metadata.go | 27 +- .../gitlab-org/api/client-go/milestones.go | 46 +- .../gitlab-org/api/client-go/namespaces.go | 14 +- .../gitlab-org/api/client-go/notes.go | 156 +- .../gitlab-org/api/client-go/packages.go | 30 +- .../gitlab-org/api/client-go/pages_domains.go | 37 +- .../api/client-go/personal_access_tokens.go | 28 +- .../api/client-go/pipeline_schedules.go | 44 +- .../api/client-go/pipeline_triggers.go | 18 +- .../gitlab-org/api/client-go/pipelines.go | 149 +- .../gitlab-org/api/client-go/plan_limits.go | 32 +- .../api/client-go/project_access_tokens.go | 12 +- .../api/client-go/project_aliases.go | 6 +- .../api/client-go/project_badges.go | 14 +- .../api/client-go/project_clusters.go | 16 +- .../api/client-go/project_feature_flags.go | 8 +- .../api/client-go/project_import_export.go | 50 +- .../api/client-go/project_iterations.go | 10 +- .../api/client-go/project_markdown_uploads.go | 18 +- .../api/client-go/project_members.go | 30 +- .../api/client-go/project_mirror.go | 22 +- .../project_repository_storage_move.go | 24 +- .../api/client-go/project_snippets.go | 20 +- .../api/client-go/project_templates.go | 2 +- .../api/client-go/project_variables.go | 6 +- .../api/client-go/project_vulnerabilities.go | 24 +- .../gitlab-org/api/client-go/projects.go | 470 ++-- .../api/client-go/protected_branches.go | 18 +- .../api/client-go/protected_environments.go | 60 +- .../api/client-go/protected_packages.go | 8 +- .../api/client-go/protected_tags.go | 16 +- .../gitlab-org/api/client-go/releaselinks.go | 18 +- .../gitlab-org/api/client-go/releases.go | 87 +- .../gitlab-org/api/client-go/repositories.go | 6 +- .../api/client-go/repository_files.go | 42 +- .../api/client-go/request_handler.go | 12 +- .../api/client-go/request_options.go | 12 +- .../api/client-go/resource_group.go | 2 +- .../client-go/resource_iteration_events.go | 22 +- .../api/client-go/resource_label_events.go | 63 +- .../client-go/resource_milestone_events.go | 20 +- .../api/client-go/resource_state_events.go | 20 +- .../api/client-go/resource_weight_events.go | 12 +- .../api/client-go/runner_controller_tokens.go | 113 + .../api/client-go/runner_controllers.go | 137 ++ .../gitlab-org/api/client-go/runners.go | 86 +- .../gitlab-org/api/client-go/search.go | 4 +- .../gitlab-org/api/client-go/secure_files.go | 18 +- .../gitlab-org/api/client-go/services.go | 92 +- .../gitlab-org/api/client-go/settings.go | 638 ++--- .../api/client-go/sidekiq_metrics.go | 56 +- .../snippet_repository_storage_move.go | 26 +- .../gitlab-org/api/client-go/snippets.go | 92 +- .../gitlab-org/api/client-go/system_hooks.go | 16 +- .../gitlab-org/api/client-go/tags.go | 6 +- .../gitlab-org/api/client-go/time_stats.go | 14 +- .../gitlab-org/api/client-go/todos.go | 54 +- .../gitlab-org/api/client-go/topics.go | 58 +- .../gitlab-org/api/client-go/types.go | 32 +- .../gitlab-org/api/client-go/usage_data.go | 78 +- .../gitlab-org/api/client-go/users.go | 701 +++--- .../gitlab-org/api/client-go/validate.go | 16 +- .../gitlab-org/api/client-go/wikis.go | 54 +- .../x/exp/constraints/constraints.go | 54 - vendor/golang.org/x/sync/errgroup/errgroup.go | 4 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 3 +- vendor/golang.org/x/sys/unix/zerrors_linux.go | 2 + .../x/sys/unix/zerrors_linux_386.go | 2 + .../x/sys/unix/zerrors_linux_amd64.go | 2 + .../x/sys/unix/zerrors_linux_arm.go | 2 + .../x/sys/unix/zerrors_linux_arm64.go | 2 + .../x/sys/unix/zerrors_linux_loong64.go | 2 + .../x/sys/unix/zerrors_linux_mips.go | 2 + .../x/sys/unix/zerrors_linux_mips64.go | 2 + .../x/sys/unix/zerrors_linux_mips64le.go | 2 + .../x/sys/unix/zerrors_linux_mipsle.go | 2 + .../x/sys/unix/zerrors_linux_ppc.go | 2 + .../x/sys/unix/zerrors_linux_ppc64.go | 2 + .../x/sys/unix/zerrors_linux_ppc64le.go | 2 + .../x/sys/unix/zerrors_linux_riscv64.go | 2 + .../x/sys/unix/zerrors_linux_s390x.go | 2 + .../x/sys/unix/zerrors_linux_sparc64.go | 2 + .../x/sys/unix/ztypes_netbsd_arm.go | 2 +- .../x/text/encoding/japanese/eucjp.go | 6 +- .../x/text/encoding/japanese/iso2022jp.go | 6 +- .../x/text/encoding/japanese/shiftjis.go | 6 +- .../x/text/encoding/korean/euckr.go | 6 +- .../x/text/encoding/simplifiedchinese/gbk.go | 20 +- .../encoding/simplifiedchinese/hzgb2312.go | 6 +- .../text/encoding/traditionalchinese/big5.go | 6 +- .../x/text/encoding/unicode/unicode.go | 6 +- .../protobuf/internal/encoding/tag/tag.go | 11 +- .../protobuf/internal/encoding/text/decode.go | 115 +- .../protobuf/internal/filedesc/desc.go | 1 + .../protobuf/internal/filedesc/desc_lazy.go | 22 - .../protobuf/internal/genid/descriptor_gen.go | 1 + .../protobuf/internal/impl/codec_map.go | 6 + .../protobuf/internal/impl/decode.go | 3 +- .../protobuf/internal/impl/validate.go | 26 + .../protobuf/internal/version/version.go | 2 +- .../protobuf/proto/decode.go | 10 +- .../protobuf/reflect/protodesc/desc.go | 11 +- .../protobuf/reflect/protodesc/editions.go | 4 +- .../types/descriptorpb/descriptor.pb.go | 13 +- .../types/known/timestamppb/timestamp.pb.go | 13 +- vendor/modules.txt | 17 +- 204 files changed, 7578 insertions(+), 6928 deletions(-) create mode 100644 vendor/gitlab.com/gitlab-org/api/client-go/admin_compliance_policy_settings.go create mode 100644 vendor/gitlab.com/gitlab-org/api/client-go/attestations.go create mode 100644 vendor/gitlab.com/gitlab-org/api/client-go/docker-compose.yml create mode 100644 vendor/gitlab.com/gitlab-org/api/client-go/group_credentials.go create mode 100644 vendor/gitlab.com/gitlab-org/api/client-go/runner_controller_tokens.go create mode 100644 vendor/gitlab.com/gitlab-org/api/client-go/runner_controllers.go delete mode 100644 vendor/golang.org/x/exp/constraints/constraints.go diff --git a/go.mod b/go.mod index d9b602522..d3cdec000 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/quay/claircore v1.5.45 github.com/spf13/cobra v1.10.1 github.com/spf13/pflag v1.0.10 - gitlab.com/gitlab-org/api/client-go v0.160.2 + gitlab.com/gitlab-org/api/client-go v1.11.0 gopkg.in/yaml.v3 v3.0.1 helm.sh/helm/v3 v3.19.2 k8s.io/api v0.34.2 @@ -83,7 +83,7 @@ require ( github.com/google/btree v1.1.3 // indirect github.com/google/gnostic-models v0.7.1 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/google/go-querystring v1.1.0 // indirect + github.com/google/go-querystring v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect github.com/gosuri/uitable v0.0.4 // indirect @@ -146,15 +146,15 @@ require ( golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 // indirect golang.org/x/net v0.47.0 // indirect golang.org/x/oauth2 v0.33.0 // indirect - golang.org/x/sync v0.18.0 // indirect - golang.org/x/sys v0.38.0 // indirect + golang.org/x/sync v0.19.0 // indirect + golang.org/x/sys v0.39.0 // indirect golang.org/x/term v0.37.0 // indirect - golang.org/x/text v0.31.0 // indirect + golang.org/x/text v0.32.0 // indirect golang.org/x/time v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251111163417-95abcf5c77ba // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251111163417-95abcf5c77ba // indirect google.golang.org/grpc v1.77.0 // indirect - google.golang.org/protobuf v1.36.10 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect k8s.io/apiextensions-apiserver v0.34.2 // indirect diff --git a/go.sum b/go.sum index ebd7c47ad..ed503b132 100644 --- a/go.sum +++ b/go.sum @@ -161,7 +161,6 @@ github.com/google/cel-go v0.26.1 h1:iPbVVEdkhTX++hpe3lzSk7D3G3QSYqLGoHOcEio+UXQ= github.com/google/cel-go v0.26.1/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM= github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= @@ -169,8 +168,8 @@ github.com/google/go-github/scrape v0.0.0-20251008171934-06b8b3a37d13 h1:wG9nQT7 github.com/google/go-github/scrape v0.0.0-20251008171934-06b8b3a37d13/go.mod h1:Dp9XfSwv9onCQJA+te5jNN3pkiXBfDgcTmOs2dtO2DI= github.com/google/go-github/v75 v75.0.0 h1:k7q8Bvg+W5KxRl9Tjq16a9XEgVY1pwuiG5sIL7435Ic= github.com/google/go-github/v75 v75.0.0/go.mod h1:H3LUJEA1TCrzuUqtdAQniBNwuKiQIqdGKgBo1/M/uqI= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= +github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= @@ -372,8 +371,8 @@ github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT0 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -gitlab.com/gitlab-org/api/client-go v0.160.2 h1:InFTeAoGZoQWFS+4xA2kjOp+FaxnuuUsNm6KuyftK3o= -gitlab.com/gitlab-org/api/client-go v0.160.2/go.mod h1:YqKcnxyV9OPAL5U99mpwBVEgBPz1PK/3qwqq/3h6bao= +gitlab.com/gitlab-org/api/client-go v1.11.0 h1:L+qzw4kiCf3jKdKHQAwiqYKITvzBrW/tl8ampxNLlv0= +gitlab.com/gitlab-org/api/client-go v1.11.0/go.mod h1:adtVJ4zSTEJ2fP5Pb1zF4Ox1OKFg0MH43yxpb0T0248= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/bridges/prometheus v0.57.0 h1:UW0+QyeyBVhn+COBec3nGhfnFe5lwB0ic1JBVjzhk0w= @@ -474,8 +473,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= -golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= +golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -492,8 +491,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= +golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -514,8 +513,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= +golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -538,8 +537,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20251111163417-95abcf5c77ba h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20251111163417-95abcf5c77ba/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= -google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= -google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/vendor/github.com/google/go-querystring/query/encode.go b/vendor/github.com/google/go-querystring/query/encode.go index 91198f819..c93695403 100644 --- a/vendor/github.com/google/go-querystring/query/encode.go +++ b/vendor/github.com/google/go-querystring/query/encode.go @@ -6,22 +6,21 @@ // // As a simple example: // -// type Options struct { -// Query string `url:"q"` -// ShowAll bool `url:"all"` -// Page int `url:"page"` -// } +// type Options struct { +// Query string `url:"q"` +// ShowAll bool `url:"all"` +// Page int `url:"page"` +// } // -// opt := Options{ "foo", true, 2 } -// v, _ := query.Values(opt) -// fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2" +// opt := Options{ "foo", true, 2 } +// v, _ := query.Values(opt) +// fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2" // // The exact mapping between Go values and url.Values is described in the // documentation for the Values() function. package query import ( - "bytes" "fmt" "net/url" "reflect" @@ -47,8 +46,8 @@ type Encoder interface { // // Each exported struct field is encoded as a URL parameter unless // -// - the field's tag is "-", or -// - the field is empty and its tag specifies the "omitempty" option +// - the field's tag is "-", or +// - the field is empty and its tag specifies the "omitempty" option // // The empty values are false, 0, any nil pointer or interface value, any array // slice, map, or string of length zero, and any type (such as time.Time) that @@ -59,19 +58,19 @@ type Encoder interface { // field's tag value is the key name, followed by an optional comma and // options. For example: // -// // Field is ignored by this package. -// Field int `url:"-"` +// // Field is ignored by this package. +// Field int `url:"-"` // -// // Field appears as URL parameter "myName". -// Field int `url:"myName"` +// // Field appears as URL parameter "myName". +// Field int `url:"myName"` // -// // Field appears as URL parameter "myName" and the field is omitted if -// // its value is empty -// Field int `url:"myName,omitempty"` +// // Field appears as URL parameter "myName" and the field is omitted if +// // its value is empty +// Field int `url:"myName,omitempty"` // -// // Field appears as URL parameter "Field" (the default), but the field -// // is skipped if empty. Note the leading comma. -// Field int `url:",omitempty"` +// // Field appears as URL parameter "Field" (the default), but the field +// // is skipped if empty. Note the leading comma. +// Field int `url:",omitempty"` // // For encoding individual field values, the following type-dependent rules // apply: @@ -88,8 +87,8 @@ type Encoder interface { // "url" tag) will use the value of the "layout" tag as a layout passed to // time.Format. For example: // -// // Encode a time.Time as YYYY-MM-DD -// Field time.Time `layout:"2006-01-02"` +// // Encode a time.Time as YYYY-MM-DD +// Field time.Time `layout:"2006-01-02"` // // Slice and Array values default to encoding as multiple URL values of the // same name. Including the "comma" option signals that the field should be @@ -103,9 +102,9 @@ type Encoder interface { // from the "url" tag) will use the value of the "del" tag as the delimiter. // For example: // -// // Encode a slice of bools as ints ("1" for true, "0" for false), -// // separated by exclamation points "!". -// Field []bool `url:",int" del:"!"` +// // Encode a slice of bools as ints ("1" for true, "0" for false), +// // separated by exclamation points "!". +// Field []bool `url:",int" del:"!"` // // Anonymous struct fields are usually encoded as if their inner exported // fields were fields in the outer struct, subject to the standard Go @@ -114,10 +113,10 @@ type Encoder interface { // // Non-nil pointer values are encoded as the value pointed to. // -// Nested structs are encoded including parent fields in value names for -// scoping. e.g: +// Nested structs have their fields processed recursively and are encoded +// including parent fields in value names for scoping. For example, // -// "user[name]=acme&user[addr][postcode]=1234&user[addr][city]=SFO" +// "user[name]=acme&user[addr][postcode]=1234&user[addr][city]=SFO" // // All other values are encoded using their default string representation. // @@ -125,6 +124,11 @@ type Encoder interface { // as multiple URL values of the same name. func Values(v interface{}) (url.Values, error) { values := make(url.Values) + + if v == nil { + return values, nil + } + val := reflect.ValueOf(v) for val.Kind() == reflect.Ptr { if val.IsNil() { @@ -133,10 +137,6 @@ func Values(v interface{}) (url.Values, error) { val = val.Elem() } - if v == nil { - return values, nil - } - if val.Kind() != reflect.Struct { return nil, fmt.Errorf("query: Values() expects struct input. Got %v", val.Kind()) } @@ -209,6 +209,11 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { } if sv.Kind() == reflect.Slice || sv.Kind() == reflect.Array { + if sv.Len() == 0 { + // skip if slice or array is empty + continue + } + var del string if opts.Contains("comma") { del = "," @@ -223,7 +228,7 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { } if del != "" { - s := new(bytes.Buffer) + s := new(strings.Builder) first := true for i := 0; i < sv.Len(); i++ { if first { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/.gitignore b/vendor/gitlab.com/gitlab-org/api/client-go/.gitignore index 79e862f1f..49b017597 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/.gitignore +++ b/vendor/gitlab.com/gitlab-org/api/client-go/.gitignore @@ -39,3 +39,4 @@ scripts/commitlint/node_modules gl-code-quality-report.json .mise/ +Gitlab-license.txt diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/.gitlab-ci.yml b/vendor/gitlab.com/gitlab-org/api/client-go/.gitlab-ci.yml index 913b4252e..d5e1a0823 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/.gitlab-ci.yml +++ b/vendor/gitlab.com/gitlab-org/api/client-go/.gitlab-ci.yml @@ -8,6 +8,7 @@ workflow: include: - template: Jobs/SAST.gitlab-ci.yml - component: ${CI_SERVER_FQDN}/components/dependency-scanning/main@0.8.0 + - component: ${CI_SERVER_FQDN}/components/dependency-scanning/main@0.8.0 - component: ${CI_SERVER_FQDN}/gitlab-org/components/danger-review/danger-review@2.0.0 inputs: job_stage: lint @@ -26,6 +27,15 @@ include: rules: - if: $CI_PROJECT_ROOT_NAMESPACE != 'gitlab-org' && $CI_PROJECT_ROOT_NAMESPACE != 'gitlab-community' + # Add Work Type Classification labels to merge requests, + # see https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/autolabels.md + - project: "gitlab-com/gl-infra/common-ci-tasks" + ref: v2.93.0 + file: "autolabels.yml" + inputs: + stage: lint + + # Add Work Type Classification labels to merge requests, # see https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/autolabels.md - project: "gitlab-com/gl-infra/common-ci-tasks" @@ -36,6 +46,9 @@ include: # Analyze commits to determine whether to cut a release # see https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/semantic-release.md + - project: "gitlab-com/gl-infra/common-ci-tasks" + ref: v2.93.0 + file: "semantic-release.yml" - project: "gitlab-com/gl-infra/common-ci-tasks" ref: v2.93.0 file: "semantic-release.yml" @@ -53,8 +66,8 @@ stages: parallel: matrix: - GOLANG_IMAGE_VERSION: - - "1.23" - - "1.24" + - '1.24' + - '1.25' .go:base: extends: @@ -108,7 +121,7 @@ golangci-lint: needs: [] variables: REPORT_FILENAME: "gl-code-quality-report.json" - image: golangci/golangci-lint:v2.6.2 + image: golangci/golangci-lint:v2.7.2 script: - golangci-lint run artifacts: @@ -146,15 +159,14 @@ verify-generated-code: tests:unit: extends: - - .go:base - .go:versions stage: test needs: [] image: golang:$GOLANG_IMAGE_VERSION variables: # configure tooling versions - GOTESTSUM_VERSION: "v1.12.0" - GOCOVER_COBERTURA_VERSION: "v1.2.1-0.20240107185409-0818f3538137" + GOTESTSUM_VERSION: 'v1.13.0' + GOCOVER_COBERTURA_VERSION: 'v1.4.0' # configure artifact files JUNIT_FILENAME: tests.xml @@ -178,6 +190,62 @@ tests:unit: coverage_format: cobertura when: always + +tests:integration: + stage: test + rules: + - if: $ENABLE_EE_ACCEPTANCE_TESTS == "true" + needs: [] + image: golang:1.25-bookworm + timeout: 2 hours + services: + - docker:29.1.3-dind + variables: + # Docker-in-docker configuration + DOCKER_HOST: tcp://docker:2376 + DOCKER_TLS_VERIFY: 1 + DOCKER_TLS_CERTDIR: "/certs" + DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client" + + # GitLab test configuration + GITLAB_BASE_URL: http://docker:8095/api/v4 + + # Since we're not using the makefile, this doesn't default to the testing token + # properly. + GITLAB_TOKEN: "glpat-ACCTEST1234567890123" + + # configure tooling versions + GOTESTSUM_VERSION: 'v1.12.0' + GOCOVER_COBERTURA_VERSION: 'v1.2.1-0.20240107185409-0818f3538137' + MISE_VERSION: v2025.6.1 + + # configure artifact files + JUNIT_FILENAME: integration-tests.xml + COVERPROFILE_FILENAME: integration-coverage.out + COVERPROFILE_XML_FILENAME: integration-coverage.xml + before_script: + # Install docker + compose + - curl -fsSL https://get.docker.com | sh + # Install mise + - curl --retry 3 https://mise.run | MISE_VERSION=${MISE_VERSION} MISE_INSTALL_PATH=/usr/local/bin/mise sh + - eval "$(mise activate bash --shims)" + + # Install Go and other tools with mise + - mise install + + # Copy the license to the correct location + - test -f "${GITLAB_LICENSE}" && cp "${GITLAB_LICENSE}" "${CI_PROJECT_DIR}/Gitlab-license.txt" + + # Start GitLab instance + - make testacc-up SERVICE=gitlab-ee + script: + - go run gotest.tools/gotestsum@${GOTESTSUM_VERSION} --format=standard-quiet --junitfile=$JUNIT_FILENAME -- -race -coverprofile=$COVERPROFILE_FILENAME -covermode=atomic -tags=integration ./gitlab_test/... + - grep -v '_generated.go' "$COVERPROFILE_FILENAME" | grep -v '_mock.go' > "${COVERPROFILE_FILENAME}.tmp" + - mv "${COVERPROFILE_FILENAME}.tmp" "$COVERPROFILE_FILENAME" + - go run github.com/boumenot/gocover-cobertura@${GOCOVER_COBERTURA_VERSION} < $COVERPROFILE_FILENAME > $COVERPROFILE_XML_FILENAME + - go tool cover -func $COVERPROFILE_FILENAME + + # Update rules on SAST to ensure the jobs show up in the pipeline # this prevents forks that don't have `ultimate` from skipping SAST scans # since gitlab-advaced-sast replaces semgrep. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/.golangci.yml b/vendor/gitlab.com/gitlab-org/api/client-go/.golangci.yml index 77576563c..79d506cc8 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/.golangci.yml +++ b/vendor/gitlab.com/gitlab-org/api/client-go/.golangci.yml @@ -18,6 +18,7 @@ output: linters: enable: - asciicheck + - canonicalheader - dogsled - dupword - errorlint @@ -51,7 +52,9 @@ linters: - name: deep-exit - name: get-return - name: redundant-import-alias + - name: struct-tag - name: time-date + - name: unused-parameter - name: var-naming staticcheck: checks: @@ -99,28 +102,8 @@ linters: - source: "// GitLab API docs:" linters: - staticcheck - - text: "var-naming: struct field PipelineId should be PipelineID" - path: commits\.go - linters: - - revive - - text: "var-naming: struct field SelectiveSyncNamespaceIds should be SelectiveSyncNamespaceIDs" - path: geo_nodes\.go - linters: - - revive - - text: "var-naming: struct field RefsUrl should be RefsURL" - path: import\.go - linters: - - revive - - text: "var-naming: struct field BitbucketServerUrl should be BitbucketServerURL" - path: import\.go - linters: - - revive - - text: "var-naming: struct field CrlUrl should be CrlURL" - path: tags\.go - linters: - - revive - - text: "var-naming: type ServicePingNonSqlMetrics should be ServicePingNonSQLMetrics" - path: usage_data\.go + - path: _test\.go$ + text: unused-parameter linters: - revive paths: diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/.tool-versions b/vendor/gitlab.com/gitlab-org/api/client-go/.tool-versions index 0f1efd88f..1704438c4 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/.tool-versions +++ b/vendor/gitlab.com/gitlab-org/api/client-go/.tool-versions @@ -1,4 +1,4 @@ -golang 1.23 +golang 1.24 golangci-lint 2.6.1 gofumpt 0.8.0 buf 1.55.1 diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/AGENTS.md b/vendor/gitlab.com/gitlab-org/api/client-go/AGENTS.md index aa1a06239..234019dab 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/AGENTS.md +++ b/vendor/gitlab.com/gitlab-org/api/client-go/AGENTS.md @@ -29,10 +29,10 @@ is allowed and preferred, since understanding contributing guidelines is not req ```bash # Run all tests with race detection -make test +mise exec -- make test # Run the complete reviewable process (includes tests) -make reviewable +mise exec -- make reviewable ``` ### Test Patterns @@ -73,7 +73,7 @@ The project uses `gofumpt` for code formatting: ```bash # Format all Go files -make fmt +mise exec -- make fmt ``` **Formatting Rules:** @@ -86,7 +86,7 @@ make fmt ```bash # Run all linters -make lint +mise exec -- make lint ``` **Linting Configuration:** @@ -104,10 +104,10 @@ This repository uses gomock to generate testing structs, which are in the `testi ```bash # Generate all code (protobuf, mocks, testing client) -make generate +mise exec -- make generate # Clean generated files -make clean +mise exec -- make clean ``` ### Generation Scripts @@ -260,13 +260,13 @@ func (s *ServiceName) MethodName(opt *MethodOptions, options ...RequestOptionFun **CRITICAL: Linting MUST pass for every build or code modification.** **CRITICAL: Mock generation should be run any time function signatures change** -You can accomplish all three of these by running `make reviewable`, which will do: +You can accomplish all three of these by running `mise exec -- make reviewable`, which will do: -1. `make setup` - Install dependencies -2. `make generate` - Generate required code -3. `make fmt` - Format code -4. `make lint` - Run linters -5. `make test` - Run tests +1. `mise exec -- make setup` - Install dependencies +2. `mise exec -- make generate` - Generate required code +3. `mise exec -- make fmt` - Format code +4. `mise exec -- make lint` - Run linters +5. `mise exec -- make test` - Run tests ## Code Generation Guidelines @@ -276,8 +276,8 @@ You can accomplish all three of these by running `make reviewable`, which will d 2. Define the interface and struct following the established pattern 3. Implement all methods with proper error handling 4. Add comprehensive tests in `new_service_test.go` -5. Run `make generate` to update mocks and testing client -6. Ensure all tests pass with `make test` +5. Run `mise exec -- make generate` to update mocks and testing client +6. Ensure all tests pass with `mise exec -- make test` ### Mock Generation @@ -285,7 +285,7 @@ The repository uses `gomock` for generating mocks: ```bash # Generate mocks for all interfaces -make generate +mise exec -- make generate ``` Mocks are automatically generated in the `testing/` package and should not be manually edited. @@ -351,12 +351,12 @@ fmt.Printf("Total pages: %d\n", resp.TotalPages) ### Common Issues 1. **Tests failing after changes:** - - Run `make generate` to update mocks - - Check for linting errors with `make lint` + - Run `mise exec -- make generate` to update mocks + - Check for linting errors with `mise exec -- make lint` - Ensure all imports are correct 2. **Linting errors:** - - Run `make fmt` to fix formatting issues + - Run `mise exec -- make fmt` to fix formatting issues - Check `.golangci.yml` for specific rule configurations - Address any static analysis warnings @@ -376,9 +376,9 @@ fmt.Printf("Total pages: %d\n", resp.TotalPages) When working with this repository: -1. **Always run tests** - `make test` is mandatory +1. **Always run tests** - `mise exec -- make test` is mandatory 2. **Follow formatting rules** - Use `gofumpt` and respect line limits 3. **Align with GitLab API docs** - Every function must reference official documentation -4. **Generate code when needed** - Run `make generate` after interface changes +4. **Generate code when needed** - Run `mise exec -- make generate` after interface changes 5. **Use proper commenting** - Include GitLab API links and follow format guidelines -6. **Maintain consistency** - Follow established patterns and conventions \ No newline at end of file +6. **Maintain consistency** - Follow established patterns and conventions diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/CHANGELOG.md b/vendor/gitlab.com/gitlab-org/api/client-go/CHANGELOG.md index 65012a99c..b2cd90547 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/CHANGELOG.md +++ b/vendor/gitlab.com/gitlab-org/api/client-go/CHANGELOG.md @@ -1,3 +1,386 @@ +## 1.11.0 + +### 🚀 Features + +- feat(groups): add support for merge related settings ([!2625](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2625)) by [Zubeen](https://gitlab.com/syedzubeen) + +### 🐛 Bug Fixes + +- fix(api): typo in ms teams slug ([!2643](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2643)) by [aishahsofea](https://gitlab.com/aishahsofea) + +### 🔄 Other Changes + +- chore(deps): update module golang.org/x/text to v0.32.0 ([!2642](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2642)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- chore(deps): update module golang.org/x/sys to v0.39.0 ([!2641](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2641)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- chore(deps): update module github.com/godbus/dbus/v5 to v5.2.2 ([!2637](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2637)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- chore(deps): update module github.com/google/go-querystring to v1.2.0 ([!2638](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2638)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) + + + +# [1.11.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.10.0...v1.11.0) (2026-01-05) + + +### Bug Fixes + +* **api:** typo in ms teams slug ([1ed6c95](https://gitlab.com/gitlab-org/api/client-go/commit/1ed6c9509b23db53c3988a2dde2f11d22c8be5f9)) + + +### Features + +* **groups:** add support for merge related settings ([cb8412f](https://gitlab.com/gitlab-org/api/client-go/commit/cb8412fc495d19ee6e44819a2f69fd213d19a199)) + +## 1.10.0 + +### 🚀 Features + +- feat: implement Runner Controller API ([!2634](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2634)) by [Duo Developer](https://gitlab.com/duo-developer) + +### 🔄 Other Changes + +- chore(deps): update module github.com/godbus/dbus/v5 to v5.2.1 ([!2635](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2635)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) + + + +# [1.10.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.9.1...v1.10.0) (2025-12-19) + + +### Features + +* implement Runner Controller API ([66f19f4](https://gitlab.com/gitlab-org/api/client-go/commit/66f19f4073ce87566c7751e0987f857eeb008849)) + +## 1.9.1 + +### 🐛 Bug Fixes + +- fix: use parameters in config.NewClient and Jobs.DownloadArtifactsFile ([!2633](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2633)) by [Oleksandr Redko](https://gitlab.com/alexandear) + +### 🔄 Other Changes + +- test: fix TestCreateMergeRequestContextCommits failing locally ([!2631](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2631)) by [Oleksandr Redko](https://gitlab.com/alexandear) +- Code Refactor Using Request Handlers - 8 ([!2523](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2523)) by [Yashesvinee V](https://gitlab.com/yashes7516) +- Code Refactor Using Request Handlers - 6 ([!2521](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2521)) by [Yashesvinee V](https://gitlab.com/yashes7516) + + + +## [1.9.1](https://gitlab.com/gitlab-org/api/client-go/compare/v1.9.0...v1.9.1) (2025-12-17) + + +### Bug Fixes + +* use parameters in config.NewClient and Jobs.DownloadArtifactsFile ([28b7cd7](https://gitlab.com/gitlab-org/api/client-go/commit/28b7cd72f06777a2d3ec7772870c26565140341a)) + +## 1.9.0 + +### 🚀 Features + +- feat(api): add support for matrix project integration ([!2630](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2630)) by [aishahsofea](https://gitlab.com/aishahsofea) + + + +# [1.9.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.8.2...v1.9.0) (2025-12-16) + + +### Features + +* **api:** add support for matrix project integration ([0a5b11b](https://gitlab.com/gitlab-org/api/client-go/commit/0a5b11b9e2e405fb0a22009d60ce38091cc96625)) + +## 1.8.2 + +### 🐛 Bug Fixes + +- fix: correct omitempty tag in VariableFilter.EnvironmentScope field ([!2629](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2629)) by [Oleksandr Redko](https://gitlab.com/alexandear) + +### 🔄 Other Changes + +- feat(protectedTags): add support for `deploy_key_id` to `protected_tags` ([!2624](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2624)) by [Zubeen](https://gitlab.com/syedzubeen) +- chore(deps): update docker docker tag to v29.1.3 ([!2623](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2623)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- chore(deps): update module buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go to v1.36.11-20251209175733-2a1774d88802.1 ([!2622](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2622)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- chore(deps): update module google.golang.org/protobuf to v1.36.11 ([!2621](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2621)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) + + + +## [1.8.2](https://gitlab.com/gitlab-org/api/client-go/compare/v1.8.1...v1.8.2) (2025-12-15) + + +### Bug Fixes + +* correct omitempty tag in VariableFilter.EnvironmentScope field ([c117da1](https://gitlab.com/gitlab-org/api/client-go/commit/c117da1b123251ba86271d1ce3bf9750617e344f)) + + +### Features + +* **protectedTags:** add support for `deploy_key_id` to `protected_tags` ([c0fc3db](https://gitlab.com/gitlab-org/api/client-go/commit/c0fc3db793b51bfabb0ac8bb42442e6916b9df3f)) + +## 1.8.1 + +### 🐛 Bug Fixes + +- fix(epics): handle datetime format in ISOTime UnmarshalJSON ([!2612](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2612)) by [Zubeen](https://gitlab.com/syedzubeen) + +### 🔄 Other Changes + +- chore(deps): update module buf.build/go/protovalidate to v1.1.0 ([!2619](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2619)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- chore: add deprecation notice for PersonalAccessTokens.RevokePersonalAccessToken ([!2615](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2615)) by [aishahsofea](https://gitlab.com/aishahsofea) +- chore(deps): update golangci/golangci-lint docker tag to v2.7.2 ([!2613](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2613)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- chore(deps): do not use the experimental package ([!2614](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2614)) by [Mikhail Mazurskiy](https://gitlab.com/ash2k) +- test: Replace SkipIfRunningCE with SkipIfNotLicensed ([!2616](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2616)) by [Patrick Rice](https://gitlab.com/PatrickRice) + + + +## [1.8.1](https://gitlab.com/gitlab-org/api/client-go/compare/v1.8.0...v1.8.1) (2025-12-10) + + +### Bug Fixes + +* **epics:** handle datetime format in ISOTime UnmarshalJSON ([257e0ac](https://gitlab.com/gitlab-org/api/client-go/commit/257e0acd29daf887456d924c0063b52ebc2e808f)) + +## 1.8.0 + +### 🚀 Features + +- feat(hooks): add support for all hook event types ([!2606](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2606)) by [Heidi Berry](https://gitlab.com/heidi.berry) + + + +# [1.8.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.7.0...v1.8.0) (2025-12-08) + + +### Features + +* **hooks:** add support for all hook event types ([c3c9ca2](https://gitlab.com/gitlab-org/api/client-go/commit/c3c9ca275969adffca37908d63e5c70f634d7bbe)) + +## 1.7.0 + +### 🚀 Features + +- feat(users): Add support for a user to see only one file diff per page ([!2597](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2597)) by [Zubeen](https://gitlab.com/syedzubeen) + + + +# [1.7.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.6.0...v1.7.0) (2025-12-06) + + +### Features + +* **users:** Add support for a user to see only one file diff per page ([e2a9e09](https://gitlab.com/gitlab-org/api/client-go/commit/e2a9e09e79e7949e0b19dcfc97e3b7b533541856)) + +## 1.6.0 + +### 🚀 Features + +- feat: add admin compliance policy settings API ([!2610](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2610)) by [Hannes Lange](https://gitlab.com/hlange4) + +### 🔄 Other Changes + +- doc: fix typo ([!2603](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2603)) by [Guilhem Bonnefille](https://gitlab.com/gbonnefille) +- chore(deps): update golangci/golangci-lint docker tag to v2.7.1 ([!2611](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2611)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- chore(deps): update docker docker tag to v29.1.2 ([!2609](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2609)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- chore(deps): update golangci/golangci-lint docker tag to v2.7.0 ([!2608](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2608)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) + + + +# [1.6.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.5.0...v1.6.0) (2025-12-05) + + +### Features + +* add admin compliance policy settings API ([5c17773](https://gitlab.com/gitlab-org/api/client-go/commit/5c17773ca94ddece28978c7396bddcc6c65fb6a7)) + +## 1.5.0 + +### 🚀 Features + +- feat(Project Mirrors): Add missing Mirror attributes when reading or updating Project Mirrors ([!2600](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2600)) by [Patrick Rice](https://gitlab.com/PatrickRice) + + + +# [1.5.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.4.1...v1.5.0) (2025-12-03) + + +### Features + +* **Project Mirrors:** Add missing Mirror attributes when reading or updating Project Mirrors ([a49b32d](https://gitlab.com/gitlab-org/api/client-go/commit/a49b32df59aeae97247d21a83be3fab97da1bbfe)) + +## 1.4.1 + +### 🐛 Bug Fixes + +- Encode package managers as CSV in query for dependencies list ([!2604](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2604)) by [Timo Furrer](https://gitlab.com/timofurrer) + + + +## [1.4.1](https://gitlab.com/gitlab-org/api/client-go/compare/v1.4.0...v1.4.1) (2025-12-02) + +## 1.4.0 + +### 🚀 Features + +- feat(integrations): Add attestations integrations ([!2582](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2582)) by [Sam Roque-Worcel](https://gitlab.com/sroque-worcel) + +### 🔄 Other Changes + +- chore(deps): update docker docker tag to v29.1.1 ([!2602](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2602)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) + + + +# [1.4.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.3.1...v1.4.0) (2025-12-02) + + +### Features + +* **integrations:** Add attestations integrations ([4f50db4](https://gitlab.com/gitlab-org/api/client-go/commit/4f50db4acfb19212bfdfc12eb808dbc7ed8d7ad2)) + +## 1.3.1 + +### 🐛 Bug Fixes + +- fix(merge_requests): Reinstate missing request option ([!2601](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2601)) by [Heidi Berry](https://gitlab.com/heidi.berry) + + + +## [1.3.1](https://gitlab.com/gitlab-org/api/client-go/compare/v1.3.0...v1.3.1) (2025-12-01) + + +### Bug Fixes + +* **merge_requests:** Reinstate missing request option ([f5f912d](https://gitlab.com/gitlab-org/api/client-go/commit/f5f912ddc2dfb1af88de8710bde783f3f7ccd7c2)) + +## 1.3.0 + +### 🚀 Features + +- feat(credentials): Add support for revoking group PATs, listing/deleting group SSH keys ([!2594](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2594)) by [Heidi Berry](https://gitlab.com/heidi.berry) + +### 🔄 Other Changes + +- refactor: moved comments to interface ([!2595](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2595)) by [Zubeen](https://gitlab.com/syedzubeen) +- refactor(users): moved comments to interface ([!2596](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2596)) by [Zubeen](https://gitlab.com/syedzubeen) +- refactor: moved comments to interface ([!2599](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2599)) by [Zubeen](https://gitlab.com/syedzubeen) +- Simplify more request functions, introducing NoEscape ([!2592](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2592)) by [Timo Furrer](https://gitlab.com/timofurrer) + + + +# [1.3.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.2.0...v1.3.0) (2025-11-30) + + +### Features + +* **credentials:** Add support for revoking group PATs, listing/deleting group SSH keys ([3439f4f](https://gitlab.com/gitlab-org/api/client-go/commit/3439f4f0345b97dea0abf926ecaac9d3a7eb6769)) + +## 1.2.0 + +### 🚀 Features + +- feat(credentials): Add support for listing all SaaS enterprise user personal access tokens ([!2593](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2593)) by [Heidi Berry](https://gitlab.com/heidi.berry) + +### 🔄 Other Changes + +- Code Refactor Using Request Handlers - 10 ([!2525](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2525)) by [Yashesvinee V](https://gitlab.com/yashes7516) + + + +# [1.2.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.1.0...v1.2.0) (2025-11-27) + + +### Features + +* **credentials:** Add support for listing all SaaS enterprise user personal access tokens ([3697779](https://gitlab.com/gitlab-org/api/client-go/commit/369777938e435b043e37460ff1feffedd84b7dd1)) + +## 1.1.0 + +### 🚀 Features + +- feat(service_account): allow providing email when update a Service Account ([!2589](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2589)) by [kilianpaquier](https://gitlab.com/u.kilianpaquier) + +### 🔄 Other Changes + +- Bump dependencies ([!2591](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2591)) by [Timo Furrer](https://gitlab.com/timofurrer) +- chore(deps): update docker docker tag to v29 ([!2586](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2586)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) + + + +# [1.1.0](https://gitlab.com/gitlab-org/api/client-go/compare/v1.0.1...v1.1.0) (2025-11-26) + + +### Features + +* **service_account:** allow providing email when update a Service Account ([324d080](https://gitlab.com/gitlab-org/api/client-go/commit/324d0806a5cd8cb6ae7f68381d09cf5e2a31a0cc)) + +## 1.0.1 + +### 🐛 Bug Fixes + +- fix: fix ReviewerID() and let it accept int64 ([!2587](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2587)) by [Ilya Savitsky](https://gitlab.com/ipsavitsky234) + + + +## [1.0.1](https://gitlab.com/gitlab-org/api/client-go/compare/v1.0.0...v1.0.1) (2025-11-25) + + +### Bug Fixes + +* fix ReviewerID() and let it accept int64 ([6a6d439](https://gitlab.com/gitlab-org/api/client-go/commit/6a6d43952b70191358e7b726eff4f7f24a0f7ff6)) + +## 1.0.0 + +### 💥 Breaking Changes + +- Release client-go 1.0 ([!2575](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2575)) by [Patrick Rice](https://gitlab.com/PatrickRice) + + + +# [1.0.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.161.1...v1.0.0) (2025-11-24) + + +* Merge branch 'release-client-1.0' into 'main' ([f06b8c2](https://gitlab.com/gitlab-org/api/client-go/commit/f06b8c2cb4446e2e76a13bbc707c64e22a64d477)) + + +### Bug Fixes + +* **issues:** use AssigneeIDValue for ListProjectIssuesOptions.AssigneeID ([1dcb219](https://gitlab.com/gitlab-org/api/client-go/commit/1dcb219c343bc5b5622ff49933199c003a231bd4)) + + +### Features + +* **ListOptions:** Update ListOptions to use composition instead of aliasing ([60beef3](https://gitlab.com/gitlab-org/api/client-go/commit/60beef36d0f93a7dc66749f55d98defbc1b3fe28)) + + +### BREAKING CHANGES + +* Release 1.0 +* **ListOptions:** ListOptions implementation changed from aliasing to composition +Changelog: Improvements + +## 0.161.1 + +### 🐛 Bug Fixes + +- fix(users): Fix a bug where error parsing causes user blocking to not function properly ([!2584](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2584)) by [Patrick Rice](https://gitlab.com/PatrickRice) + + + +## [0.161.1](https://gitlab.com/gitlab-org/api/client-go/compare/v0.161.0...v0.161.1) (2025-11-24) + + +### Bug Fixes + +* **users:** Fix a bug where error parsing causes user blocking to not function properly ([2ad5506](https://gitlab.com/gitlab-org/api/client-go/commit/2ad55065d624d27d1f539a3c41489989b9a0d036)) + +## 0.161.0 + +### 🚀 Features + +- fix: return detailed API errors for BlockUser instead of generic LDAP message ([!2581](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2581)) by [Zubeen](https://gitlab.com/syedzubeen) + + + +# [0.161.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.160.2...v0.161.0) (2025-11-24) + + +### Bug Fixes + +* return detailed API errors for BlockUser instead of generic LDAP message ([2ba9fa6](https://gitlab.com/gitlab-org/api/client-go/commit/2ba9fa6995de6cadf0dae1bf600979b73ee471ce)) + ## 0.160.2 ### 🐛 Bug Fixes diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/Makefile b/vendor/gitlab.com/gitlab-org/api/client-go/Makefile index 1ae79c886..4c6a18971 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/Makefile +++ b/vendor/gitlab.com/gitlab-org/api/client-go/Makefile @@ -37,3 +37,18 @@ clean: ## Remove generated files test: ## Run tests go test ./... -race + +test-integration: ## Run integration tests + go test ./... -race -tags=integration + +testacc-up: ## Launch a GitLab instance. + GITLAB_TOKEN=$(GITLAB_TOKEN) $(CONTAINER_COMPOSE_ENGINE) up -d $(SERVICE) + GITLAB_BASE_URL=$(GITLAB_BASE_URL) GITLAB_TOKEN=$(GITLAB_TOKEN) ./scripts/await_healthy.sh + +testacc-down: ## Teardown a GitLab instance. + $(CONTAINER_COMPOSE_ENGINE) down --volumes + +SERVICE ?= gitlab-ee-no-license +GITLAB_TOKEN ?= glpat-ACCTEST1234567890123 +GITLAB_BASE_URL ?= http://127.0.0.1:8095/api/v4 +CONTAINER_COMPOSE_ENGINE ?= $(shell docker compose version >/dev/null 2>&1 && echo 'docker compose' || echo 'docker-compose') diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/README.md b/vendor/gitlab.com/gitlab-org/api/client-go/README.md index d1c3f3a9e..13ba22e47 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/README.md +++ b/vendor/gitlab.com/gitlab-org/api/client-go/README.md @@ -7,6 +7,12 @@ A GitLab API client enabling Go programs to interact with GitLab in a simple and [[_TOC_]] +## `client-go` 1.0 Has Been Released! + +We're pleased to announce that version 1.0 has been released for the `client-go` library, which comes with +a backwards-compatibility guarantee. For more details of our major release plans moving forward, and for +migration guides, please see the [Migration Guides](#migration-guides) section below! + ## Usage ```go @@ -293,6 +299,13 @@ and the unit test matrix in [`.gitlab-ci.yml`](/.gitlab-ci.yml). You may also use https://endoflife.date/go to quickly discover the supported Go versions. +### Migration Guides + +`client-go` will release a major update roughly once every 6 months to align to the Go release cycle. Each +major release will publish a migration guide to help users migrate from the previous major release. + +- [Migration Guide for 0.X -> 1.X](docs/release-1.0-migration.md) + ## Contributing Contributions are always welcome. For more information, check out the diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/access_requests.go b/vendor/gitlab.com/gitlab-org/api/client-go/access_requests.go index abff52f9f..b37cd94dd 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/access_requests.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/access_requests.go @@ -23,6 +23,11 @@ import ( type ( AccessRequestsServiceInterface interface { + // ListProjectAccessRequests gets a list of access requests + // viewable by the authenticated user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/access_requests/#list-access-requests-for-a-group-or-project // ListProjectAccessRequests gets a list of access requests // viewable by the authenticated user. // @@ -30,6 +35,12 @@ type ( // https://docs.gitlab.com/api/access_requests/#list-access-requests-for-a-group-or-project ListProjectAccessRequests(pid any, opt *ListAccessRequestsOptions, options ...RequestOptionFunc) ([]*AccessRequest, *Response, error) + // ListGroupAccessRequests gets a list of access requests + // viewable by the authenticated user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/access_requests/#list-access-requests-for-a-group-or-project + // ListGroupAccessRequests gets a list of access requests // viewable by the authenticated user. // @@ -37,6 +48,12 @@ type ( // https://docs.gitlab.com/api/access_requests/#list-access-requests-for-a-group-or-project ListGroupAccessRequests(gid any, opt *ListAccessRequestsOptions, options ...RequestOptionFunc) ([]*AccessRequest, *Response, error) + // RequestProjectAccess requests access for the authenticated user + // to a group or project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/access_requests/#request-access-to-a-group-or-project + // RequestProjectAccess requests access for the authenticated user // to a group or project. // @@ -55,25 +72,25 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/access_requests/#approve-an-access-request - ApproveProjectAccessRequest(pid any, user int, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) + ApproveProjectAccessRequest(pid any, user int64, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) // ApproveGroupAccessRequest approves an access request for the given user. // // GitLab API docs: // https://docs.gitlab.com/api/access_requests/#approve-an-access-request - ApproveGroupAccessRequest(gid any, user int, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) + ApproveGroupAccessRequest(gid any, user int64, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) // DenyProjectAccessRequest denies an access request for the given user. // // GitLab API docs: // https://docs.gitlab.com/api/access_requests/#deny-an-access-request - DenyProjectAccessRequest(pid any, user int, options ...RequestOptionFunc) (*Response, error) + DenyProjectAccessRequest(pid any, user int64, options ...RequestOptionFunc) (*Response, error) // DenyGroupAccessRequest denies an access request for the given user. // // GitLab API docs: // https://docs.gitlab.com/api/access_requests/#deny-an-access-request - DenyGroupAccessRequest(gid any, user int, options ...RequestOptionFunc) (*Response, error) + DenyGroupAccessRequest(gid any, user int64, options ...RequestOptionFunc) (*Response, error) } // AccessRequestsService handles communication with the project/group @@ -92,7 +109,7 @@ var _ AccessRequestsServiceInterface = (*AccessRequestsService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/access_requests/ type AccessRequest struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Name string `json:"name"` State string `json:"state"` @@ -106,7 +123,9 @@ type AccessRequest struct { // // GitLab API docs: // https://docs.gitlab.com/api/access_requests/#list-access-requests-for-a-group-or-project -type ListAccessRequestsOptions ListOptions +type ListAccessRequestsOptions struct { + ListOptions +} func (s *AccessRequestsService) ListProjectAccessRequests(pid any, opt *ListAccessRequestsOptions, options ...RequestOptionFunc) ([]*AccessRequest, *Response, error) { return do[[]*AccessRequest](s.client, @@ -151,7 +170,7 @@ type ApproveAccessRequestOptions struct { AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` } -func (s *AccessRequestsService) ApproveProjectAccessRequest(pid any, user int, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) { +func (s *AccessRequestsService) ApproveProjectAccessRequest(pid any, user int64, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) { return do[*AccessRequest](s.client, withMethod(http.MethodPut), withPath("projects/%s/access_requests/%d/approve", ProjectID{pid}, user), @@ -160,7 +179,7 @@ func (s *AccessRequestsService) ApproveProjectAccessRequest(pid any, user int, o ) } -func (s *AccessRequestsService) ApproveGroupAccessRequest(gid any, user int, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) { +func (s *AccessRequestsService) ApproveGroupAccessRequest(gid any, user int64, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) { return do[*AccessRequest](s.client, withMethod(http.MethodPut), withPath("groups/%s/access_requests/%d/approve", GroupID{gid}, user), @@ -169,7 +188,7 @@ func (s *AccessRequestsService) ApproveGroupAccessRequest(gid any, user int, opt ) } -func (s *AccessRequestsService) DenyProjectAccessRequest(pid any, user int, options ...RequestOptionFunc) (*Response, error) { +func (s *AccessRequestsService) DenyProjectAccessRequest(pid any, user int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/access_requests/%d", ProjectID{pid}, user), @@ -178,7 +197,7 @@ func (s *AccessRequestsService) DenyProjectAccessRequest(pid any, user int, opti return resp, err } -func (s *AccessRequestsService) DenyGroupAccessRequest(gid any, user int, options ...RequestOptionFunc) (*Response, error) { +func (s *AccessRequestsService) DenyGroupAccessRequest(gid any, user int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("groups/%s/access_requests/%d", GroupID{gid}, user), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/admin_compliance_policy_settings.go b/vendor/gitlab.com/gitlab-org/api/client-go/admin_compliance_policy_settings.go new file mode 100644 index 000000000..2da145eb8 --- /dev/null +++ b/vendor/gitlab.com/gitlab-org/api/client-go/admin_compliance_policy_settings.go @@ -0,0 +1,85 @@ +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package gitlab + +import ( + "net/http" +) + +type ( + AdminCompliancePolicySettingsServiceInterface interface { + // GetCompliancePolicySettings gets the current security policy settings for the GitLab instance. + // + // GitLab API docs: + // https://docs.gitlab.com/api/compliance_policy_settings/#get-security-policy-settings + GetCompliancePolicySettings(options ...RequestOptionFunc) (*AdminCompliancePolicySettings, *Response, error) + + // UpdateCompliancePolicySettings updates the security policy settings for the GitLab instance. + // + // GitLab API docs: + // https://docs.gitlab.com/api/compliance_policy_settings/#update-security-policy-settings + UpdateCompliancePolicySettings(opt *UpdateAdminCompliancePolicySettingsOptions, options ...RequestOptionFunc) (*AdminCompliancePolicySettings, *Response, error) + } + + // AdminCompliancePolicySettingsService handles communication with the + // admin compliance policy settings related methods of the GitLab API. + // + // GitLab API docs: + // https://docs.gitlab.com/api/compliance_policy_settings/ + AdminCompliancePolicySettingsService struct { + client *Client + } +) + +var _ AdminCompliancePolicySettingsServiceInterface = (*AdminCompliancePolicySettingsService)(nil) + +// AdminCompliancePolicySettings represents the GitLab admin compliance policy settings. +// +// GitLab API docs: +// https://docs.gitlab.com/api/compliance_policy_settings/ +type AdminCompliancePolicySettings struct { + CSPNamespaceID *int64 `json:"csp_namespace_id"` +} + +func (s AdminCompliancePolicySettings) String() string { + return Stringify(s) +} + +func (s *AdminCompliancePolicySettingsService) GetCompliancePolicySettings(options ...RequestOptionFunc) (*AdminCompliancePolicySettings, *Response, error) { + return do[*AdminCompliancePolicySettings](s.client, + withMethod(http.MethodGet), + withPath("admin/security/compliance_policy_settings"), + withRequestOpts(options...), + ) +} + +// UpdateAdminCompliancePolicySettingsOptions represents the available +// UpdateCompliancePolicySettings() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/compliance_policy_settings/#update-security-policy-settings +type UpdateAdminCompliancePolicySettingsOptions struct { + CSPNamespaceID *int64 `url:"csp_namespace_id,omitempty" json:"csp_namespace_id,omitempty"` +} + +func (s *AdminCompliancePolicySettingsService) UpdateCompliancePolicySettings(opt *UpdateAdminCompliancePolicySettingsOptions, options ...RequestOptionFunc) (*AdminCompliancePolicySettings, *Response, error) { + return do[*AdminCompliancePolicySettings](s.client, + withMethod(http.MethodPut), + withPath("admin/security/compliance_policy_settings"), + withAPIOpts(opt), + withRequestOpts(options...), + ) +} diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/alert_management.go b/vendor/gitlab.com/gitlab-org/api/client-go/alert_management.go index f86e09b44..5fa0ee6b9 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/alert_management.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/alert_management.go @@ -27,25 +27,25 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/alert_management_alerts/#upload-metric-image - UploadMetricImage(pid any, alertIID int, content io.Reader, filename string, opt *UploadMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) + UploadMetricImage(pid any, alertIID int64, content io.Reader, filename string, opt *UploadMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) // ListMetricImages lists all the metric images for a project alert. // // GitLab API docs: // https://docs.gitlab.com/api/alert_management_alerts/#list-metric-images - ListMetricImages(pid any, alertIID int, opt *ListMetricImagesOptions, options ...RequestOptionFunc) ([]*MetricImage, *Response, error) + ListMetricImages(pid any, alertIID int64, opt *ListMetricImagesOptions, options ...RequestOptionFunc) ([]*MetricImage, *Response, error) // UpdateMetricImage updates a metric image for a project alert. // // GitLab API docs: // https://docs.gitlab.com/api/alert_management_alerts/#update-metric-image - UpdateMetricImage(pid any, alertIID int, id int, opt *UpdateMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) + UpdateMetricImage(pid any, alertIID int64, id int64, opt *UpdateMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) // DeleteMetricImage deletes a metric image for a project alert. // // GitLab API docs: // https://docs.gitlab.com/api/alert_management_alerts/#delete-metric-image - DeleteMetricImage(pid any, alertIID int, id int, options ...RequestOptionFunc) (*Response, error) + DeleteMetricImage(pid any, alertIID int64, id int64, options ...RequestOptionFunc) (*Response, error) } // AlertManagementService handles communication with the alert management @@ -65,7 +65,7 @@ var _ AlertManagementServiceInterface = (*AlertManagementService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/alert_management_alerts/ type MetricImage struct { - ID int `json:"id"` + ID int64 `json:"id"` CreatedAt *time.Time `json:"created_at"` Filename string `json:"filename"` FilePath string `json:"file_path"` @@ -82,7 +82,7 @@ type UploadMetricImageOptions struct { URLText *string `url:"url_text,omitempty" json:"url_text,omitempty"` } -func (s *AlertManagementService) UploadMetricImage(pid any, alertIID int, content io.Reader, filename string, opt *UploadMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) { +func (s *AlertManagementService) UploadMetricImage(pid any, alertIID int64, content io.Reader, filename string, opt *UploadMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -111,7 +111,7 @@ type ListMetricImagesOptions struct { ListOptions } -func (s *AlertManagementService) ListMetricImages(pid any, alertIID int, opt *ListMetricImagesOptions, options ...RequestOptionFunc) ([]*MetricImage, *Response, error) { +func (s *AlertManagementService) ListMetricImages(pid any, alertIID int64, opt *ListMetricImagesOptions, options ...RequestOptionFunc) ([]*MetricImage, *Response, error) { return do[[]*MetricImage](s.client, withMethod(http.MethodGet), withPath("projects/%s/alert_management_alerts/%d/metric_images", ProjectID{pid}, alertIID), @@ -129,7 +129,7 @@ type UpdateMetricImageOptions struct { URLText *string `url:"url_text,omitempty" json:"url_text,omitempty"` } -func (s *AlertManagementService) UpdateMetricImage(pid any, alertIID int, id int, opt *UpdateMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) { +func (s *AlertManagementService) UpdateMetricImage(pid any, alertIID int64, id int64, opt *UpdateMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) { return do[*MetricImage](s.client, withMethod(http.MethodPut), withPath("projects/%s/alert_management_alerts/%d/metric_images/%d", ProjectID{pid}, alertIID, id), @@ -138,7 +138,7 @@ func (s *AlertManagementService) UpdateMetricImage(pid any, alertIID int, id int ) } -func (s *AlertManagementService) DeleteMetricImage(pid any, alertIID int, id int, options ...RequestOptionFunc) (*Response, error) { +func (s *AlertManagementService) DeleteMetricImage(pid any, alertIID int64, id int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/alert_management_alerts/%d/metric_images/%d", ProjectID{pid}, alertIID, id), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/application_statistics.go b/vendor/gitlab.com/gitlab-org/api/client-go/application_statistics.go index ba5d2be30..f1be66133 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/application_statistics.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/application_statistics.go @@ -40,17 +40,17 @@ var _ ApplicationStatisticsServiceInterface = (*ApplicationStatisticsService)(ni // // GitLab API docs: https://docs.gitlab.com/api/statistics/ type ApplicationStatistics struct { - Forks int `url:"forks" json:"forks"` - Issues int `url:"issues" json:"issues"` - MergeRequests int `url:"merge_requests" json:"merge_requests"` - Notes int `url:"notes" json:"notes"` - Snippets int `url:"snippets" json:"snippets"` - SSHKeys int `url:"ssh_keys" json:"ssh_keys"` - Milestones int `url:"milestones" json:"milestones"` - Users int `url:"users" json:"users"` - Groups int `url:"groups" json:"groups"` - Projects int `url:"projects" json:"projects"` - ActiveUsers int `url:"active_users" json:"active_users"` + Forks int64 `url:"forks" json:"forks"` + Issues int64 `url:"issues" json:"issues"` + MergeRequests int64 `url:"merge_requests" json:"merge_requests"` + Notes int64 `url:"notes" json:"notes"` + Snippets int64 `url:"snippets" json:"snippets"` + SSHKeys int64 `url:"ssh_keys" json:"ssh_keys"` + Milestones int64 `url:"milestones" json:"milestones"` + Users int64 `url:"users" json:"users"` + Groups int64 `url:"groups" json:"groups"` + Projects int64 `url:"projects" json:"projects"` + ActiveUsers int64 `url:"active_users" json:"active_users"` } func (s *ApplicationStatisticsService) GetApplicationStatistics(options ...RequestOptionFunc) (*ApplicationStatistics, *Response, error) { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/applications.go b/vendor/gitlab.com/gitlab-org/api/client-go/applications.go index 5a4789356..c550ea5e1 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/applications.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/applications.go @@ -38,7 +38,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/applications/#delete-an-application - DeleteApplication(application int, options ...RequestOptionFunc) (*Response, error) + DeleteApplication(application int64, options ...RequestOptionFunc) (*Response, error) } // ApplicationsService handles communication with administrables applications @@ -54,7 +54,7 @@ var _ ApplicationsServiceInterface = (*ApplicationsService)(nil) // Application represents a GitLab application type Application struct { - ID int `json:"id"` + ID int64 `json:"id"` ApplicationID string `json:"application_id"` ApplicationName string `json:"application_name"` Secret string `json:"secret"` @@ -84,7 +84,9 @@ func (s *ApplicationsService) CreateApplication(opt *CreateApplicationOptions, o // ListApplicationsOptions represents the available // ListApplications() options. -type ListApplicationsOptions ListOptions +type ListApplicationsOptions struct { + ListOptions +} func (s *ApplicationsService) ListApplications(opt *ListApplicationsOptions, options ...RequestOptionFunc) ([]*Application, *Response, error) { return do[[]*Application](s.client, @@ -95,7 +97,7 @@ func (s *ApplicationsService) ListApplications(opt *ListApplicationsOptions, opt ) } -func (s *ApplicationsService) DeleteApplication(application int, options ...RequestOptionFunc) (*Response, error) { +func (s *ApplicationsService) DeleteApplication(application int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("applications/%d", application), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/attestations.go b/vendor/gitlab.com/gitlab-org/api/client-go/attestations.go new file mode 100644 index 000000000..161a0b2ec --- /dev/null +++ b/vendor/gitlab.com/gitlab-org/api/client-go/attestations.go @@ -0,0 +1,64 @@ +package gitlab + +import ( + "bytes" + "net/http" + "time" +) + +type ( + AttestationsServiceInterface interface { + // ListAttestations gets a list of all attestations + // + // GitLab API docs: https://docs.gitlab.com/api/attestations + ListAttestations(pid any, subjectDigest string, options ...RequestOptionFunc) ([]*Attestation, *Response, error) + + // DownloadAttestation + // + // GitLab API docs: https://docs.gitlab.com/api/attestations + DownloadAttestation(pid any, attestationIID int64, options ...RequestOptionFunc) ([]byte, *Response, error) + } + + // AttestationsService handles communication with the keys related methods + // of the GitLab API. + // + // GitLab API docs: https://docs.gitlab.com/api/attestations + AttestationsService struct { + client *Client + } +) + +var _ AttestationsServiceInterface = (*AttestationsService)(nil) + +type Attestation struct { + ID int64 `json:"id"` + IID int64 `json:"iid"` + ProjectID int64 `json:"project_id"` + BuildID int64 `json:"build_id"` + Status string `json:"status"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` + ExpireAt *time.Time `json:"expire_at"` + PredicateKind string `json:"predicate_kind"` + PredicateType string `json:"predicate_type"` + SubjectDigest string `json:"subject_digest"` + DownloadURL string `json:"download_url"` +} + +func (s *AttestationsService) ListAttestations(pid any, subjectDigest string, options ...RequestOptionFunc) ([]*Attestation, *Response, error) { + return do[[]*Attestation](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/attestations/%s", ProjectID{pid}, subjectDigest), + withRequestOpts(options...), + ) +} + +func (s *AttestationsService) DownloadAttestation(pid any, attestationIID int64, options ...RequestOptionFunc) ([]byte, *Response, error) { + b, resp, err := do[bytes.Buffer](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/attestations/%d/download", ProjectID{pid}, attestationIID), + withRequestOpts(options...), + ) + + return b.Bytes(), resp, err +} diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/audit_events.go b/vendor/gitlab.com/gitlab-org/api/client-go/audit_events.go index afa6ac1ee..6e98b8e88 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/audit_events.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/audit_events.go @@ -7,6 +7,11 @@ import ( type ( AuditEventsServiceInterface interface { + // ListInstanceAuditEvents gets a list of audit events for instance. + // Authentication as Administrator is required. + // + // GitLab API docs: + // https://docs.gitlab.com/api/audit_events/#retrieve-all-instance-audit-events // ListInstanceAuditEvents gets a list of audit events for instance. // Authentication as Administrator is required. // @@ -19,7 +24,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/audit_events/#retrieve-single-instance-audit-event - GetInstanceAuditEvent(event int, options ...RequestOptionFunc) (*AuditEvent, *Response, error) + GetInstanceAuditEvent(event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) // ListGroupAuditEvents gets a list of audit events for the specified group // viewable by the authenticated user. @@ -31,7 +36,7 @@ type ( // GetGroupAuditEvent gets a specific group audit event. // // GitLab API docs: https://docs.gitlab.com/api/audit_events/#retrieve-a-specific-group-audit-event - GetGroupAuditEvent(gid any, event int, options ...RequestOptionFunc) (*AuditEvent, *Response, error) + GetGroupAuditEvent(gid any, event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) // ListProjectAuditEvents gets a list of audit events for the specified project // viewable by the authenticated user. @@ -42,7 +47,7 @@ type ( // GetProjectAuditEvent gets a specific project audit event. // // GitLab API docs: https://docs.gitlab.com/api/audit_events/#retrieve-a-specific-project-audit-event - GetProjectAuditEvent(pid any, event int, options ...RequestOptionFunc) (*AuditEvent, *Response, error) + GetProjectAuditEvent(pid any, event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) } // AuditEventsService handles communication with the project/group/instance @@ -60,9 +65,9 @@ var _ AuditEventsServiceInterface = (*AuditEventsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/audit_events/ type AuditEvent struct { - ID int `json:"id"` - AuthorID int `json:"author_id"` - EntityID int `json:"entity_id"` + ID int64 `json:"id"` + AuthorID int64 `json:"author_id"` + EntityID int64 `json:"entity_id"` EntityType string `json:"entity_type"` EventName string `json:"event_name"` Details AuditEventDetails `json:"details"` @@ -115,7 +120,7 @@ func (s *AuditEventsService) ListInstanceAuditEvents(opt *ListAuditEventsOptions ) } -func (s *AuditEventsService) GetInstanceAuditEvent(event int, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { +func (s *AuditEventsService) GetInstanceAuditEvent(event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { return do[*AuditEvent](s.client, withMethod(http.MethodGet), withPath("audit_events/%d", event), @@ -132,7 +137,7 @@ func (s *AuditEventsService) ListGroupAuditEvents(gid any, opt *ListAuditEventsO ) } -func (s *AuditEventsService) GetGroupAuditEvent(gid any, event int, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { +func (s *AuditEventsService) GetGroupAuditEvent(gid any, event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { return do[*AuditEvent](s.client, withMethod(http.MethodGet), withPath("groups/%s/audit_events/%d", GroupID{gid}, event), @@ -149,7 +154,7 @@ func (s *AuditEventsService) ListProjectAuditEvents(pid any, opt *ListAuditEvent ) } -func (s *AuditEventsService) GetProjectAuditEvent(pid any, event int, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { +func (s *AuditEventsService) GetProjectAuditEvent(pid any, event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { return do[*AuditEvent](s.client, withMethod(http.MethodGet), withPath("projects/%s/audit_events/%d", ProjectID{pid}, event), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/avatar.go b/vendor/gitlab.com/gitlab-org/api/client-go/avatar.go index f32ec8c71..9b2ed7d0a 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/avatar.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/avatar.go @@ -53,7 +53,7 @@ type Avatar struct { // https://docs.gitlab.com/api/avatar/#get-details-on-an-account-avatar type GetAvatarOptions struct { Email *string `url:"email,omitempty" json:"email,omitempty"` - Size *int `url:"size,omitempty" json:"size,omitempty"` + Size *int64 `url:"size,omitempty" json:"size,omitempty"` } func (s *AvatarRequestsService) GetAvatar(opt *GetAvatarOptions, options ...RequestOptionFunc) (*Avatar, *Response, error) { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/award_emojis.go b/vendor/gitlab.com/gitlab-org/api/client-go/award_emojis.go index 04f26c830..26a2e28c2 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/award_emojis.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/award_emojis.go @@ -27,151 +27,151 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-an-awardables-emoji-reactions - ListMergeRequestAwardEmoji(pid any, mergeRequestIID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + ListMergeRequestAwardEmoji(pid any, mergeRequestIID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) // ListIssueAwardEmoji gets a list of all award emoji on the issue. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-an-awardables-emoji-reactions - ListIssueAwardEmoji(pid any, issueIID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + ListIssueAwardEmoji(pid any, issueIID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) // ListSnippetAwardEmoji gets a list of all award emoji on the snippet. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-an-awardables-emoji-reactions - ListSnippetAwardEmoji(pid any, snippetID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + ListSnippetAwardEmoji(pid any, snippetID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) // GetMergeRequestAwardEmoji get an award emoji from merge request. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-single-emoji-reaction - GetMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + GetMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // GetIssueAwardEmoji get an award emoji from issue. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-single-emoji-reaction - GetIssueAwardEmoji(pid any, issueIID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + GetIssueAwardEmoji(pid any, issueIID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // GetSnippetAwardEmoji get an award emoji from snippet. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-single-emoji-reaction - GetSnippetAwardEmoji(pid any, snippetID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + GetSnippetAwardEmoji(pid any, snippetID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // CreateMergeRequestAwardEmoji get an award emoji from merge request. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction - CreateMergeRequestAwardEmoji(pid any, mergeRequestIID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateMergeRequestAwardEmoji(pid any, mergeRequestIID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // CreateIssueAwardEmoji get an award emoji from issue. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction - CreateIssueAwardEmoji(pid any, issueIID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateIssueAwardEmoji(pid any, issueIID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // CreateSnippetAwardEmoji get an award emoji from snippet. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction - CreateSnippetAwardEmoji(pid any, snippetID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateSnippetAwardEmoji(pid any, snippetID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // DeleteIssueAwardEmoji delete award emoji on an issue. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction - DeleteIssueAwardEmoji(pid any, issueIID, awardID int, options ...RequestOptionFunc) (*Response, error) + DeleteIssueAwardEmoji(pid any, issueIID, awardID int64, options ...RequestOptionFunc) (*Response, error) // DeleteMergeRequestAwardEmoji delete award emoji on a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction - DeleteMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int, options ...RequestOptionFunc) (*Response, error) + DeleteMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int64, options ...RequestOptionFunc) (*Response, error) // DeleteSnippetAwardEmoji delete award emoji on a snippet. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction - DeleteSnippetAwardEmoji(pid any, snippetID, awardID int, options ...RequestOptionFunc) (*Response, error) + DeleteSnippetAwardEmoji(pid any, snippetID, awardID int64, options ...RequestOptionFunc) (*Response, error) // ListIssuesAwardEmojiOnNote gets a list of all award emoji on a note from the // issue. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-a-comments-emoji-reactions - ListIssuesAwardEmojiOnNote(pid any, issueID, noteID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + ListIssuesAwardEmojiOnNote(pid any, issueID, noteID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) // ListMergeRequestAwardEmojiOnNote gets a list of all award emoji on a note // from the merge request. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-a-comments-emoji-reactions - ListMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + ListMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) // ListSnippetAwardEmojiOnNote gets a list of all award emoji on a note from the // snippet. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-a-comments-emoji-reactions - ListSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + ListSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) // GetIssuesAwardEmojiOnNote gets an award emoji on a note from an issue. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-an-emoji-reaction-for-a-comment - GetIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + GetIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // GetMergeRequestAwardEmojiOnNote gets an award emoji on a note from a // merge request. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-an-emoji-reaction-for-a-comment - GetMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + GetMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // GetSnippetAwardEmojiOnNote gets an award emoji on a note from a snippet. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-an-emoji-reaction-for-a-comment - GetSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + GetSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // CreateIssuesAwardEmojiOnNote gets an award emoji on a note from an issue. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction-to-a-comment - CreateIssuesAwardEmojiOnNote(pid any, issueID, noteID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateIssuesAwardEmojiOnNote(pid any, issueID, noteID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // CreateMergeRequestAwardEmojiOnNote gets an award emoji on a note from a // merge request. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction-to-a-comment - CreateMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // CreateSnippetAwardEmojiOnNote gets an award emoji on a note from a snippet. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction-to-a-comment - CreateSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) // DeleteIssuesAwardEmojiOnNote deletes an award emoji on a note from an issue. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction-from-a-comment - DeleteIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int, options ...RequestOptionFunc) (*Response, error) + DeleteIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) // DeleteMergeRequestAwardEmojiOnNote deletes an award emoji on a note from a // merge request. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction-from-a-comment - DeleteMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int, options ...RequestOptionFunc) (*Response, error) + DeleteMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) // DeleteSnippetAwardEmojiOnNote deletes an award emoji on a note from a snippet. // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction-from-a-comment - DeleteSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int, options ...RequestOptionFunc) (*Response, error) + DeleteSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) } // AwardEmojiService handles communication with the emoji awards related methods @@ -189,19 +189,12 @@ var _ AwardEmojiServiceInterface = (*AwardEmojiService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/emoji_reactions/ type AwardEmoji struct { - ID int `json:"id"` - Name string `json:"name"` - User struct { - Name string `json:"name"` - Username string `json:"username"` - ID int `json:"id"` - State string `json:"state"` - AvatarURL string `json:"avatar_url"` - WebURL string `json:"web_url"` - } `json:"user"` + ID int64 `json:"id"` + Name string `json:"name"` + User BasicUser `json:"user"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` - AwardableID int `json:"awardable_id"` + AwardableID int64 `json:"awardable_id"` AwardableType string `json:"awardable_type"` } @@ -216,21 +209,23 @@ const ( // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/ -type ListAwardEmojiOptions ListOptions +type ListAwardEmojiOptions struct { + ListOptions +} -func (s *AwardEmojiService) ListMergeRequestAwardEmoji(pid any, mergeRequestIID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) ListMergeRequestAwardEmoji(pid any, mergeRequestIID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return s.listAwardEmoji(pid, awardMergeRequest, mergeRequestIID, opt, options...) } -func (s *AwardEmojiService) ListIssueAwardEmoji(pid any, issueIID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) ListIssueAwardEmoji(pid any, issueIID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return s.listAwardEmoji(pid, awardIssue, issueIID, opt, options...) } -func (s *AwardEmojiService) ListSnippetAwardEmoji(pid any, snippetID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) ListSnippetAwardEmoji(pid any, snippetID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return s.listAwardEmoji(pid, awardSnippets, snippetID, opt, options...) } -func (s *AwardEmojiService) listAwardEmoji(pid any, resource string, resourceID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) listAwardEmoji(pid any, resource string, resourceID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return do[[]*AwardEmoji](s.client, withMethod(http.MethodGet), withPath("projects/%s/%s/%d/award_emoji", ProjectID{pid}, resource, resourceID), @@ -239,19 +234,19 @@ func (s *AwardEmojiService) listAwardEmoji(pid any, resource string, resourceID ) } -func (s *AwardEmojiService) GetMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) GetMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getAwardEmoji(pid, awardMergeRequest, mergeRequestIID, awardID, options...) } -func (s *AwardEmojiService) GetIssueAwardEmoji(pid any, issueIID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) GetIssueAwardEmoji(pid any, issueIID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getAwardEmoji(pid, awardIssue, issueIID, awardID, options...) } -func (s *AwardEmojiService) GetSnippetAwardEmoji(pid any, snippetID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) GetSnippetAwardEmoji(pid any, snippetID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getAwardEmoji(pid, awardSnippets, snippetID, awardID, options...) } -func (s *AwardEmojiService) getAwardEmoji(pid any, resource string, resourceID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) getAwardEmoji(pid any, resource string, resourceID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return do[*AwardEmoji](s.client, withMethod(http.MethodGet), withPath("projects/%s/%s/%d/award_emoji/%d", ProjectID{pid}, resource, resourceID, awardID), @@ -268,19 +263,19 @@ type CreateAwardEmojiOptions struct { Name string `json:"name"` } -func (s *AwardEmojiService) CreateMergeRequestAwardEmoji(pid any, mergeRequestIID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) CreateMergeRequestAwardEmoji(pid any, mergeRequestIID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.createAwardEmoji(pid, awardMergeRequest, mergeRequestIID, opt, options...) } -func (s *AwardEmojiService) CreateIssueAwardEmoji(pid any, issueIID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) CreateIssueAwardEmoji(pid any, issueIID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.createAwardEmoji(pid, awardIssue, issueIID, opt, options...) } -func (s *AwardEmojiService) CreateSnippetAwardEmoji(pid any, snippetID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) CreateSnippetAwardEmoji(pid any, snippetID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.createAwardEmoji(pid, awardSnippets, snippetID, opt, options...) } -func (s *AwardEmojiService) createAwardEmoji(pid any, resource string, resourceID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) createAwardEmoji(pid any, resource string, resourceID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return do[*AwardEmoji](s.client, withMethod(http.MethodPost), withPath("projects/%s/%s/%d/award_emoji", ProjectID{pid}, resource, resourceID), @@ -289,15 +284,15 @@ func (s *AwardEmojiService) createAwardEmoji(pid any, resource string, resourceI ) } -func (s *AwardEmojiService) DeleteIssueAwardEmoji(pid any, issueIID, awardID int, options ...RequestOptionFunc) (*Response, error) { +func (s *AwardEmojiService) DeleteIssueAwardEmoji(pid any, issueIID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmoji(pid, awardIssue, issueIID, awardID, options...) } -func (s *AwardEmojiService) DeleteMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int, options ...RequestOptionFunc) (*Response, error) { +func (s *AwardEmojiService) DeleteMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmoji(pid, awardMergeRequest, mergeRequestIID, awardID, options...) } -func (s *AwardEmojiService) DeleteSnippetAwardEmoji(pid any, snippetID, awardID int, options ...RequestOptionFunc) (*Response, error) { +func (s *AwardEmojiService) DeleteSnippetAwardEmoji(pid any, snippetID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmoji(pid, awardSnippets, snippetID, awardID, options...) } @@ -305,7 +300,7 @@ func (s *AwardEmojiService) DeleteSnippetAwardEmoji(pid any, snippetID, awardID // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction -func (s *AwardEmojiService) deleteAwardEmoji(pid any, resource string, resourceID, awardID int, options ...RequestOptionFunc) (*Response, error) { +func (s *AwardEmojiService) deleteAwardEmoji(pid any, resource string, resourceID, awardID int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/%s/%d/award_emoji/%d", ProjectID{pid}, resource, resourceID, awardID), @@ -314,19 +309,19 @@ func (s *AwardEmojiService) deleteAwardEmoji(pid any, resource string, resourceI return resp, err } -func (s *AwardEmojiService) ListIssuesAwardEmojiOnNote(pid any, issueID, noteID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) ListIssuesAwardEmojiOnNote(pid any, issueID, noteID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return s.listAwardEmojiOnNote(pid, awardIssue, issueID, noteID, opt, options...) } -func (s *AwardEmojiService) ListMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) ListMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return s.listAwardEmojiOnNote(pid, awardMergeRequest, mergeRequestIID, noteID, opt, options...) } -func (s *AwardEmojiService) ListSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) ListSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return s.listAwardEmojiOnNote(pid, awardSnippets, snippetIID, noteID, opt, options...) } -func (s *AwardEmojiService) listAwardEmojiOnNote(pid any, resources string, resourceID, noteID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) listAwardEmojiOnNote(pid any, resources string, resourceID, noteID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return do[[]*AwardEmoji](s.client, withMethod(http.MethodGet), withPath("projects/%s/%s/%d/notes/%d/award_emoji", ProjectID{pid}, resources, resourceID, noteID), @@ -335,20 +330,20 @@ func (s *AwardEmojiService) listAwardEmojiOnNote(pid any, resources string, reso ) } -func (s *AwardEmojiService) GetIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) GetIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getSingleNoteAwardEmoji(pid, awardIssue, issueID, noteID, awardID, options...) } -func (s *AwardEmojiService) GetMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) GetMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getSingleNoteAwardEmoji(pid, awardMergeRequest, mergeRequestIID, noteID, awardID, options...) } -func (s *AwardEmojiService) GetSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) GetSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getSingleNoteAwardEmoji(pid, awardSnippets, snippetIID, noteID, awardID, options...) } -func (s *AwardEmojiService) getSingleNoteAwardEmoji(pid any, resource string, resourceID, noteID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) getSingleNoteAwardEmoji(pid any, resource string, resourceID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return do[*AwardEmoji](s.client, withMethod(http.MethodGet), withPath("projects/%s/%s/%d/notes/%d/award_emoji/%d", ProjectID{pid}, resource, resourceID, noteID, awardID), @@ -356,15 +351,15 @@ func (s *AwardEmojiService) getSingleNoteAwardEmoji(pid any, resource string, re ) } -func (s *AwardEmojiService) CreateIssuesAwardEmojiOnNote(pid any, issueID, noteID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) CreateIssuesAwardEmojiOnNote(pid any, issueID, noteID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.createAwardEmojiOnNote(pid, awardIssue, issueID, noteID, opt, options...) } -func (s *AwardEmojiService) CreateMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) CreateMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.createAwardEmojiOnNote(pid, awardMergeRequest, mergeRequestIID, noteID, opt, options...) } -func (s *AwardEmojiService) CreateSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) CreateSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.createAwardEmojiOnNote(pid, awardSnippets, snippetIID, noteID, opt, options...) } @@ -372,7 +367,7 @@ func (s *AwardEmojiService) CreateSnippetAwardEmojiOnNote(pid any, snippetIID, n // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction-to-a-comment -func (s *AwardEmojiService) createAwardEmojiOnNote(pid any, resource string, resourceID, noteID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { +func (s *AwardEmojiService) createAwardEmojiOnNote(pid any, resource string, resourceID, noteID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return do[*AwardEmoji](s.client, withMethod(http.MethodPost), withPath("projects/%s/%s/%d/notes/%d/award_emoji", ProjectID{pid}, resource, resourceID, noteID), @@ -381,20 +376,20 @@ func (s *AwardEmojiService) createAwardEmojiOnNote(pid any, resource string, res ) } -func (s *AwardEmojiService) DeleteIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int, options ...RequestOptionFunc) (*Response, error) { +func (s *AwardEmojiService) DeleteIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmojiOnNote(pid, awardIssue, issueID, noteID, awardID, options...) } -func (s *AwardEmojiService) DeleteMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int, options ...RequestOptionFunc) (*Response, error) { +func (s *AwardEmojiService) DeleteMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmojiOnNote(pid, awardMergeRequest, mergeRequestIID, noteID, awardID, options...) } -func (s *AwardEmojiService) DeleteSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int, options ...RequestOptionFunc) (*Response, error) { +func (s *AwardEmojiService) DeleteSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmojiOnNote(pid, awardSnippets, snippetIID, noteID, awardID, options...) } -func (s *AwardEmojiService) deleteAwardEmojiOnNote(pid any, resource string, resourceID, noteID, awardID int, options ...RequestOptionFunc) (*Response, error) { +func (s *AwardEmojiService) deleteAwardEmojiOnNote(pid any, resource string, resourceID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/%s/%d/notes/%d/award_emoji/%d", ProjectID{pid}, resource, resourceID, noteID, awardID), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/boards.go b/vendor/gitlab.com/gitlab-org/api/client-go/boards.go index b0de80153..ef65e8d8b 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/boards.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/boards.go @@ -22,6 +22,10 @@ import ( type ( IssueBoardsServiceInterface interface { + // CreateIssueBoard creates a new issue board. + // + // GitLab API docs: + // https://docs.gitlab.com/api/boards/#create-an-issue-board // CreateIssueBoard creates a new issue board. // // GitLab API docs: @@ -32,13 +36,13 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/boards/#update-an-issue-board - UpdateIssueBoard(pid any, board int, opt *UpdateIssueBoardOptions, options ...RequestOptionFunc) (*IssueBoard, *Response, error) + UpdateIssueBoard(pid any, board int64, opt *UpdateIssueBoardOptions, options ...RequestOptionFunc) (*IssueBoard, *Response, error) // DeleteIssueBoard deletes an issue board. // // GitLab API docs: // https://docs.gitlab.com/api/boards/#delete-an-issue-board - DeleteIssueBoard(pid any, board int, options ...RequestOptionFunc) (*Response, error) + DeleteIssueBoard(pid any, board int64, options ...RequestOptionFunc) (*Response, error) // ListIssueBoards gets a list of all issue boards in a project. // @@ -50,39 +54,39 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/boards/#show-a-single-issue-board - GetIssueBoard(pid any, board int, options ...RequestOptionFunc) (*IssueBoard, *Response, error) + GetIssueBoard(pid any, board int64, options ...RequestOptionFunc) (*IssueBoard, *Response, error) // GetIssueBoardLists gets a list of the issue board's lists. Does not include // backlog and closed lists. // // GitLab API docs: // https://docs.gitlab.com/api/boards/#list-board-lists-in-a-project-issue-board - GetIssueBoardLists(pid any, board int, opt *GetIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) + GetIssueBoardLists(pid any, board int64, opt *GetIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) // GetIssueBoardList gets a single issue board list. // // GitLab API docs: // https://docs.gitlab.com/api/boards/#show-a-single-board-list - GetIssueBoardList(pid any, board, list int, options ...RequestOptionFunc) (*BoardList, *Response, error) + GetIssueBoardList(pid any, board, list int64, options ...RequestOptionFunc) (*BoardList, *Response, error) // CreateIssueBoardList creates a new issue board list. // // GitLab API docs: // https://docs.gitlab.com/api/boards/#create-a-board-list - CreateIssueBoardList(pid any, board int, opt *CreateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) + CreateIssueBoardList(pid any, board int64, opt *CreateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) // UpdateIssueBoardList updates the position of an existing issue board list. // // GitLab API docs: // https://docs.gitlab.com/api/boards/#reorder-a-list-in-a-board - UpdateIssueBoardList(pid any, board, list int, opt *UpdateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) + UpdateIssueBoardList(pid any, board, list int64, opt *UpdateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) // DeleteIssueBoardList soft deletes an issue board list. Only for admins and // project owners. // // GitLab API docs: // https://docs.gitlab.com/api/boards/#delete-a-board-list-from-a-board - DeleteIssueBoardList(pid any, board, list int, options ...RequestOptionFunc) (*Response, error) + DeleteIssueBoardList(pid any, board, list int64, options ...RequestOptionFunc) (*Response, error) } // IssueBoardsService handles communication with the issue board related @@ -100,21 +104,14 @@ var _ IssueBoardsServiceInterface = (*IssueBoardsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/boards/ type IssueBoard struct { - ID int `json:"id"` - Name string `json:"name"` - Project *Project `json:"project"` - Milestone *Milestone `json:"milestone"` - Assignee *struct { - ID int `json:"id"` - Username string `json:"username"` - Name string `json:"name"` - State string `json:"state"` - AvatarURL string `json:"avatar_url"` - WebURL string `json:"web_url"` - } `json:"assignee"` - Lists []*BoardList `json:"lists"` - Weight int `json:"weight"` - Labels []*LabelDetails `json:"labels"` + ID int64 `json:"id"` + Name string `json:"name"` + Project *Project `json:"project"` + Milestone *Milestone `json:"milestone"` + Assignee *BasicUser `json:"assignee"` + Lists []*BoardList `json:"lists"` + Weight int64 `json:"weight"` + Labels []*LabelDetails `json:"labels"` } func (b IssueBoard) String() string { @@ -125,24 +122,33 @@ func (b IssueBoard) String() string { // // GitLab API docs: https://docs.gitlab.com/api/boards/ type BoardList struct { - ID int `json:"id"` - Assignee *struct { - ID int `json:"id"` - Name string `json:"name"` - Username string `json:"username"` - } `json:"assignee"` - Iteration *ProjectIteration `json:"iteration"` - Label *Label `json:"label"` - MaxIssueCount int `json:"max_issue_count"` - MaxIssueWeight int `json:"max_issue_weight"` - Milestone *Milestone `json:"milestone"` - Position int `json:"position"` + ID int64 `json:"id"` + Assignee *BoardListAssignee `json:"assignee"` + Iteration *ProjectIteration `json:"iteration"` + Label *Label `json:"label"` + MaxIssueCount int64 `json:"max_issue_count"` + MaxIssueWeight int64 `json:"max_issue_weight"` + Milestone *Milestone `json:"milestone"` + Position int64 `json:"position"` } func (b BoardList) String() string { return Stringify(b) } +// BoardListAssignee represents a GitLab board list assignee. +// +// GitLab API docs: https://docs.gitlab.com/api/boards/ +type BoardListAssignee struct { + ID int64 `json:"id"` + Name string `json:"name"` + Username string `json:"username"` +} + +func (a BoardListAssignee) String() string { + return Stringify(a) +} + // CreateIssueBoardOptions represents the available CreateIssueBoard() options. // // GitLab API docs: https://docs.gitlab.com/api/boards/#create-an-issue-board @@ -164,13 +170,13 @@ func (s *IssueBoardsService) CreateIssueBoard(pid any, opt *CreateIssueBoardOpti // GitLab API docs: https://docs.gitlab.com/api/boards/#update-an-issue-board type UpdateIssueBoardOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` + AssigneeID *int64 `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + MilestoneID *int64 `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` Labels *LabelOptions `url:"labels,omitempty" json:"labels,omitempty"` - Weight *int `url:"weight,omitempty" json:"weight,omitempty"` + Weight *int64 `url:"weight,omitempty" json:"weight,omitempty"` } -func (s *IssueBoardsService) UpdateIssueBoard(pid any, board int, opt *UpdateIssueBoardOptions, options ...RequestOptionFunc) (*IssueBoard, *Response, error) { +func (s *IssueBoardsService) UpdateIssueBoard(pid any, board int64, opt *UpdateIssueBoardOptions, options ...RequestOptionFunc) (*IssueBoard, *Response, error) { return do[*IssueBoard](s.client, withMethod(http.MethodPut), withPath("projects/%s/boards/%d", ProjectID{pid}, board), @@ -179,7 +185,7 @@ func (s *IssueBoardsService) UpdateIssueBoard(pid any, board int, opt *UpdateIss ) } -func (s *IssueBoardsService) DeleteIssueBoard(pid any, board int, options ...RequestOptionFunc) (*Response, error) { +func (s *IssueBoardsService) DeleteIssueBoard(pid any, board int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/boards/%d", ProjectID{pid}, board), @@ -191,7 +197,9 @@ func (s *IssueBoardsService) DeleteIssueBoard(pid any, board int, options ...Req // ListIssueBoardsOptions represents the available ListIssueBoards() options. // // GitLab API docs: https://docs.gitlab.com/api/boards/#list-project-issue-boards -type ListIssueBoardsOptions ListOptions +type ListIssueBoardsOptions struct { + ListOptions +} func (s *IssueBoardsService) ListIssueBoards(pid any, opt *ListIssueBoardsOptions, options ...RequestOptionFunc) ([]*IssueBoard, *Response, error) { return do[[]*IssueBoard](s.client, @@ -202,7 +210,7 @@ func (s *IssueBoardsService) ListIssueBoards(pid any, opt *ListIssueBoardsOption ) } -func (s *IssueBoardsService) GetIssueBoard(pid any, board int, options ...RequestOptionFunc) (*IssueBoard, *Response, error) { +func (s *IssueBoardsService) GetIssueBoard(pid any, board int64, options ...RequestOptionFunc) (*IssueBoard, *Response, error) { return do[*IssueBoard](s.client, withMethod(http.MethodGet), withPath("projects/%s/boards/%d", ProjectID{pid}, board), @@ -213,9 +221,11 @@ func (s *IssueBoardsService) GetIssueBoard(pid any, board int, options ...Reques // GetIssueBoardListsOptions represents the available GetIssueBoardLists() options. // // GitLab API docs: https://docs.gitlab.com/api/boards/#list-board-lists-in-a-project-issue-board -type GetIssueBoardListsOptions ListOptions +type GetIssueBoardListsOptions struct { + ListOptions +} -func (s *IssueBoardsService) GetIssueBoardLists(pid any, board int, opt *GetIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { +func (s *IssueBoardsService) GetIssueBoardLists(pid any, board int64, opt *GetIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { return do[[]*BoardList](s.client, withMethod(http.MethodGet), withPath("projects/%s/boards/%d/lists", ProjectID{pid}, board), @@ -224,7 +234,7 @@ func (s *IssueBoardsService) GetIssueBoardLists(pid any, board int, opt *GetIssu ) } -func (s *IssueBoardsService) GetIssueBoardList(pid any, board, list int, options ...RequestOptionFunc) (*BoardList, *Response, error) { +func (s *IssueBoardsService) GetIssueBoardList(pid any, board, list int64, options ...RequestOptionFunc) (*BoardList, *Response, error) { return do[*BoardList](s.client, withMethod(http.MethodGet), withPath("projects/%s/boards/%d/lists/%d", ProjectID{pid}, board, list), @@ -237,13 +247,13 @@ func (s *IssueBoardsService) GetIssueBoardList(pid any, board, list int, options // // GitLab API docs: https://docs.gitlab.com/api/boards/#create-a-board-list type CreateIssueBoardListOptions struct { - LabelID *int `url:"label_id,omitempty" json:"label_id,omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` - IterationID *int `url:"iteration_id,omitempty" json:"iteration_id,omitempty"` + LabelID *int64 `url:"label_id,omitempty" json:"label_id,omitempty"` + AssigneeID *int64 `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + MilestoneID *int64 `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` + IterationID *int64 `url:"iteration_id,omitempty" json:"iteration_id,omitempty"` } -func (s *IssueBoardsService) CreateIssueBoardList(pid any, board int, opt *CreateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) { +func (s *IssueBoardsService) CreateIssueBoardList(pid any, board int64, opt *CreateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) { return do[*BoardList](s.client, withMethod(http.MethodPost), withPath("projects/%s/boards/%d/lists", ProjectID{pid}, board), @@ -257,10 +267,10 @@ func (s *IssueBoardsService) CreateIssueBoardList(pid any, board int, opt *Creat // // GitLab API docs: https://docs.gitlab.com/api/boards/#reorder-a-list-in-a-board type UpdateIssueBoardListOptions struct { - Position *int `url:"position" json:"position"` + Position *int64 `url:"position" json:"position"` } -func (s *IssueBoardsService) UpdateIssueBoardList(pid any, board, list int, opt *UpdateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) { +func (s *IssueBoardsService) UpdateIssueBoardList(pid any, board, list int64, opt *UpdateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) { return do[*BoardList](s.client, withMethod(http.MethodPut), withPath("projects/%s/boards/%d/lists/%d", ProjectID{pid}, board, list), @@ -269,7 +279,7 @@ func (s *IssueBoardsService) UpdateIssueBoardList(pid any, board, list int, opt ) } -func (s *IssueBoardsService) DeleteIssueBoardList(pid any, board, list int, options ...RequestOptionFunc) (*Response, error) { +func (s *IssueBoardsService) DeleteIssueBoardList(pid any, board, list int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/boards/%d/lists/%d", ProjectID{pid}, board, list), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/broadcast_messages.go b/vendor/gitlab.com/gitlab-org/api/client-go/broadcast_messages.go index d926f2da1..e40db9d3c 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/broadcast_messages.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/broadcast_messages.go @@ -33,7 +33,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/broadcast_messages/#get-a-specific-broadcast-message - GetBroadcastMessage(broadcast int, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) + GetBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) // CreateBroadcastMessage creates a message to broadcast. // @@ -45,13 +45,13 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/broadcast_messages/#update-a-broadcast-message - UpdateBroadcastMessage(broadcast int, opt *UpdateBroadcastMessageOptions, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) + UpdateBroadcastMessage(broadcast int64, opt *UpdateBroadcastMessageOptions, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) // DeleteBroadcastMessage deletes a broadcasted message. // // GitLab API docs: // https://docs.gitlab.com/api/broadcast_messages/#delete-a-broadcast-message - DeleteBroadcastMessage(broadcast int, options ...RequestOptionFunc) (*Response, error) + DeleteBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*Response, error) } // BroadcastMessagesService handles communication with the broadcast @@ -74,7 +74,7 @@ type BroadcastMessage struct { StartsAt *time.Time `json:"starts_at"` EndsAt *time.Time `json:"ends_at"` Font string `json:"font"` - ID int `json:"id"` + ID int64 `json:"id"` Active bool `json:"active"` TargetAccessLevels []AccessLevelValue `json:"target_access_levels"` TargetPath string `json:"target_path"` @@ -88,7 +88,9 @@ type BroadcastMessage struct { // // GitLab API docs: // https://docs.gitlab.com/api/broadcast_messages/#get-all-broadcast-messages -type ListBroadcastMessagesOptions ListOptions +type ListBroadcastMessagesOptions struct { + ListOptions +} func (s *BroadcastMessagesService) ListBroadcastMessages(opt *ListBroadcastMessagesOptions, options ...RequestOptionFunc) ([]*BroadcastMessage, *Response, error) { return do[[]*BroadcastMessage](s.client, @@ -99,7 +101,7 @@ func (s *BroadcastMessagesService) ListBroadcastMessages(opt *ListBroadcastMessa ) } -func (s *BroadcastMessagesService) GetBroadcastMessage(broadcast int, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) { +func (s *BroadcastMessagesService) GetBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) { return do[*BroadcastMessage](s.client, withMethod(http.MethodGet), withPath("broadcast_messages/%d", broadcast), @@ -150,7 +152,7 @@ type UpdateBroadcastMessageOptions struct { Theme *string `url:"theme,omitempty" json:"theme,omitempty"` } -func (s *BroadcastMessagesService) UpdateBroadcastMessage(broadcast int, opt *UpdateBroadcastMessageOptions, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) { +func (s *BroadcastMessagesService) UpdateBroadcastMessage(broadcast int64, opt *UpdateBroadcastMessageOptions, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) { return do[*BroadcastMessage](s.client, withMethod(http.MethodPut), withPath("broadcast_messages/%d", broadcast), @@ -159,7 +161,7 @@ func (s *BroadcastMessagesService) UpdateBroadcastMessage(broadcast int, opt *Up ) } -func (s *BroadcastMessagesService) DeleteBroadcastMessage(broadcast int, options ...RequestOptionFunc) (*Response, error) { +func (s *BroadcastMessagesService) DeleteBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("broadcast_messages/%d", broadcast), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/bulk_imports.go b/vendor/gitlab.com/gitlab-org/api/client-go/bulk_imports.go index 73ac24341..6ee80bb62 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/bulk_imports.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/bulk_imports.go @@ -52,7 +52,7 @@ type BulkImportStartMigrationOptions struct { // // GitLab API docs: https://docs.gitlab.com/api/bulk_imports/#start-a-new-group-or-project-migration type BulkImportStartMigrationResponse struct { - ID int `json:"id"` + ID int64 `json:"id"` Status string `json:"status"` SourceType string `json:"source_type"` SourceURL string `json:"source_url"` diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/ci_yml_templates.go b/vendor/gitlab.com/gitlab-org/api/client-go/ci_yml_templates.go index 51be9beb3..f57621ee6 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/ci_yml_templates.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/ci_yml_templates.go @@ -69,7 +69,9 @@ type CIYMLTemplateListItem struct { // // GitLab API docs: // https://docs.gitlab.com/api/templates/gitlab_ci_ymls/#list-gitlab-ci-yaml-templates -type ListCIYMLTemplatesOptions ListOptions +type ListCIYMLTemplatesOptions struct { + ListOptions +} func (s *CIYMLTemplatesService) ListAllTemplates(opt *ListCIYMLTemplatesOptions, options ...RequestOptionFunc) ([]*CIYMLTemplateListItem, *Response, error) { return do[[]*CIYMLTemplateListItem](s.client, diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/cluster_agents.go b/vendor/gitlab.com/gitlab-org/api/client-go/cluster_agents.go index 8ae0d697a..bd124bc44 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/cluster_agents.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/cluster_agents.go @@ -23,6 +23,10 @@ import ( type ( ClusterAgentsServiceInterface interface { + // ListAgents returns a list of agents registered for the project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/cluster_agents/#list-the-agents-for-a-project // ListAgents returns a list of agents registered for the project. // // GitLab API docs: @@ -33,7 +37,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#get-details-about-an-agent - GetAgent(pid any, id int, options ...RequestOptionFunc) (*Agent, *Response, error) + GetAgent(pid any, id int64, options ...RequestOptionFunc) (*Agent, *Response, error) // RegisterAgent registers an agent to the project. // @@ -45,31 +49,31 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#delete-a-registered-agent - DeleteAgent(pid any, id int, options ...RequestOptionFunc) (*Response, error) + DeleteAgent(pid any, id int64, options ...RequestOptionFunc) (*Response, error) // ListAgentTokens returns a list of tokens for an agent. // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#list-tokens-for-an-agent - ListAgentTokens(pid any, aid int, opt *ListAgentTokensOptions, options ...RequestOptionFunc) ([]*AgentToken, *Response, error) + ListAgentTokens(pid any, aid int64, opt *ListAgentTokensOptions, options ...RequestOptionFunc) ([]*AgentToken, *Response, error) // GetAgentToken gets a single agent token. // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#get-a-single-agent-token - GetAgentToken(pid any, aid int, id int, options ...RequestOptionFunc) (*AgentToken, *Response, error) + GetAgentToken(pid any, aid int64, id int64, options ...RequestOptionFunc) (*AgentToken, *Response, error) // CreateAgentToken creates a new token for an agent. // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#create-an-agent-token - CreateAgentToken(pid any, aid int, opt *CreateAgentTokenOptions, options ...RequestOptionFunc) (*AgentToken, *Response, error) + CreateAgentToken(pid any, aid int64, opt *CreateAgentTokenOptions, options ...RequestOptionFunc) (*AgentToken, *Response, error) // RevokeAgentToken revokes an agent token. // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#revoke-an-agent-token - RevokeAgentToken(pid any, aid int, id int, options ...RequestOptionFunc) (*Response, error) + RevokeAgentToken(pid any, aid int64, id int64, options ...RequestOptionFunc) (*Response, error) } // ClusterAgentsService handles communication with the cluster agents related @@ -87,15 +91,15 @@ var _ ClusterAgentsServiceInterface = (*ClusterAgentsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/cluster_agents/ type Agent struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` CreatedAt *time.Time `json:"created_at"` - CreatedByUserID int `json:"created_by_user_id"` + CreatedByUserID int64 `json:"created_by_user_id"` ConfigProject ConfigProject `json:"config_project"` } type ConfigProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` Name string `json:"name"` NameWithNamespace string `json:"name_with_namespace"` @@ -113,13 +117,13 @@ func (a Agent) String() string { // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#list-tokens-for-an-agent type AgentToken struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` - AgentID int `json:"agent_id"` + AgentID int64 `json:"agent_id"` Status string `json:"status"` CreatedAt *time.Time `json:"created_at"` - CreatedByUserID int `json:"created_by_user_id"` + CreatedByUserID int64 `json:"created_by_user_id"` LastUsedAt *time.Time `json:"last_used_at"` Token string `json:"token"` } @@ -132,7 +136,9 @@ func (a AgentToken) String() string { // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#list-the-agents-for-a-project -type ListAgentsOptions ListOptions +type ListAgentsOptions struct { + ListOptions +} func (s *ClusterAgentsService) ListAgents(pid any, opt *ListAgentsOptions, options ...RequestOptionFunc) ([]*Agent, *Response, error) { return do[[]*Agent](s.client, @@ -142,7 +148,7 @@ func (s *ClusterAgentsService) ListAgents(pid any, opt *ListAgentsOptions, optio ) } -func (s *ClusterAgentsService) GetAgent(pid any, id int, options ...RequestOptionFunc) (*Agent, *Response, error) { +func (s *ClusterAgentsService) GetAgent(pid any, id int64, options ...RequestOptionFunc) (*Agent, *Response, error) { return do[*Agent](s.client, withPath("projects/%s/cluster_agents/%d", ProjectID{pid}, id), withRequestOpts(options...), @@ -167,7 +173,7 @@ func (s *ClusterAgentsService) RegisterAgent(pid any, opt *RegisterAgentOptions, ) } -func (s *ClusterAgentsService) DeleteAgent(pid any, id int, options ...RequestOptionFunc) (*Response, error) { +func (s *ClusterAgentsService) DeleteAgent(pid any, id int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/cluster_agents/%d", ProjectID{pid}, id), @@ -180,9 +186,11 @@ func (s *ClusterAgentsService) DeleteAgent(pid any, id int, options ...RequestOp // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#list-tokens-for-an-agent -type ListAgentTokensOptions ListOptions +type ListAgentTokensOptions struct { + ListOptions +} -func (s *ClusterAgentsService) ListAgentTokens(pid any, aid int, opt *ListAgentTokensOptions, options ...RequestOptionFunc) ([]*AgentToken, *Response, error) { +func (s *ClusterAgentsService) ListAgentTokens(pid any, aid int64, opt *ListAgentTokensOptions, options ...RequestOptionFunc) ([]*AgentToken, *Response, error) { return do[[]*AgentToken](s.client, withMethod(http.MethodGet), withPath("projects/%s/cluster_agents/%d/tokens", ProjectID{pid}, aid), @@ -191,7 +199,7 @@ func (s *ClusterAgentsService) ListAgentTokens(pid any, aid int, opt *ListAgentT ) } -func (s *ClusterAgentsService) GetAgentToken(pid any, aid int, id int, options ...RequestOptionFunc) (*AgentToken, *Response, error) { +func (s *ClusterAgentsService) GetAgentToken(pid any, aid int64, id int64, options ...RequestOptionFunc) (*AgentToken, *Response, error) { return do[*AgentToken](s.client, withMethod(http.MethodGet), withPath("projects/%s/cluster_agents/%d/tokens/%d", ProjectID{pid}, aid, id), @@ -208,7 +216,7 @@ type CreateAgentTokenOptions struct { Description *string `url:"description,omitempty" json:"description,omitempty"` } -func (s *ClusterAgentsService) CreateAgentToken(pid any, aid int, opt *CreateAgentTokenOptions, options ...RequestOptionFunc) (*AgentToken, *Response, error) { +func (s *ClusterAgentsService) CreateAgentToken(pid any, aid int64, opt *CreateAgentTokenOptions, options ...RequestOptionFunc) (*AgentToken, *Response, error) { return do[*AgentToken](s.client, withMethod(http.MethodPost), withPath("projects/%s/cluster_agents/%d/tokens", ProjectID{pid}, aid), @@ -217,7 +225,7 @@ func (s *ClusterAgentsService) CreateAgentToken(pid any, aid int, opt *CreateAge ) } -func (s *ClusterAgentsService) RevokeAgentToken(pid any, aid int, id int, options ...RequestOptionFunc) (*Response, error) { +func (s *ClusterAgentsService) RevokeAgentToken(pid any, aid int64, id int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/cluster_agents/%d/tokens/%d", ProjectID{pid}, aid, id), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/commits.go b/vendor/gitlab.com/gitlab-org/api/client-go/commits.go index 8ae75588d..5a53fd90a 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/commits.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/commits.go @@ -140,7 +140,7 @@ type Commit struct { Stats *CommitStats `json:"stats"` Status *BuildStateValue `json:"status"` LastPipeline *PipelineInfo `json:"last_pipeline"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Trailers map[string]string `json:"trailers"` ExtendedTrailers map[string]string `json:"extended_trailers"` WebURL string `json:"web_url"` @@ -150,9 +150,9 @@ type Commit struct { // // GitLab API docs: https://docs.gitlab.com/api/commits/ type CommitStats struct { - Additions int `json:"additions"` - Deletions int `json:"deletions"` - Total int `json:"total"` + Additions int64 `json:"additions"` + Deletions int64 `json:"deletions"` + Total int64 `json:"total"` } func (c Commit) String() string { @@ -313,14 +313,14 @@ func (s *CommitsService) GetCommitDiff(pid any, sha string, opt *GetCommitDiffOp type CommitComment struct { Note string `json:"note"` Path string `json:"path"` - Line int `json:"line"` + Line int64 `json:"line"` LineType string `json:"line_type"` Author Author `json:"author"` } // Author represents a GitLab commit author type Author struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Email string `json:"email"` Name string `json:"name"` @@ -337,7 +337,9 @@ func (c CommitComment) String() string { // // GitLab API docs: // https://docs.gitlab.com/api/commits/#get-the-comments-of-a-commit -type GetCommitCommentsOptions ListOptions +type GetCommitCommentsOptions struct { + ListOptions +} func (s *CommitsService) GetCommitComments(pid any, sha string, opt *GetCommitCommentsOptions, options ...RequestOptionFunc) ([]*CommitComment, *Response, error) { return do[[]*CommitComment](s.client, @@ -356,7 +358,7 @@ func (s *CommitsService) GetCommitComments(pid any, sha string, opt *GetCommitCo type PostCommitCommentOptions struct { Note *string `url:"note,omitempty" json:"note,omitempty"` Path *string `url:"path" json:"path"` - Line *int `url:"line" json:"line"` + Line *int64 `url:"line" json:"line"` LineType *string `url:"line_type" json:"line_type"` } @@ -377,7 +379,7 @@ type GetCommitStatusesOptions struct { Ref *string `url:"ref,omitempty" json:"ref,omitempty"` Stage *string `url:"stage,omitempty" json:"stage,omitempty"` Name *string `url:"name,omitempty" json:"name,omitempty"` - PipelineID *int `url:"pipeline_id,omitempty" json:"pipeline_id,omitempty"` + PipelineID *int64 `url:"pipeline_id,omitempty" json:"pipeline_id,omitempty"` All *bool `url:"all,omitempty" json:"all,omitempty"` } @@ -385,7 +387,7 @@ type GetCommitStatusesOptions struct { // // GitLab API docs: https://docs.gitlab.com/api/commits/#commit-status type CommitStatus struct { - ID int `json:"id"` + ID int64 `json:"id"` SHA string `json:"sha"` Ref string `json:"ref"` Status string `json:"status"` @@ -395,7 +397,7 @@ type CommitStatus struct { Name string `json:"name"` AllowFailure bool `json:"allow_failure"` Coverage float64 `json:"coverage"` - PipelineId int `json:"pipeline_id"` + PipelineID int64 `json:"pipeline_id"` Author Author `json:"author"` Description string `json:"description"` TargetURL string `json:"target_url"` @@ -421,7 +423,7 @@ type SetCommitStatusOptions struct { TargetURL *string `url:"target_url,omitempty" json:"target_url,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"` Coverage *float64 `url:"coverage,omitempty" json:"coverage,omitempty"` - PipelineID *int `url:"pipeline_id,omitempty" json:"pipeline_id,omitempty"` + PipelineID *int64 `url:"pipeline_id,omitempty" json:"pipeline_id,omitempty"` } func (s *CommitsService) SetCommitStatus(pid any, sha string, opt *SetCommitStatusOptions, options ...RequestOptionFunc) (*CommitStatus, *Response, error) { @@ -479,12 +481,12 @@ func (s *CommitsService) RevertCommit(pid any, sha string, opt *RevertCommitOpti // GitLab API docs: // https://docs.gitlab.com/api/commits/#get-signature-of-a-commit type GPGSignature struct { - KeyID int `json:"gpg_key_id"` + KeyID int64 `json:"gpg_key_id"` KeyPrimaryKeyID string `json:"gpg_key_primary_keyid"` KeyUserName string `json:"gpg_key_user_name"` KeyUserEmail string `json:"gpg_key_user_email"` VerificationStatus string `json:"verification_status"` - KeySubkeyID int `json:"gpg_key_subkey_id"` + KeySubkeyID int64 `json:"gpg_key_subkey_id"` } func (s *CommitsService) GetGPGSignature(pid any, sha string, options ...RequestOptionFunc) (*GPGSignature, *Response, error) { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/container_registry.go b/vendor/gitlab.com/gitlab-org/api/client-go/container_registry.go index 635beb43f..5ebe2664d 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/container_registry.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/container_registry.go @@ -27,13 +27,13 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#within-a-project - ListProjectRegistryRepositories(pid any, opt *ListRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) + ListProjectRegistryRepositories(pid any, opt *ListProjectRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) // ListGroupRegistryRepositories gets a list of registry repositories in a group. // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#within-a-group - ListGroupRegistryRepositories(gid any, opt *ListRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) + ListGroupRegistryRepositories(gid any, opt *ListGroupRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) // GetSingleRegistryRepository gets the details of single registry repository. // @@ -45,31 +45,31 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#delete-registry-repository - DeleteRegistryRepository(pid any, repository int, options ...RequestOptionFunc) (*Response, error) + DeleteRegistryRepository(pid any, repository int64, options ...RequestOptionFunc) (*Response, error) // ListRegistryRepositoryTags gets a list of tags for given registry repository. // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#list-registry-repository-tags - ListRegistryRepositoryTags(pid any, repository int, opt *ListRegistryRepositoryTagsOptions, options ...RequestOptionFunc) ([]*RegistryRepositoryTag, *Response, error) + ListRegistryRepositoryTags(pid any, repository int64, opt *ListRegistryRepositoryTagsOptions, options ...RequestOptionFunc) ([]*RegistryRepositoryTag, *Response, error) // GetRegistryRepositoryTagDetail get details of a registry repository tag. // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#get-details-of-a-registry-repository-tag - GetRegistryRepositoryTagDetail(pid any, repository int, tagName string, options ...RequestOptionFunc) (*RegistryRepositoryTag, *Response, error) + GetRegistryRepositoryTagDetail(pid any, repository int64, tagName string, options ...RequestOptionFunc) (*RegistryRepositoryTag, *Response, error) // DeleteRegistryRepositoryTag deletes a registry repository tag. // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#delete-a-registry-repository-tag - DeleteRegistryRepositoryTag(pid any, repository int, tagName string, options ...RequestOptionFunc) (*Response, error) + DeleteRegistryRepositoryTag(pid any, repository int64, tagName string, options ...RequestOptionFunc) (*Response, error) // DeleteRegistryRepositoryTags deletes repository tags in bulk based on given criteria. // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#delete-registry-repository-tags-in-bulk - DeleteRegistryRepositoryTags(pid any, repository int, opt *DeleteRegistryRepositoryTagsOptions, options ...RequestOptionFunc) (*Response, error) + DeleteRegistryRepositoryTags(pid any, repository int64, opt *DeleteRegistryRepositoryTagsOptions, options ...RequestOptionFunc) (*Response, error) } // ContainerRegistryService handles communication with the container registry @@ -87,15 +87,15 @@ var _ ContainerRegistryServiceInterface = (*ContainerRegistryService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/container_registry/ type RegistryRepository struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Path string `json:"path"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Location string `json:"location"` CreatedAt *time.Time `json:"created_at"` CleanupPolicyStartedAt *time.Time `json:"cleanup_policy_started_at"` Status *ContainerRegistryStatus `json:"status"` - TagsCount int `json:"tags_count"` + TagsCount int64 `json:"tags_count"` Tags []*RegistryRepositoryTag `json:"tags"` } @@ -114,27 +114,35 @@ type RegistryRepositoryTag struct { ShortRevision string `json:"short_revision"` Digest string `json:"digest"` CreatedAt *time.Time `json:"created_at"` - TotalSize int `json:"total_size"` + TotalSize int64 `json:"total_size"` } func (s RegistryRepositoryTag) String() string { return Stringify(s) } -// ListRegistryRepositoriesOptions represents the available -// ListRegistryRepositories() options. +// ListProjectRegistryRepositoriesOptions represents the available +// ListProjectRegistryRepositories() options. // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#list-registry-repositories -type ListRegistryRepositoriesOptions struct { +type ListProjectRegistryRepositoriesOptions struct { ListOptions - // Deprecated: These options are deprecated for ListGroupRegistryRepositories calls. (Removed in GitLab 15.0) Tags *bool `url:"tags,omitempty" json:"tags,omitempty"` TagsCount *bool `url:"tags_count,omitempty" json:"tags_count,omitempty"` } -func (s *ContainerRegistryService) ListProjectRegistryRepositories(pid any, opt *ListRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) { +// ListGroupRegistryRepositoriesOptions represents the available +// ListGroupRegistryRepositories() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/container_registry/#within-a-group +type ListGroupRegistryRepositoriesOptions struct { + ListOptions +} + +func (s *ContainerRegistryService) ListProjectRegistryRepositories(pid any, opt *ListProjectRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) { return do[[]*RegistryRepository](s.client, withMethod(http.MethodGet), withPath("projects/%s/registry/repositories", ProjectID{pid}), @@ -143,7 +151,7 @@ func (s *ContainerRegistryService) ListProjectRegistryRepositories(pid any, opt ) } -func (s *ContainerRegistryService) ListGroupRegistryRepositories(gid any, opt *ListRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) { +func (s *ContainerRegistryService) ListGroupRegistryRepositories(gid any, opt *ListGroupRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) { return do[[]*RegistryRepository](s.client, withMethod(http.MethodGet), withPath("groups/%s/registry/repositories", GroupID{gid}), @@ -171,7 +179,7 @@ func (s *ContainerRegistryService) GetSingleRegistryRepository(pid any, opt *Get ) } -func (s *ContainerRegistryService) DeleteRegistryRepository(pid any, repository int, options ...RequestOptionFunc) (*Response, error) { +func (s *ContainerRegistryService) DeleteRegistryRepository(pid any, repository int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/registry/repositories/%d", ProjectID{pid}, repository), @@ -185,9 +193,11 @@ func (s *ContainerRegistryService) DeleteRegistryRepository(pid any, repository // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#list-registry-repository-tags -type ListRegistryRepositoryTagsOptions ListOptions +type ListRegistryRepositoryTagsOptions struct { + ListOptions +} -func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid any, repository int, opt *ListRegistryRepositoryTagsOptions, options ...RequestOptionFunc) ([]*RegistryRepositoryTag, *Response, error) { +func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid any, repository int64, opt *ListRegistryRepositoryTagsOptions, options ...RequestOptionFunc) ([]*RegistryRepositoryTag, *Response, error) { return do[[]*RegistryRepositoryTag](s.client, withMethod(http.MethodGet), withPath("projects/%s/registry/repositories/%d/tags", ProjectID{pid}, repository), @@ -196,7 +206,7 @@ func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid any, repositor ) } -func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid any, repository int, tagName string, options ...RequestOptionFunc) (*RegistryRepositoryTag, *Response, error) { +func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid any, repository int64, tagName string, options ...RequestOptionFunc) (*RegistryRepositoryTag, *Response, error) { return do[*RegistryRepositoryTag](s.client, withMethod(http.MethodGet), withPath("projects/%s/registry/repositories/%d/tags/%s", ProjectID{pid}, repository, tagName), @@ -204,7 +214,7 @@ func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid any, repos ) } -func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid any, repository int, tagName string, options ...RequestOptionFunc) (*Response, error) { +func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid any, repository int64, tagName string, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/registry/repositories/%d/tags/%s", ProjectID{pid}, repository, tagName), @@ -221,14 +231,14 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid any, reposito type DeleteRegistryRepositoryTagsOptions struct { NameRegexpDelete *string `url:"name_regex_delete,omitempty" json:"name_regex_delete,omitempty"` NameRegexpKeep *string `url:"name_regex_keep,omitempty" json:"name_regex_keep,omitempty"` - KeepN *int `url:"keep_n,omitempty" json:"keep_n,omitempty"` + KeepN *int64 `url:"keep_n,omitempty" json:"keep_n,omitempty"` OlderThan *string `url:"older_than,omitempty" json:"older_than,omitempty"` // Deprecated: NameRegexp is deprecated in favor of NameRegexpDelete. NameRegexp *string `url:"name_regex,omitempty" json:"name_regex,omitempty"` } -func (s *ContainerRegistryService) DeleteRegistryRepositoryTags(pid any, repository int, opt *DeleteRegistryRepositoryTagsOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *ContainerRegistryService) DeleteRegistryRepositoryTags(pid any, repository int64, opt *DeleteRegistryRepositoryTagsOptions, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/registry/repositories/%d/tags", ProjectID{pid}, repository), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/container_registry_protection_rules.go b/vendor/gitlab.com/gitlab-org/api/client-go/container_registry_protection_rules.go index 0919dda0e..3f505e547 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/container_registry_protection_rules.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/container_registry_protection_rules.go @@ -20,6 +20,11 @@ import ( type ( ContainerRegistryProtectionRulesServiceInterface interface { + // ListContainerRegistryProtectionRules gets a list of container repository + // protection rules from a project’s container registry. + // + // GitLab API docs: + // https://docs.gitlab.com/api/container_repository_protection_rules/#list-container-repository-protection-rules // ListContainerRegistryProtectionRules gets a list of container repository // protection rules from a project’s container registry. // @@ -27,6 +32,12 @@ type ( // https://docs.gitlab.com/api/container_repository_protection_rules/#list-container-repository-protection-rules ListContainerRegistryProtectionRules(pid any, options ...RequestOptionFunc) ([]*ContainerRegistryProtectionRule, *Response, error) + // CreateContainerRegistryProtectionRule creates a container repository + // protection rule for a project’s container registry. + // + // GitLab API docs: + // https://docs.gitlab.com/api/container_repository_protection_rules/#create-a-container-repository-protection-rule + // CreateContainerRegistryProtectionRule creates a container repository // protection rule for a project’s container registry. // @@ -39,14 +50,14 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/container_repository_protection_rules/#update-a-container-repository-protection-rule - UpdateContainerRegistryProtectionRule(pid any, ruleID int, opt *UpdateContainerRegistryProtectionRuleOptions, options ...RequestOptionFunc) (*ContainerRegistryProtectionRule, *Response, error) + UpdateContainerRegistryProtectionRule(pid any, ruleID int64, opt *UpdateContainerRegistryProtectionRuleOptions, options ...RequestOptionFunc) (*ContainerRegistryProtectionRule, *Response, error) // DeleteContainerRegistryProtectionRule deletes a container repository protection // rule from a project’s container registry. // // GitLab API docs: // https://docs.gitlab.com/api/container_repository_protection_rules/#delete-a-container-repository-protection-rule - DeleteContainerRegistryProtectionRule(pid any, ruleID int, options ...RequestOptionFunc) (*Response, error) + DeleteContainerRegistryProtectionRule(pid any, ruleID int64, options ...RequestOptionFunc) (*Response, error) } // ContainerRegistryProtectionRulesService handles communication with @@ -68,8 +79,8 @@ var _ ContainerRegistryProtectionRulesServiceInterface = (*ContainerRegistryProt // GitLab API docs: // https://docs.gitlab.com/api/container_repository_protection_rules/ type ContainerRegistryProtectionRule struct { - ID int `json:"id"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + ProjectID int64 `json:"project_id"` RepositoryPathPattern string `json:"repository_path_pattern"` MinimumAccessLevelForPush ProtectionRuleAccessLevel `json:"minimum_access_level_for_push"` MinimumAccessLevelForDelete ProtectionRuleAccessLevel `json:"minimum_access_level_for_delete"` @@ -118,7 +129,7 @@ type UpdateContainerRegistryProtectionRuleOptions struct { MinimumAccessLevelForDelete *ProtectionRuleAccessLevel `url:"minimum_access_level_for_delete,omitempty" json:"minimum_access_level_for_delete,omitempty"` } -func (s *ContainerRegistryProtectionRulesService) UpdateContainerRegistryProtectionRule(pid any, ruleID int, opt *UpdateContainerRegistryProtectionRuleOptions, options ...RequestOptionFunc) (*ContainerRegistryProtectionRule, *Response, error) { +func (s *ContainerRegistryProtectionRulesService) UpdateContainerRegistryProtectionRule(pid any, ruleID int64, opt *UpdateContainerRegistryProtectionRuleOptions, options ...RequestOptionFunc) (*ContainerRegistryProtectionRule, *Response, error) { return do[*ContainerRegistryProtectionRule](s.client, withMethod(http.MethodPatch), withPath("projects/%s/registry/protection/repository/rules/%d", ProjectID{pid}, ruleID), @@ -127,7 +138,7 @@ func (s *ContainerRegistryProtectionRulesService) UpdateContainerRegistryProtect ) } -func (s *ContainerRegistryProtectionRulesService) DeleteContainerRegistryProtectionRule(pid any, ruleID int, options ...RequestOptionFunc) (*Response, error) { +func (s *ContainerRegistryProtectionRulesService) DeleteContainerRegistryProtectionRule(pid any, ruleID int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/registry/protection/repository/rules/%d", ProjectID{pid}, ruleID), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/custom_attributes.go b/vendor/gitlab.com/gitlab-org/api/client-go/custom_attributes.go index 02fc554a8..3e3958674 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/custom_attributes.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/custom_attributes.go @@ -26,73 +26,73 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#list-custom-attributes - ListCustomUserAttributes(user int, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) + ListCustomUserAttributes(user int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) // ListCustomGroupAttributes lists the custom attributes of the specified group. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#list-custom-attributes - ListCustomGroupAttributes(group int, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) + ListCustomGroupAttributes(group int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) // ListCustomProjectAttributes lists the custom attributes of the specified project. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#list-custom-attributes - ListCustomProjectAttributes(project int, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) + ListCustomProjectAttributes(project int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) // GetCustomUserAttribute returns the user attribute with a specific key. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#single-custom-attribute - GetCustomUserAttribute(user int, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + GetCustomUserAttribute(user int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) // GetCustomGroupAttribute returns the group attribute with a specific key. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#single-custom-attribute - GetCustomGroupAttribute(group int, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + GetCustomGroupAttribute(group int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) // GetCustomProjectAttribute returns the project attribute with a specific key. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#single-custom-attribute - GetCustomProjectAttribute(project int, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + GetCustomProjectAttribute(project int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) // SetCustomUserAttribute sets the custom attributes of the specified user. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#set-custom-attribute - SetCustomUserAttribute(user int, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + SetCustomUserAttribute(user int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) // SetCustomGroupAttribute sets the custom attributes of the specified group. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#set-custom-attribute - SetCustomGroupAttribute(group int, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + SetCustomGroupAttribute(group int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) // SetCustomProjectAttribute sets the custom attributes of the specified project. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#set-custom-attribute - SetCustomProjectAttribute(project int, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + SetCustomProjectAttribute(project int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) // DeleteCustomUserAttribute removes the custom attribute of the specified user. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#delete-custom-attribute - DeleteCustomUserAttribute(user int, key string, options ...RequestOptionFunc) (*Response, error) + DeleteCustomUserAttribute(user int64, key string, options ...RequestOptionFunc) (*Response, error) // DeleteCustomGroupAttribute removes the custom attribute of the specified group. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#delete-custom-attribute - DeleteCustomGroupAttribute(group int, key string, options ...RequestOptionFunc) (*Response, error) + DeleteCustomGroupAttribute(group int64, key string, options ...RequestOptionFunc) (*Response, error) // DeleteCustomProjectAttribute removes the custom attribute of the specified project. // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#delete-custom-attribute - DeleteCustomProjectAttribute(project int, key string, options ...RequestOptionFunc) (*Response, error) + DeleteCustomProjectAttribute(project int64, key string, options ...RequestOptionFunc) (*Response, error) } // CustomAttributesService handles communication with the group, project and @@ -114,19 +114,19 @@ type CustomAttribute struct { Value string `json:"value"` } -func (s *CustomAttributesService) ListCustomUserAttributes(user int, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) ListCustomUserAttributes(user int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { return s.listCustomAttributes("users", user, options...) } -func (s *CustomAttributesService) ListCustomGroupAttributes(group int, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) ListCustomGroupAttributes(group int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { return s.listCustomAttributes("groups", group, options...) } -func (s *CustomAttributesService) ListCustomProjectAttributes(project int, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) ListCustomProjectAttributes(project int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { return s.listCustomAttributes("projects", project, options...) } -func (s *CustomAttributesService) listCustomAttributes(resource string, id int, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) listCustomAttributes(resource string, id int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { res, resp, err := do[[]*CustomAttribute](s.client, withMethod(http.MethodGet), withPath("%s/%d/custom_attributes", resource, id), @@ -139,19 +139,19 @@ func (s *CustomAttributesService) listCustomAttributes(resource string, id int, return res, resp, nil } -func (s *CustomAttributesService) GetCustomUserAttribute(user int, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) GetCustomUserAttribute(user int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.getCustomAttribute("users", user, key, options...) } -func (s *CustomAttributesService) GetCustomGroupAttribute(group int, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) GetCustomGroupAttribute(group int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.getCustomAttribute("groups", group, key, options...) } -func (s *CustomAttributesService) GetCustomProjectAttribute(project int, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) GetCustomProjectAttribute(project int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.getCustomAttribute("projects", project, key, options...) } -func (s *CustomAttributesService) getCustomAttribute(resource string, id int, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) getCustomAttribute(resource string, id int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { res, resp, err := do[*CustomAttribute](s.client, withMethod(http.MethodGet), withPath("%s/%d/custom_attributes/%s", resource, id, key), @@ -164,19 +164,19 @@ func (s *CustomAttributesService) getCustomAttribute(resource string, id int, ke return res, resp, nil } -func (s *CustomAttributesService) SetCustomUserAttribute(user int, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) SetCustomUserAttribute(user int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.setCustomAttribute("users", user, c, options...) } -func (s *CustomAttributesService) SetCustomGroupAttribute(group int, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) SetCustomGroupAttribute(group int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.setCustomAttribute("groups", group, c, options...) } -func (s *CustomAttributesService) SetCustomProjectAttribute(project int, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) SetCustomProjectAttribute(project int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.setCustomAttribute("projects", project, c, options...) } -func (s *CustomAttributesService) setCustomAttribute(resource string, id int, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { +func (s *CustomAttributesService) setCustomAttribute(resource string, id int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { res, resp, err := do[*CustomAttribute](s.client, withMethod(http.MethodPut), withPath("%s/%d/custom_attributes/%s", resource, id, c.Key), @@ -189,19 +189,19 @@ func (s *CustomAttributesService) setCustomAttribute(resource string, id int, c return res, resp, nil } -func (s *CustomAttributesService) DeleteCustomUserAttribute(user int, key string, options ...RequestOptionFunc) (*Response, error) { +func (s *CustomAttributesService) DeleteCustomUserAttribute(user int64, key string, options ...RequestOptionFunc) (*Response, error) { return s.deleteCustomAttribute("users", user, key, options...) } -func (s *CustomAttributesService) DeleteCustomGroupAttribute(group int, key string, options ...RequestOptionFunc) (*Response, error) { +func (s *CustomAttributesService) DeleteCustomGroupAttribute(group int64, key string, options ...RequestOptionFunc) (*Response, error) { return s.deleteCustomAttribute("groups", group, key, options...) } -func (s *CustomAttributesService) DeleteCustomProjectAttribute(project int, key string, options ...RequestOptionFunc) (*Response, error) { +func (s *CustomAttributesService) DeleteCustomProjectAttribute(project int64, key string, options ...RequestOptionFunc) (*Response, error) { return s.deleteCustomAttribute("projects", project, key, options...) } -func (s *CustomAttributesService) deleteCustomAttribute(resource string, id int, key string, options ...RequestOptionFunc) (*Response, error) { +func (s *CustomAttributesService) deleteCustomAttribute(resource string, id int64, key string, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("%s/%d/custom_attributes/%s", resource, id, key), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/database_migrations.go b/vendor/gitlab.com/gitlab-org/api/client-go/database_migrations.go index df02ca308..a7ca83f6a 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/database_migrations.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/database_migrations.go @@ -26,7 +26,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/database_migrations/#mark-a-migration-as-successful - MarkMigrationAsSuccessful(version int, opt *MarkMigrationAsSuccessfulOptions, options ...RequestOptionFunc) (*Response, error) + MarkMigrationAsSuccessful(version int64, opt *MarkMigrationAsSuccessfulOptions, options ...RequestOptionFunc) (*Response, error) } // DatabaseMigrationsService handles communication with the database @@ -49,7 +49,7 @@ type MarkMigrationAsSuccessfulOptions struct { Database string `url:"database,omitempty" json:"database,omitempty"` } -func (s *DatabaseMigrationsService) MarkMigrationAsSuccessful(version int, opt *MarkMigrationAsSuccessfulOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *DatabaseMigrationsService) MarkMigrationAsSuccessful(version int64, opt *MarkMigrationAsSuccessfulOptions, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodPost), withPath("admin/migrations/%d/mark", version), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/dependencies.go b/vendor/gitlab.com/gitlab-org/api/client-go/dependencies.go index e9669ede8..076d0b6bd 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/dependencies.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/dependencies.go @@ -54,7 +54,7 @@ type Dependency struct { type DependencyVulnerability struct { Name string `url:"name" json:"name"` Severity string `url:"severity" json:"severity"` - ID int `url:"id" json:"id"` + ID int64 `url:"id" json:"id"` URL string `url:"url" json:"url"` } @@ -73,7 +73,7 @@ type DependencyLicense struct { // https://docs.gitlab.com/api/dependencies/#list-project-dependencies type ListProjectDependenciesOptions struct { ListOptions - PackageManager []*DependencyPackageManagerValue `url:"package_manager,omitempty" json:"package_manager,omitempty"` + PackageManager []*DependencyPackageManagerValue `url:"package_manager,comma,omitempty" json:"package_manager,omitempty"` } func (s *DependenciesService) ListProjectDependencies(pid any, opt *ListProjectDependenciesOptions, options ...RequestOptionFunc) ([]*Dependency, *Response, error) { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/dependency_list_export.go b/vendor/gitlab.com/gitlab-org/api/client-go/dependency_list_export.go index 675e6af10..e6c21d9ed 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/dependency_list_export.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/dependency_list_export.go @@ -19,13 +19,13 @@ type ( // // GitLab docs: // https://docs.gitlab.com/api/dependency_list_export/#create-a-dependency-list-export - CreateDependencyListExport(pipelineID int, opt *CreateDependencyListExportOptions, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) + CreateDependencyListExport(pipelineID int64, opt *CreateDependencyListExportOptions, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) // GetDependencyListExport gets metadata about a single dependency list export. // // GitLab docs: // https://docs.gitlab.com/api/dependency_list_export/#get-single-dependency-list-export - GetDependencyListExport(id int, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) + GetDependencyListExport(id int64, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) // DownloadDependencyListExport downloads a single dependency list export. // @@ -40,7 +40,7 @@ type ( // // GitLab docs: // https://docs.gitlab.com/api/dependency_list_export/#download-dependency-list-export - DownloadDependencyListExport(id int, options ...RequestOptionFunc) (io.Reader, *Response, error) + DownloadDependencyListExport(id int64, options ...RequestOptionFunc) (io.Reader, *Response, error) } // DependencyListExportService handles communication with the dependency list export @@ -68,7 +68,7 @@ type CreateDependencyListExportOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/dependency_list_export/#create-a-dependency-list-export type DependencyListExport struct { - ID int `json:"id"` + ID int64 `json:"id"` HasFinished bool `json:"has_finished"` Self string `json:"self"` Download string `json:"download"` @@ -76,7 +76,7 @@ type DependencyListExport struct { const defaultExportType = "sbom" -func (s *DependencyListExportService) CreateDependencyListExport(pipelineID int, opt *CreateDependencyListExportOptions, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) { +func (s *DependencyListExportService) CreateDependencyListExport(pipelineID int64, opt *CreateDependencyListExportOptions, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) { // POST /pipelines/:id/dependency_list_exports createExportPath := fmt.Sprintf("pipelines/%d/dependency_list_exports", pipelineID) @@ -101,7 +101,7 @@ func (s *DependencyListExportService) CreateDependencyListExport(pipelineID int, return export, resp, nil } -func (s *DependencyListExportService) GetDependencyListExport(id int, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) { +func (s *DependencyListExportService) GetDependencyListExport(id int64, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) { // GET /dependency_list_exports/:id getExportPath := fmt.Sprintf("dependency_list_exports/%d", id) @@ -119,7 +119,7 @@ func (s *DependencyListExportService) GetDependencyListExport(id int, options .. return export, resp, nil } -func (s *DependencyListExportService) DownloadDependencyListExport(id int, options ...RequestOptionFunc) (io.Reader, *Response, error) { +func (s *DependencyListExportService) DownloadDependencyListExport(id int64, options ...RequestOptionFunc) (io.Reader, *Response, error) { // GET /dependency_list_exports/:id/download downloadExportPath := fmt.Sprintf("dependency_list_exports/%d/download", id) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/deploy_keys.go b/vendor/gitlab.com/gitlab-org/api/client-go/deploy_keys.go index 947d0079a..66e79d9c4 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/deploy_keys.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/deploy_keys.go @@ -23,12 +23,22 @@ import ( type ( DeployKeysServiceInterface interface { + // ListAllDeployKeys gets a list of all deploy keys. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_keys/#list-all-deploy-keys // ListAllDeployKeys gets a list of all deploy keys. // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#list-all-deploy-keys ListAllDeployKeys(opt *ListInstanceDeployKeysOptions, options ...RequestOptionFunc) ([]*InstanceDeployKey, *Response, error) + // AddInstanceDeployKey creates a deploy key for the GitLab instance. + // Requires administrator access. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_keys/#add-deploy-key + // AddInstanceDeployKey creates a deploy key for the GitLab instance. // Requires administrator access. // @@ -36,12 +46,22 @@ type ( // https://docs.gitlab.com/api/deploy_keys/#add-deploy-key AddInstanceDeployKey(opt *AddInstanceDeployKeyOptions, options ...RequestOptionFunc) (*InstanceDeployKey, *Response, error) + // ListProjectDeployKeys gets a list of a project's deploy keys. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_keys/#list-deploy-keys-for-project + // ListProjectDeployKeys gets a list of a project's deploy keys. // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#list-deploy-keys-for-project ListProjectDeployKeys(pid any, opt *ListProjectDeployKeysOptions, options ...RequestOptionFunc) ([]*ProjectDeployKey, *Response, error) + // ListUserProjectDeployKeys gets a list of a user's deploy keys. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_keys/#list-project-deploy-keys-for-user + // ListUserProjectDeployKeys gets a list of a user's deploy keys. // // GitLab API docs: @@ -52,7 +72,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#get-a-single-deploy-key - GetDeployKey(pid any, deployKey int, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) + GetDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) // AddDeployKey creates a new deploy key for a project. If the deploy key already // exists in another project, it will be joined to the project but only if @@ -66,19 +86,19 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#delete-deploy-key - DeleteDeployKey(pid any, deployKey int, options ...RequestOptionFunc) (*Response, error) + DeleteDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*Response, error) // EnableDeployKey enables a deploy key. // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#enable-a-deploy-key - EnableDeployKey(pid any, deployKey int, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) + EnableDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) // UpdateDeployKey updates a deploy key for a project. // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#update-deploy-key - UpdateDeployKey(pid any, deployKey int, opt *UpdateDeployKeyOptions, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) + UpdateDeployKey(pid any, deployKey int64, opt *UpdateDeployKeyOptions, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) } // DeployKeysService handles communication with the keys related methods @@ -95,7 +115,7 @@ var _ DeployKeysServiceInterface = (*DeployKeysService)(nil) // InstanceDeployKey represents a GitLab deploy key with the associated // projects it has write access to. type InstanceDeployKey struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` CreatedAt *time.Time `json:"created_at"` ExpiresAt *time.Time `json:"expires_at"` @@ -112,7 +132,7 @@ func (k InstanceDeployKey) String() string { // DeployKeyProject refers to a project an InstanceDeployKey has write access to. type DeployKeyProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` Name string `json:"name"` NameWithNamespace string `json:"name_with_namespace"` @@ -127,7 +147,7 @@ func (k DeployKeyProject) String() string { // ProjectDeployKey represents a GitLab project deploy key. type ProjectDeployKey struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` Key string `json:"key"` Fingerprint string `json:"fingerprint"` @@ -184,7 +204,9 @@ func (s *DeployKeysService) AddInstanceDeployKey(opt *AddInstanceDeployKeyOption // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#list-deploy-keys-for-project -type ListProjectDeployKeysOptions ListOptions +type ListProjectDeployKeysOptions struct { + ListOptions +} func (s *DeployKeysService) ListProjectDeployKeys(pid any, opt *ListProjectDeployKeysOptions, options ...RequestOptionFunc) ([]*ProjectDeployKey, *Response, error) { return do[[]*ProjectDeployKey](s.client, @@ -199,7 +221,9 @@ func (s *DeployKeysService) ListProjectDeployKeys(pid any, opt *ListProjectDeplo // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#list-project-deploy-keys-for-user -type ListUserProjectDeployKeysOptions ListOptions +type ListUserProjectDeployKeysOptions struct { + ListOptions +} func (s *DeployKeysService) ListUserProjectDeployKeys(uid any, opt *ListUserProjectDeployKeysOptions, options ...RequestOptionFunc) ([]*ProjectDeployKey, *Response, error) { return do[[]*ProjectDeployKey](s.client, @@ -209,7 +233,7 @@ func (s *DeployKeysService) ListUserProjectDeployKeys(uid any, opt *ListUserProj ) } -func (s *DeployKeysService) GetDeployKey(pid any, deployKey int, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) { +func (s *DeployKeysService) GetDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) { return do[*ProjectDeployKey](s.client, withPath("projects/%s/deploy_keys/%d", ProjectID{pid}, deployKey), withRequestOpts(options...), @@ -236,7 +260,7 @@ func (s *DeployKeysService) AddDeployKey(pid any, opt *AddDeployKeyOptions, opti ) } -func (s *DeployKeysService) DeleteDeployKey(pid any, deployKey int, options ...RequestOptionFunc) (*Response, error) { +func (s *DeployKeysService) DeleteDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/deploy_keys/%d", ProjectID{pid}, deployKey), @@ -245,7 +269,7 @@ func (s *DeployKeysService) DeleteDeployKey(pid any, deployKey int, options ...R return resp, err } -func (s *DeployKeysService) EnableDeployKey(pid any, deployKey int, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) { +func (s *DeployKeysService) EnableDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) { return do[*ProjectDeployKey](s.client, withMethod(http.MethodPost), withPath("projects/%s/deploy_keys/%d/enable", ProjectID{pid}, deployKey), @@ -262,7 +286,7 @@ type UpdateDeployKeyOptions struct { CanPush *bool `url:"can_push,omitempty" json:"can_push,omitempty"` } -func (s *DeployKeysService) UpdateDeployKey(pid any, deployKey int, opt *UpdateDeployKeyOptions, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) { +func (s *DeployKeysService) UpdateDeployKey(pid any, deployKey int64, opt *UpdateDeployKeyOptions, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) { return do[*ProjectDeployKey](s.client, withMethod(http.MethodPut), withPath("projects/%s/deploy_keys/%d", ProjectID{pid}, deployKey), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/deploy_tokens.go b/vendor/gitlab.com/gitlab-org/api/client-go/deploy_tokens.go index 0af3cd910..c43394bb3 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/deploy_tokens.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/deploy_tokens.go @@ -24,12 +24,21 @@ import ( type ( DeployTokensServiceInterface interface { + // ListAllDeployTokens gets a list of all deploy tokens. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_tokens/#list-all-deploy-tokens // ListAllDeployTokens gets a list of all deploy tokens. // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#list-all-deploy-tokens ListAllDeployTokens(options ...RequestOptionFunc) ([]*DeployToken, *Response, error) + // ListProjectDeployTokens gets a list of a project's deploy tokens. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_tokens/#list-project-deploy-tokens + // ListProjectDeployTokens gets a list of a project's deploy tokens. // // GitLab API docs: @@ -40,7 +49,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#get-a-project-deploy-token - GetProjectDeployToken(pid any, deployToken int, options ...RequestOptionFunc) (*DeployToken, *Response, error) + GetProjectDeployToken(pid any, deployToken int64, options ...RequestOptionFunc) (*DeployToken, *Response, error) // CreateProjectDeployToken creates a new deploy token for a project. // @@ -52,7 +61,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#delete-a-project-deploy-token - DeleteProjectDeployToken(pid any, deployToken int, options ...RequestOptionFunc) (*Response, error) + DeleteProjectDeployToken(pid any, deployToken int64, options ...RequestOptionFunc) (*Response, error) // ListGroupDeployTokens gets a list of a group’s deploy tokens. // @@ -64,7 +73,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#get-a-group-deploy-token - GetGroupDeployToken(gid any, deployToken int, options ...RequestOptionFunc) (*DeployToken, *Response, error) + GetGroupDeployToken(gid any, deployToken int64, options ...RequestOptionFunc) (*DeployToken, *Response, error) // CreateGroupDeployToken creates a new deploy token for a group. // @@ -76,7 +85,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#delete-a-group-deploy-token - DeleteGroupDeployToken(gid any, deployToken int, options ...RequestOptionFunc) (*Response, error) + DeleteGroupDeployToken(gid any, deployToken int64, options ...RequestOptionFunc) (*Response, error) } // DeployTokensService handles communication with the deploy tokens related methods @@ -90,7 +99,7 @@ type ( // DeployToken represents a GitLab deploy token. type DeployToken struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Username string `json:"username"` ExpiresAt *time.Time `json:"expires_at"` @@ -124,7 +133,9 @@ func (s *DeployTokensService) ListAllDeployTokens(options ...RequestOptionFunc) // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#list-project-deploy-tokens -type ListProjectDeployTokensOptions ListOptions +type ListProjectDeployTokensOptions struct { + ListOptions +} func (s *DeployTokensService) ListProjectDeployTokens(pid any, opt *ListProjectDeployTokensOptions, options ...RequestOptionFunc) ([]*DeployToken, *Response, error) { project, err := parseID(pid) @@ -147,7 +158,7 @@ func (s *DeployTokensService) ListProjectDeployTokens(pid any, opt *ListProjectD return ts, resp, nil } -func (s *DeployTokensService) GetProjectDeployToken(pid any, deployToken int, options ...RequestOptionFunc) (*DeployToken, *Response, error) { +func (s *DeployTokensService) GetProjectDeployToken(pid any, deployToken int64, options ...RequestOptionFunc) (*DeployToken, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -200,7 +211,7 @@ func (s *DeployTokensService) CreateProjectDeployToken(pid any, opt *CreateProje return t, resp, nil } -func (s *DeployTokensService) DeleteProjectDeployToken(pid any, deployToken int, options ...RequestOptionFunc) (*Response, error) { +func (s *DeployTokensService) DeleteProjectDeployToken(pid any, deployToken int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -220,7 +231,9 @@ func (s *DeployTokensService) DeleteProjectDeployToken(pid any, deployToken int, // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#list-group-deploy-tokens -type ListGroupDeployTokensOptions ListOptions +type ListGroupDeployTokensOptions struct { + ListOptions +} func (s *DeployTokensService) ListGroupDeployTokens(gid any, opt *ListGroupDeployTokensOptions, options ...RequestOptionFunc) ([]*DeployToken, *Response, error) { group, err := parseID(gid) @@ -243,7 +256,7 @@ func (s *DeployTokensService) ListGroupDeployTokens(gid any, opt *ListGroupDeplo return ts, resp, nil } -func (s *DeployTokensService) GetGroupDeployToken(gid any, deployToken int, options ...RequestOptionFunc) (*DeployToken, *Response, error) { +func (s *DeployTokensService) GetGroupDeployToken(gid any, deployToken int64, options ...RequestOptionFunc) (*DeployToken, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -296,7 +309,7 @@ func (s *DeployTokensService) CreateGroupDeployToken(gid any, opt *CreateGroupDe return t, resp, nil } -func (s *DeployTokensService) DeleteGroupDeployToken(gid any, deployToken int, options ...RequestOptionFunc) (*Response, error) { +func (s *DeployTokensService) DeleteGroupDeployToken(gid any, deployToken int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/deployments.go b/vendor/gitlab.com/gitlab-org/api/client-go/deployments.go index 92c9f172d..77405df2f 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/deployments.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/deployments.go @@ -23,6 +23,10 @@ import ( type ( // DeploymentsServiceInterface defines all the API methods for the DeploymentsService DeploymentsServiceInterface interface { + // ListProjectDeployments gets a list of deployments in a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deployments/#list-project-deployments // ListProjectDeployments gets a list of deployments in a project. // // GitLab API docs: @@ -33,7 +37,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/deployments/#get-a-specific-deployment - GetProjectDeployment(pid any, deployment int, options ...RequestOptionFunc) (*Deployment, *Response, error) + GetProjectDeployment(pid any, deployment int64, options ...RequestOptionFunc) (*Deployment, *Response, error) // CreateProjectDeployment creates a project deployment. // @@ -45,19 +49,19 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/deployments/#update-a-deployment - UpdateProjectDeployment(pid any, deployment int, opt *UpdateProjectDeploymentOptions, options ...RequestOptionFunc) (*Deployment, *Response, error) + UpdateProjectDeployment(pid any, deployment int64, opt *UpdateProjectDeploymentOptions, options ...RequestOptionFunc) (*Deployment, *Response, error) // ApproveOrRejectProjectDeployment approves or rejects a blocked deployment. // // GitLab API docs: // https://docs.gitlab.com/api/deployments/#approve-or-reject-a-blocked-deployment - ApproveOrRejectProjectDeployment(pid any, deployment int, opt *ApproveOrRejectProjectDeploymentOptions, options ...RequestOptionFunc) (*Response, error) + ApproveOrRejectProjectDeployment(pid any, deployment int64, opt *ApproveOrRejectProjectDeploymentOptions, options ...RequestOptionFunc) (*Response, error) // DeleteProjectDeployment deletes a specific deployment. // // GitLab API docs: // https://docs.gitlab.com/api/deployments/#delete-a-specific-deployment - DeleteProjectDeployment(pid any, deployment int, options ...RequestOptionFunc) (*Response, error) + DeleteProjectDeployment(pid any, deployment int64, options ...RequestOptionFunc) (*Response, error) } // DeploymentsService handles communication with the deployment related methods @@ -73,39 +77,45 @@ var _ DeploymentsServiceInterface = (*DeploymentsService)(nil) // Deployment represents the GitLab deployment type Deployment struct { - ID int `json:"id"` - IID int `json:"iid"` - Ref string `json:"ref"` - SHA string `json:"sha"` - Status string `json:"status"` - CreatedAt *time.Time `json:"created_at"` - UpdatedAt *time.Time `json:"updated_at"` - User *ProjectUser `json:"user"` - Environment *Environment `json:"environment"` - Deployable struct { - ID int `json:"id"` - Status string `json:"status"` - Stage string `json:"stage"` - Name string `json:"name"` - Ref string `json:"ref"` - Tag bool `json:"tag"` - Coverage float64 `json:"coverage"` - CreatedAt *time.Time `json:"created_at"` - StartedAt *time.Time `json:"started_at"` - FinishedAt *time.Time `json:"finished_at"` - Duration float64 `json:"duration"` - User *User `json:"user"` - Commit *Commit `json:"commit"` - Pipeline struct { - ID int `json:"id"` - SHA string `json:"sha"` - Ref string `json:"ref"` - Status string `json:"status"` - CreatedAt *time.Time `json:"created_at"` - UpdatedAt *time.Time `json:"updated_at"` - } `json:"pipeline"` - Runner *Runner `json:"runner"` - } `json:"deployable"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + Ref string `json:"ref"` + SHA string `json:"sha"` + Status string `json:"status"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` + User *ProjectUser `json:"user"` + Environment *Environment `json:"environment"` + Deployable DeploymentDeployable `json:"deployable"` +} + +// DeploymentDeployable represents the Gitlab deployment deployable +type DeploymentDeployable struct { + ID int64 `json:"id"` + Status string `json:"status"` + Stage string `json:"stage"` + Name string `json:"name"` + Ref string `json:"ref"` + Tag bool `json:"tag"` + Coverage float64 `json:"coverage"` + CreatedAt *time.Time `json:"created_at"` + StartedAt *time.Time `json:"started_at"` + FinishedAt *time.Time `json:"finished_at"` + Duration float64 `json:"duration"` + User *User `json:"user"` + Commit *Commit `json:"commit"` + Pipeline DeploymentDeployablePipeline `json:"pipeline"` + Runner *Runner `json:"runner"` +} + +// DeploymentDeployablePipeline represents the Gitlab deployment deployable pipeline +type DeploymentDeployablePipeline struct { + ID int64 `json:"id"` + SHA string `json:"sha"` + Ref string `json:"ref"` + Status string `json:"status"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` } // ListProjectDeploymentsOptions represents the available ListProjectDeployments() options. @@ -136,7 +146,7 @@ func (s *DeploymentsService) ListProjectDeployments(pid any, opts *ListProjectDe ) } -func (s *DeploymentsService) GetProjectDeployment(pid any, deployment int, options ...RequestOptionFunc) (*Deployment, *Response, error) { +func (s *DeploymentsService) GetProjectDeployment(pid any, deployment int64, options ...RequestOptionFunc) (*Deployment, *Response, error) { return do[*Deployment](s.client, withPath("projects/%s/deployments/%d", ProjectID{pid}, deployment), withRequestOpts(options...), @@ -174,7 +184,7 @@ type UpdateProjectDeploymentOptions struct { Status *DeploymentStatusValue `url:"status,omitempty" json:"status,omitempty"` } -func (s *DeploymentsService) UpdateProjectDeployment(pid any, deployment int, opt *UpdateProjectDeploymentOptions, options ...RequestOptionFunc) (*Deployment, *Response, error) { +func (s *DeploymentsService) UpdateProjectDeployment(pid any, deployment int64, opt *UpdateProjectDeploymentOptions, options ...RequestOptionFunc) (*Deployment, *Response, error) { return do[*Deployment](s.client, withMethod(http.MethodPut), withPath("projects/%s/deployments/%d", ProjectID{pid}, deployment), @@ -194,7 +204,7 @@ type ApproveOrRejectProjectDeploymentOptions struct { RepresentedAs *string `url:"represented_as,omitempty" json:"represented_as,omitempty"` } -func (s *DeploymentsService) ApproveOrRejectProjectDeployment(pid any, deployment int, opt *ApproveOrRejectProjectDeploymentOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *DeploymentsService) ApproveOrRejectProjectDeployment(pid any, deployment int64, opt *ApproveOrRejectProjectDeploymentOptions, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodPost), withPath("projects/%s/deployments/%d/approval", ProjectID{pid}, deployment), @@ -204,7 +214,7 @@ func (s *DeploymentsService) ApproveOrRejectProjectDeployment(pid any, deploymen return resp, err } -func (s *DeploymentsService) DeleteProjectDeployment(pid any, deployment int, options ...RequestOptionFunc) (*Response, error) { +func (s *DeploymentsService) DeleteProjectDeployment(pid any, deployment int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/deployments/%d", ProjectID{pid}, deployment), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/deployments_merge_requests.go b/vendor/gitlab.com/gitlab-org/api/client-go/deployments_merge_requests.go index ca5aa8ce1..3f247964c 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/deployments_merge_requests.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/deployments_merge_requests.go @@ -26,7 +26,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/deployments/#list-of-merge-requests-associated-with-a-deployment - ListDeploymentMergeRequests(pid any, deployment int, opts *ListMergeRequestsOptions, options ...RequestOptionFunc) ([]*MergeRequest, *Response, error) + ListDeploymentMergeRequests(pid any, deployment int64, opts *ListMergeRequestsOptions, options ...RequestOptionFunc) ([]*MergeRequest, *Response, error) } // DeploymentMergeRequestsService handles communication with the deployment's @@ -41,7 +41,7 @@ type ( var _ DeploymentMergeRequestsServiceInterface = (*DeploymentMergeRequestsService)(nil) -func (s *DeploymentMergeRequestsService) ListDeploymentMergeRequests(pid any, deployment int, opts *ListMergeRequestsOptions, options ...RequestOptionFunc) ([]*MergeRequest, *Response, error) { +func (s *DeploymentMergeRequestsService) ListDeploymentMergeRequests(pid any, deployment int64, opts *ListMergeRequestsOptions, options ...RequestOptionFunc) ([]*MergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/discussions.go b/vendor/gitlab.com/gitlab-org/api/client-go/discussions.go index a6cc6224b..72d8ddf76 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/discussions.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/discussions.go @@ -29,150 +29,150 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items - ListIssueDiscussions(pid any, issue int, opt *ListIssueDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) + ListIssueDiscussions(pid any, issue int64, opt *ListIssueDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) // GetIssueDiscussion returns a single discussion for a specific project issue. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#get-single-issue-discussion-item - GetIssueDiscussion(pid any, issue int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) + GetIssueDiscussion(pid any, issue int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) // CreateIssueDiscussion creates a new discussion to a single project issue. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#create-new-issue-thread - CreateIssueDiscussion(pid any, issue int, opt *CreateIssueDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + CreateIssueDiscussion(pid any, issue int64, opt *CreateIssueDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) // AddIssueDiscussionNote creates a new note in an existing discussion of an issue. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#add-note-to-existing-issue-thread - AddIssueDiscussionNote(pid any, issue int, discussion string, opt *AddIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + AddIssueDiscussionNote(pid any, issue int64, discussion string, opt *AddIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) // UpdateIssueDiscussionNote modifies an existing note in a discussion of an issue. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#modify-existing-issue-thread-note - UpdateIssueDiscussionNote(pid any, issue int, discussion string, note int, opt *UpdateIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateIssueDiscussionNote(pid any, issue int64, discussion string, note int64, opt *UpdateIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) // DeleteIssueDiscussionNote deletes a note from a discussion of an issue. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#delete-an-issue-thread-note - DeleteIssueDiscussionNote(pid any, issue int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) + DeleteIssueDiscussionNote(pid any, issue int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) // ListSnippetDiscussions gets all discussions for a snippet. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-project-snippet-discussion-items - ListSnippetDiscussions(pid any, snippet int, opt *ListSnippetDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) + ListSnippetDiscussions(pid any, snippet int64, opt *ListSnippetDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) // GetSnippetDiscussion returns a single discussion for a snippet. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#get-single-snippet-discussion-item - GetSnippetDiscussion(pid any, snippet int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) + GetSnippetDiscussion(pid any, snippet int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) // CreateSnippetDiscussion creates a new discussion for a snippet. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#create-new-snippet-thread - CreateSnippetDiscussion(pid any, snippet int, opt *CreateSnippetDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + CreateSnippetDiscussion(pid any, snippet int64, opt *CreateSnippetDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) // AddSnippetDiscussionNote adds a new note to a snippet discussion. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#add-note-to-existing-snippet-thread - AddSnippetDiscussionNote(pid any, snippet int, discussion string, opt *AddSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + AddSnippetDiscussionNote(pid any, snippet int64, discussion string, opt *AddSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) // UpdateSnippetDiscussionNote modifies an existing note in a snippet discussion. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#modify-existing-snippet-thread-note - UpdateSnippetDiscussionNote(pid any, snippet int, discussion string, note int, opt *UpdateSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateSnippetDiscussionNote(pid any, snippet int64, discussion string, note int64, opt *UpdateSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) // DeleteSnippetDiscussionNote deletes a note from a snippet discussion. // // GitLab API docs: https://docs.gitlab.com/api/discussions/#delete-a-snippet-thread-note - DeleteSnippetDiscussionNote(pid any, snippet int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) + DeleteSnippetDiscussionNote(pid any, snippet int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) // ListGroupEpicDiscussions gets all discussions for a group epic. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-group-epic-discussion-items - ListGroupEpicDiscussions(gid any, epic int, opt *ListGroupEpicDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) + ListGroupEpicDiscussions(gid any, epic int64, opt *ListGroupEpicDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) // GetEpicDiscussion returns a single discussion for a group epic. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#get-single-epic-discussion-item - GetEpicDiscussion(gid any, epic int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) + GetEpicDiscussion(gid any, epic int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) // CreateEpicDiscussion creates a new discussion for a group epic. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#create-new-epic-thread - CreateEpicDiscussion(gid any, epic int, opt *CreateEpicDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + CreateEpicDiscussion(gid any, epic int64, opt *CreateEpicDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) // AddEpicDiscussionNote adds a new note to an epic discussion. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#add-note-to-existing-epic-thread - AddEpicDiscussionNote(gid any, epic int, discussion string, opt *AddEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + AddEpicDiscussionNote(gid any, epic int64, discussion string, opt *AddEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) // UpdateEpicDiscussionNote modifies an existing note in an epic discussion. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#modify-existing-epic-thread-note - UpdateEpicDiscussionNote(gid any, epic int, discussion string, note int, opt *UpdateEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateEpicDiscussionNote(gid any, epic int64, discussion string, note int64, opt *UpdateEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) // DeleteEpicDiscussionNote deletes a note from an epic discussion. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#delete-an-epic-thread-note - DeleteEpicDiscussionNote(gid any, epic int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) + DeleteEpicDiscussionNote(gid any, epic int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) // ListMergeRequestDiscussions gets all discussions for a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-project-merge-request-discussion-items - ListMergeRequestDiscussions(pid any, mergeRequest int, opt *ListMergeRequestDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) + ListMergeRequestDiscussions(pid any, mergeRequest int64, opt *ListMergeRequestDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) // GetMergeRequestDiscussion returns a single discussion for a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#get-single-merge-request-discussion-item - GetMergeRequestDiscussion(pid any, mergeRequest int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) + GetMergeRequestDiscussion(pid any, mergeRequest int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) // CreateMergeRequestDiscussion creates a new discussion for a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#create-new-merge-request-thread - CreateMergeRequestDiscussion(pid any, mergeRequest int, opt *CreateMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + CreateMergeRequestDiscussion(pid any, mergeRequest int64, opt *CreateMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) // ResolveMergeRequestDiscussion resolves or unresolves a merge request discussion. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#resolve-a-merge-request-thread - ResolveMergeRequestDiscussion(pid any, mergeRequest int, discussion string, opt *ResolveMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + ResolveMergeRequestDiscussion(pid any, mergeRequest int64, discussion string, opt *ResolveMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) // AddMergeRequestDiscussionNote adds a new note to a merge request discussion. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#add-note-to-existing-merge-request-thread - AddMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, opt *AddMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + AddMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, opt *AddMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) // UpdateMergeRequestDiscussionNote modifies an existing note in a merge request discussion. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#modify-an-existing-merge-request-thread-note - UpdateMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, note int, opt *UpdateMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, note int64, opt *UpdateMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) // DeleteMergeRequestDiscussionNote deletes a note from a merge request discussion. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#delete-a-merge-request-thread-note - DeleteMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) + DeleteMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) // ListCommitDiscussions gets all discussions for a commit. // @@ -180,18 +180,33 @@ type ( // https://docs.gitlab.com/api/discussions/#list-project-commit-discussion-items ListCommitDiscussions(pid any, commit string, opt *ListCommitDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) + // GetCommitDiscussion returns a single discussion for a commit. + // + // GitLab API docs: + // https://docs.gitlab.com/api/discussions/#get-single-commit-discussion-item + // GetCommitDiscussion returns a single discussion for a commit. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#get-single-commit-discussion-item GetCommitDiscussion(pid any, commit string, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) + // CreateCommitDiscussion creates a new discussion for a commit. + // + // GitLab API docs: + // https://docs.gitlab.com/api/discussions/#create-new-commit-thread + // CreateCommitDiscussion creates a new discussion for a commit. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#create-new-commit-thread CreateCommitDiscussion(pid any, commit string, opt *CreateCommitDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + // AddCommitDiscussionNote adds a new note to a commit discussion. + // + // GitLab API docs: + // https://docs.gitlab.com/api/discussions/#add-note-to-existing-commit-thread + // AddCommitDiscussionNote adds a new note to a commit discussion. // // GitLab API docs: @@ -202,13 +217,13 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#modify-an-existing-commit-thread-note - UpdateCommitDiscussionNote(pid any, commit string, discussion string, note int, opt *UpdateCommitDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateCommitDiscussionNote(pid any, commit string, discussion string, note int64, opt *UpdateCommitDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) // DeleteCommitDiscussionNote deletes a note from a commit discussion. // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#delete-a-commit-thread-note - DeleteCommitDiscussionNote(pid any, commit string, discussion string, note int, options ...RequestOptionFunc) (*Response, error) + DeleteCommitDiscussionNote(pid any, commit string, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) } // DiscussionsService handles communication with the discussions related @@ -240,9 +255,11 @@ func (d Discussion) String() string { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items -type ListIssueDiscussionsOptions ListOptions +type ListIssueDiscussionsOptions struct { + ListOptions +} -func (s *DiscussionsService) ListIssueDiscussions(pid any, issue int, opt *ListIssueDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { +func (s *DiscussionsService) ListIssueDiscussions(pid any, issue int64, opt *ListIssueDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -263,7 +280,7 @@ func (s *DiscussionsService) ListIssueDiscussions(pid any, issue int, opt *ListI return ds, resp, nil } -func (s *DiscussionsService) GetIssueDiscussion(pid any, issue int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { +func (s *DiscussionsService) GetIssueDiscussion(pid any, issue int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -298,7 +315,7 @@ type CreateIssueDiscussionOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) CreateIssueDiscussion(pid any, issue int, opt *CreateIssueDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { +func (s *DiscussionsService) CreateIssueDiscussion(pid any, issue int64, opt *CreateIssueDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -329,7 +346,7 @@ type AddIssueDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) AddIssueDiscussionNote(pid any, issue int, discussion string, opt *AddIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *DiscussionsService) AddIssueDiscussionNote(pid any, issue int64, discussion string, opt *AddIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -364,7 +381,7 @@ type UpdateIssueDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) UpdateIssueDiscussionNote(pid any, issue int, discussion string, note int, opt *UpdateIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *DiscussionsService) UpdateIssueDiscussionNote(pid any, issue int64, discussion string, note int64, opt *UpdateIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -390,7 +407,7 @@ func (s *DiscussionsService) UpdateIssueDiscussionNote(pid any, issue int, discu return n, resp, nil } -func (s *DiscussionsService) DeleteIssueDiscussionNote(pid any, issue int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *DiscussionsService) DeleteIssueDiscussionNote(pid any, issue int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -415,9 +432,11 @@ func (s *DiscussionsService) DeleteIssueDiscussionNote(pid any, issue int, discu // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-project-snippet-discussion-items -type ListSnippetDiscussionsOptions ListOptions +type ListSnippetDiscussionsOptions struct { + ListOptions +} -func (s *DiscussionsService) ListSnippetDiscussions(pid any, snippet int, opt *ListSnippetDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { +func (s *DiscussionsService) ListSnippetDiscussions(pid any, snippet int64, opt *ListSnippetDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -438,7 +457,7 @@ func (s *DiscussionsService) ListSnippetDiscussions(pid any, snippet int, opt *L return ds, resp, nil } -func (s *DiscussionsService) GetSnippetDiscussion(pid any, snippet int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { +func (s *DiscussionsService) GetSnippetDiscussion(pid any, snippet int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -473,7 +492,7 @@ type CreateSnippetDiscussionOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) CreateSnippetDiscussion(pid any, snippet int, opt *CreateSnippetDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { +func (s *DiscussionsService) CreateSnippetDiscussion(pid any, snippet int64, opt *CreateSnippetDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -504,7 +523,7 @@ type AddSnippetDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) AddSnippetDiscussionNote(pid any, snippet int, discussion string, opt *AddSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *DiscussionsService) AddSnippetDiscussionNote(pid any, snippet int64, discussion string, opt *AddSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -539,7 +558,7 @@ type UpdateSnippetDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) UpdateSnippetDiscussionNote(pid any, snippet int, discussion string, note int, opt *UpdateSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *DiscussionsService) UpdateSnippetDiscussionNote(pid any, snippet int64, discussion string, note int64, opt *UpdateSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -565,7 +584,7 @@ func (s *DiscussionsService) UpdateSnippetDiscussionNote(pid any, snippet int, d return n, resp, nil } -func (s *DiscussionsService) DeleteSnippetDiscussionNote(pid any, snippet int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *DiscussionsService) DeleteSnippetDiscussionNote(pid any, snippet int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -590,9 +609,11 @@ func (s *DiscussionsService) DeleteSnippetDiscussionNote(pid any, snippet int, d // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-group-epic-discussion-items -type ListGroupEpicDiscussionsOptions ListOptions +type ListGroupEpicDiscussionsOptions struct { + ListOptions +} -func (s *DiscussionsService) ListGroupEpicDiscussions(gid any, epic int, opt *ListGroupEpicDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { +func (s *DiscussionsService) ListGroupEpicDiscussions(gid any, epic int64, opt *ListGroupEpicDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -616,7 +637,7 @@ func (s *DiscussionsService) ListGroupEpicDiscussions(gid any, epic int, opt *Li return ds, resp, nil } -func (s *DiscussionsService) GetEpicDiscussion(gid any, epic int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { +func (s *DiscussionsService) GetEpicDiscussion(gid any, epic int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -651,7 +672,7 @@ type CreateEpicDiscussionOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) CreateEpicDiscussion(gid any, epic int, opt *CreateEpicDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { +func (s *DiscussionsService) CreateEpicDiscussion(gid any, epic int64, opt *CreateEpicDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -685,7 +706,7 @@ type AddEpicDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) AddEpicDiscussionNote(gid any, epic int, discussion string, opt *AddEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *DiscussionsService) AddEpicDiscussionNote(gid any, epic int64, discussion string, opt *AddEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -720,7 +741,7 @@ type UpdateEpicDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) UpdateEpicDiscussionNote(gid any, epic int, discussion string, note int, opt *UpdateEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *DiscussionsService) UpdateEpicDiscussionNote(gid any, epic int64, discussion string, note int64, opt *UpdateEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -746,7 +767,7 @@ func (s *DiscussionsService) UpdateEpicDiscussionNote(gid any, epic int, discuss return n, resp, nil } -func (s *DiscussionsService) DeleteEpicDiscussionNote(gid any, epic int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *DiscussionsService) DeleteEpicDiscussionNote(gid any, epic int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -771,9 +792,11 @@ func (s *DiscussionsService) DeleteEpicDiscussionNote(gid any, epic int, discuss // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-project-merge-request-discussion-items -type ListMergeRequestDiscussionsOptions ListOptions +type ListMergeRequestDiscussionsOptions struct { + ListOptions +} -func (s *DiscussionsService) ListMergeRequestDiscussions(pid any, mergeRequest int, opt *ListMergeRequestDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { +func (s *DiscussionsService) ListMergeRequestDiscussions(pid any, mergeRequest int64, opt *ListMergeRequestDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -797,7 +820,7 @@ func (s *DiscussionsService) ListMergeRequestDiscussions(pid any, mergeRequest i return ds, resp, nil } -func (s *DiscussionsService) GetMergeRequestDiscussion(pid any, mergeRequest int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { +func (s *DiscussionsService) GetMergeRequestDiscussion(pid any, mergeRequest int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -842,11 +865,11 @@ type PositionOptions struct { NewPath *string `url:"new_path,omitempty" json:"new_path,omitempty"` OldPath *string `url:"old_path,omitempty" json:"old_path,omitempty"` PositionType *string `url:"position_type,omitempty" json:"position_type"` - NewLine *int `url:"new_line,omitempty" json:"new_line,omitempty"` - OldLine *int `url:"old_line,omitempty" json:"old_line,omitempty"` + NewLine *int64 `url:"new_line,omitempty" json:"new_line,omitempty"` + OldLine *int64 `url:"old_line,omitempty" json:"old_line,omitempty"` LineRange *LineRangeOptions `url:"line_range,omitempty" json:"line_range,omitempty"` - Width *int `url:"width,omitempty" json:"width,omitempty"` - Height *int `url:"height,omitempty" json:"height,omitempty"` + Width *int64 `url:"width,omitempty" json:"width,omitempty"` + Height *int64 `url:"height,omitempty" json:"height,omitempty"` X *float64 `url:"x,omitempty" json:"x,omitempty"` Y *float64 `url:"y,omitempty" json:"y,omitempty"` } @@ -861,11 +884,11 @@ type LineRangeOptions struct { type LinePositionOptions struct { LineCode *string `url:"line_code,omitempty" json:"line_code,omitempty"` Type *string `url:"type,omitempty" json:"type,omitempty"` - OldLine *int `url:"old_line,omitempty" json:"old_line,omitempty"` - NewLine *int `url:"new_line,omitempty" json:"new_line,omitempty"` + OldLine *int64 `url:"old_line,omitempty" json:"old_line,omitempty"` + NewLine *int64 `url:"new_line,omitempty" json:"new_line,omitempty"` } -func (s *DiscussionsService) CreateMergeRequestDiscussion(pid any, mergeRequest int, opt *CreateMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { +func (s *DiscussionsService) CreateMergeRequestDiscussion(pid any, mergeRequest int64, opt *CreateMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -898,7 +921,7 @@ type ResolveMergeRequestDiscussionOptions struct { Resolved *bool `url:"resolved,omitempty" json:"resolved,omitempty"` } -func (s *DiscussionsService) ResolveMergeRequestDiscussion(pid any, mergeRequest int, discussion string, opt *ResolveMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { +func (s *DiscussionsService) ResolveMergeRequestDiscussion(pid any, mergeRequest int64, discussion string, opt *ResolveMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -933,7 +956,7 @@ type AddMergeRequestDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) AddMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, opt *AddMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *DiscussionsService) AddMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, opt *AddMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -969,7 +992,7 @@ type UpdateMergeRequestDiscussionNoteOptions struct { Resolved *bool `url:"resolved,omitempty" json:"resolved,omitempty"` } -func (s *DiscussionsService) UpdateMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, note int, opt *UpdateMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *DiscussionsService) UpdateMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, note int64, opt *UpdateMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -995,7 +1018,7 @@ func (s *DiscussionsService) UpdateMergeRequestDiscussionNote(pid any, mergeRequ return n, resp, nil } -func (s *DiscussionsService) DeleteMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *DiscussionsService) DeleteMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -1020,7 +1043,9 @@ func (s *DiscussionsService) DeleteMergeRequestDiscussionNote(pid any, mergeRequ // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-project-commit-discussion-items -type ListCommitDiscussionsOptions ListOptions +type ListCommitDiscussionsOptions struct { + ListOptions +} func (s *DiscussionsService) ListCommitDiscussions(pid any, commit string, opt *ListCommitDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { project, err := parseID(pid) @@ -1151,7 +1176,7 @@ type UpdateCommitDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -func (s *DiscussionsService) UpdateCommitDiscussionNote(pid any, commit string, discussion string, note int, opt *UpdateCommitDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *DiscussionsService) UpdateCommitDiscussionNote(pid any, commit string, discussion string, note int64, opt *UpdateCommitDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1177,7 +1202,7 @@ func (s *DiscussionsService) UpdateCommitDiscussionNote(pid any, commit string, return n, resp, nil } -func (s *DiscussionsService) DeleteCommitDiscussionNote(pid any, commit string, discussion string, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *DiscussionsService) DeleteCommitDiscussionNote(pid any, commit string, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/docker-compose.yml b/vendor/gitlab.com/gitlab-org/api/client-go/docker-compose.yml new file mode 100644 index 000000000..d5fdf197e --- /dev/null +++ b/vendor/gitlab.com/gitlab-org/api/client-go/docker-compose.yml @@ -0,0 +1,61 @@ +# Acceptance tests depend on a running GitLab instance. +# Only one of these services should be run at a time. +services: + gitlab-ee-no-license: + image: docker.io/gitlab/gitlab-ee:${GITLAB_CE_VERSION:-latest} + platform: linux/amd64 + shm_size: 256m + ports: + - 8095:80 + environment: + GITLAB_ROOT_PASSWORD: "FoQ7PaTZqWaftrZ7zvAK" + # The token uses the value of GITLAB_TOKEN, which is set in the makefile (unless overridden) + GITLAB_TOKEN: $GITLAB_TOKEN + labels: + client-go/owned: "" + volumes: + - config-ce:/etc/gitlab + - logs-ce:/var/log/gitlab + - data-ce:/var/opt/gitlab + - ${PWD}/scripts/healthcheck_and_setup.sh:/healthcheck-and-setup.sh:Z + - ${PWD}/scripts/gitlab.rb:/etc/gitlab/gitlab.rb:ro + - ${PWD}/certs:/etc/gitlab/ssl:ro + healthcheck: + test: /healthcheck-and-setup.sh + interval: 60s + timeout: 10m + + gitlab-ee: + image: docker.io/gitlab/gitlab-ee:${GITLAB_EE_VERSION:-latest} + platform: linux/amd64 + shm_size: 256m + ports: + - 8095:80 + environment: + GITLAB_ROOT_PASSWORD: "FoQ7PaTZqWaftrZ7zvAK" + # The token uses the value of GITLAB_TOKEN, which is set in the makefile (unless overridden) + GITLAB_TOKEN: $GITLAB_TOKEN + GITLAB_LICENSE_FILE: /Gitlab-license.txt + labels: + client-go/owned: "" + volumes: + - config-ee:/etc/gitlab + - logs-ee:/var/log/gitlab + - data-ee:/var/opt/gitlab + - ${PWD}/scripts/healthcheck_and_setup.sh:/healthcheck-and-setup.sh:Z + - ${PWD}/Gitlab-license.txt:/Gitlab-license.txt:Z + - ${PWD}/scripts/gitlab.rb:/etc/gitlab/gitlab.rb:ro + - ${PWD}/certs:/etc/gitlab/ssl:ro + healthcheck: + test: /healthcheck-and-setup.sh + interval: 60s + timeout: 10m + +volumes: + config-ce: + logs-ce: + data-ce: + config-ee: + logs-ee: + data-ee: + diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/dockerfile_templates.go b/vendor/gitlab.com/gitlab-org/api/client-go/dockerfile_templates.go index 045b00a56..ba71346fb 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/dockerfile_templates.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/dockerfile_templates.go @@ -69,7 +69,9 @@ type DockerfileTemplateListItem struct { // // GitLab API docs: // https://docs.gitlab.com/api/templates/dockerfiles/#list-dockerfile-templates -type ListDockerfileTemplatesOptions ListOptions +type ListDockerfileTemplatesOptions struct { + ListOptions +} func (s *DockerfileTemplatesService) ListTemplates(opt *ListDockerfileTemplatesOptions, options ...RequestOptionFunc) ([]*DockerfileTemplateListItem, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "templates/dockerfiles", opt, options) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/draft_notes.go b/vendor/gitlab.com/gitlab-org/api/client-go/draft_notes.go index 9ab6c50cb..c4eb8ef3e 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/draft_notes.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/draft_notes.go @@ -28,43 +28,43 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/draft_notes/#list-all-merge-request-draft-notes - ListDraftNotes(pid any, mergeRequest int, opt *ListDraftNotesOptions, options ...RequestOptionFunc) ([]*DraftNote, *Response, error) + ListDraftNotes(pid any, mergeRequest int64, opt *ListDraftNotesOptions, options ...RequestOptionFunc) ([]*DraftNote, *Response, error) // GetDraftNote gets a single draft note for a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/draft_notes/#get-a-single-draft-note - GetDraftNote(pid any, mergeRequest int, note int, options ...RequestOptionFunc) (*DraftNote, *Response, error) + GetDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*DraftNote, *Response, error) // CreateDraftNote creates a draft note for a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/draft_notes/#create-a-draft-note - CreateDraftNote(pid any, mergeRequest int, opt *CreateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) + CreateDraftNote(pid any, mergeRequest int64, opt *CreateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) // UpdateDraftNote updates a draft note for a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/draft_notes/#update-a-draft-note - UpdateDraftNote(pid any, mergeRequest int, note int, opt *UpdateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) + UpdateDraftNote(pid any, mergeRequest int64, note int64, opt *UpdateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) // DeleteDraftNote deletes a single draft note for a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/draft_notes/#delete-a-draft-note - DeleteDraftNote(pid any, mergeRequest int, note int, options ...RequestOptionFunc) (*Response, error) + DeleteDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*Response, error) // PublishDraftNote publishes a single draft note for a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/draft_notes/#publish-a-draft-note - PublishDraftNote(pid any, mergeRequest int, note int, options ...RequestOptionFunc) (*Response, error) + PublishDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*Response, error) // PublishAllDraftNotes publishes all draft notes for a merge request that belong to the user. // // GitLab API docs: // https://docs.gitlab.com/api/draft_notes/#publish-a-draft-note - PublishAllDraftNotes(pid any, mergeRequest int, options ...RequestOptionFunc) (*Response, error) + PublishAllDraftNotes(pid any, mergeRequest int64, options ...RequestOptionFunc) (*Response, error) } // DraftNotesService handles communication with the draft notes related methods @@ -80,9 +80,9 @@ type ( var _ DraftNotesServiceInterface = (*DraftNotesService)(nil) type DraftNote struct { - ID int `json:"id"` - AuthorID int `json:"author_id"` - MergeRequestID int `json:"merge_request_id"` + ID int64 `json:"id"` + AuthorID int64 `json:"author_id"` + MergeRequestID int64 `json:"merge_request_id"` ResolveDiscussion bool `json:"resolve_discussion"` DiscussionID string `json:"discussion_id"` Note string `json:"note"` @@ -102,7 +102,7 @@ type ListDraftNotesOptions struct { Sort *string `url:"sort,omitempty" json:"sort,omitempty"` } -func (s *DraftNotesService) ListDraftNotes(pid any, mergeRequest int, opt *ListDraftNotesOptions, options ...RequestOptionFunc) ([]*DraftNote, *Response, error) { +func (s *DraftNotesService) ListDraftNotes(pid any, mergeRequest int64, opt *ListDraftNotesOptions, options ...RequestOptionFunc) ([]*DraftNote, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -123,7 +123,7 @@ func (s *DraftNotesService) ListDraftNotes(pid any, mergeRequest int, opt *ListD return n, resp, nil } -func (s *DraftNotesService) GetDraftNote(pid any, mergeRequest int, note int, options ...RequestOptionFunc) (*DraftNote, *Response, error) { +func (s *DraftNotesService) GetDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*DraftNote, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -148,6 +148,7 @@ func (s *DraftNotesService) GetDraftNote(pid any, mergeRequest int, note int, op // options. // // GitLab API docs: +// GitLab API docs: // https://docs.gitlab.com/api/draft_notes/#create-a-draft-note type CreateDraftNoteOptions struct { Note *string `url:"note" json:"note"` @@ -157,7 +158,7 @@ type CreateDraftNoteOptions struct { Position *PositionOptions `url:"position,omitempty" json:"position,omitempty"` } -func (s *DraftNotesService) CreateDraftNote(pid any, mergeRequest int, opt *CreateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) { +func (s *DraftNotesService) CreateDraftNote(pid any, mergeRequest int64, opt *CreateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -182,13 +183,14 @@ func (s *DraftNotesService) CreateDraftNote(pid any, mergeRequest int, opt *Crea // options. // // GitLab API docs: +// GitLab API docs: // https://docs.gitlab.com/api/draft_notes/#create-a-draft-note type UpdateDraftNoteOptions struct { Note *string `url:"note,omitempty" json:"note,omitempty"` Position *PositionOptions `url:"position,omitempty" json:"position,omitempty"` } -func (s *DraftNotesService) UpdateDraftNote(pid any, mergeRequest int, note int, opt *UpdateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) { +func (s *DraftNotesService) UpdateDraftNote(pid any, mergeRequest int64, note int64, opt *UpdateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -209,7 +211,7 @@ func (s *DraftNotesService) UpdateDraftNote(pid any, mergeRequest int, note int, return n, resp, nil } -func (s *DraftNotesService) DeleteDraftNote(pid any, mergeRequest int, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *DraftNotesService) DeleteDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -224,7 +226,7 @@ func (s *DraftNotesService) DeleteDraftNote(pid any, mergeRequest int, note int, return s.client.Do(req, nil) } -func (s *DraftNotesService) PublishDraftNote(pid any, mergeRequest int, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *DraftNotesService) PublishDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -239,7 +241,7 @@ func (s *DraftNotesService) PublishDraftNote(pid any, mergeRequest int, note int return s.client.Do(req, nil) } -func (s *DraftNotesService) PublishAllDraftNotes(pid any, mergeRequest int, options ...RequestOptionFunc) (*Response, error) { +func (s *DraftNotesService) PublishAllDraftNotes(pid any, mergeRequest int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/enterprise_users.go b/vendor/gitlab.com/gitlab-org/api/client-go/enterprise_users.go index 03771bc0a..230dbb4f5 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/enterprise_users.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/enterprise_users.go @@ -27,25 +27,9 @@ type ( // GitLab API docs: // https://docs.gitlab.com/api/group_enterprise_users/#list-all-enterprise-users ListEnterpriseUsers(gid any, opt *ListEnterpriseUsersOptions, options ...RequestOptionFunc) ([]*User, *Response, error) - - // GetEnterpriseUser gets details on a specified enterprise user. - // - // GitLab API docs: - // https://docs.gitlab.com/api/group_enterprise_users/#get-details-on-an-enterprise-user - GetEnterpriseUser(gid any, uid int, options ...RequestOptionFunc) (*User, *Response, error) - - // Disable2FAForEnterpriseUser disables two-factor authentication (2FA) for a - // specified enterprise user. - // - // GitLab API docs: - // https://docs.gitlab.com/api/group_enterprise_users/#disable-two-factor-authentication-for-an-enterprise-user - Disable2FAForEnterpriseUser(gid any, uid int, options ...RequestOptionFunc) (*Response, error) - - // DeleteEnterpriseUser deletes an specified enterprise user. - // - // GitLab API docs: - // https://docs.gitlab.com/api/group_enterprise_users/#delete-an-enterprise-user - DeleteEnterpriseUser(gid any, uid int, deleteOptions *DeleteEnterpriseUserOptions, options ...RequestOptionFunc) (*Response, error) + GetEnterpriseUser(gid any, uid int64, options ...RequestOptionFunc) (*User, *Response, error) + Disable2FAForEnterpriseUser(gid any, uid int64, options ...RequestOptionFunc) (*Response, error) + DeleteEnterpriseUser(gid any, uid int64, deleteOptions *DeleteEnterpriseUserOptions, options ...RequestOptionFunc) (*Response, error) } // EnterpriseUsersService handles communication with the enterprise users @@ -96,7 +80,11 @@ func (s *EnterpriseUsersService) ListEnterpriseUsers(gid any, opt *ListEnterpris return users, resp, nil } -func (s *EnterpriseUsersService) GetEnterpriseUser(gid any, uid int, options ...RequestOptionFunc) (*User, *Response, error) { +// GetEnterpriseUser gets details on a specified enterprise user. +// +// GitLab API docs: +// https://docs.gitlab.com/api/group_enterprise_users/#get-details-on-an-enterprise-user +func (s *EnterpriseUsersService) GetEnterpriseUser(gid any, uid int64, options ...RequestOptionFunc) (*User, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -117,7 +105,12 @@ func (s *EnterpriseUsersService) GetEnterpriseUser(gid any, uid int, options ... return user, resp, nil } -func (s *EnterpriseUsersService) Disable2FAForEnterpriseUser(gid any, uid int, options ...RequestOptionFunc) (*Response, error) { +// Disable2FAForEnterpriseUser disables two-factor authentication (2FA) for a +// specified enterprise user. +// +// GitLab API docs: +// https://docs.gitlab.com/api/group_enterprise_users/#disable-two-factor-authentication-for-an-enterprise-user +func (s *EnterpriseUsersService) Disable2FAForEnterpriseUser(gid any, uid int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -140,7 +133,11 @@ type DeleteEnterpriseUserOptions struct { HardDelete *bool `url:"hard_delete,omitempty" json:"hard_delete,omitempty"` } -func (s *EnterpriseUsersService) DeleteEnterpriseUser(gid any, uid int, opt *DeleteEnterpriseUserOptions, options ...RequestOptionFunc) (*Response, error) { +// DeleteEnterpriseUser deletes an specified enterprise user. +// +// GitLab API docs: +// https://docs.gitlab.com/api/group_enterprise_users/#delete-an-enterprise-user +func (s *EnterpriseUsersService) DeleteEnterpriseUser(gid any, uid int64, opt *DeleteEnterpriseUserOptions, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/environments.go b/vendor/gitlab.com/gitlab-org/api/client-go/environments.go index 3b776f109..6cf8512b0 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/environments.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/environments.go @@ -30,38 +30,11 @@ type ( // GitLab API docs: // https://docs.gitlab.com/api/environments/#list-environments ListEnvironments(pid any, opts *ListEnvironmentsOptions, options ...RequestOptionFunc) ([]*Environment, *Response, error) - - // GetEnvironment gets a specific environment from a project. - // - // GitLab API docs: - // https://docs.gitlab.com/api/environments/#get-a-specific-environment - GetEnvironment(pid any, environment int, options ...RequestOptionFunc) (*Environment, *Response, error) - - // CreateEnvironment adds an environment to a project. This method is idempotent - // and can be called multiple times with the same parameters. Creating an environment - // that already exists does not affect the existing association. - // - // GitLab API docs: - // https://docs.gitlab.com/api/environments/#create-a-new-environment + GetEnvironment(pid any, environment int64, options ...RequestOptionFunc) (*Environment, *Response, error) CreateEnvironment(pid any, opt *CreateEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) - - // EditEnvironment updates a project team environment to a specified access level. - // - // GitLab API docs: - // https://docs.gitlab.com/api/environments/#update-an-existing-environment - EditEnvironment(pid any, environment int, opt *EditEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) - - // DeleteEnvironment removes an environment from a project team. - // - // GitLab API docs: - // https://docs.gitlab.com/api/environments/#delete-an-environment - DeleteEnvironment(pid any, environment int, options ...RequestOptionFunc) (*Response, error) - - // StopEnvironment stops an environment within a specific project. - // - // GitLab API docs: - // https://docs.gitlab.com/api/environments/#stop-an-environment - StopEnvironment(pid any, environmentID int, opt *StopEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) + EditEnvironment(pid any, environment int64, opt *EditEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) + DeleteEnvironment(pid any, environment int64, options ...RequestOptionFunc) (*Response, error) + StopEnvironment(pid any, environmentID int64, opt *StopEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) } // EnvironmentsService handles communication with the environment related methods @@ -79,7 +52,7 @@ var _ EnvironmentsServiceInterface = (*EnvironmentsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/environments/ type Environment struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Slug string `json:"slug"` Description string `json:"description"` @@ -120,7 +93,7 @@ func (s *EnvironmentsService) ListEnvironments(pid any, opts *ListEnvironmentsOp ) } -func (s *EnvironmentsService) GetEnvironment(pid any, environment int, options ...RequestOptionFunc) (*Environment, *Response, error) { +func (s *EnvironmentsService) GetEnvironment(pid any, environment int64, options ...RequestOptionFunc) (*Environment, *Response, error) { return do[*Environment](s.client, withPath("projects/%s/environments/%d", ProjectID{pid}, environment), withRequestOpts(options...), @@ -136,7 +109,7 @@ type CreateEnvironmentOptions struct { Description *string `url:"description,omitempty" json:"description,omitempty"` ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"` Tier *string `url:"tier,omitempty" json:"tier,omitempty"` - ClusterAgentID *int `url:"cluster_agent_id,omitempty" json:"cluster_agent_id,omitempty"` + ClusterAgentID *int64 `url:"cluster_agent_id,omitempty" json:"cluster_agent_id,omitempty"` KubernetesNamespace *string `url:"kubernetes_namespace,omitempty" json:"kubernetes_namespace,omitempty"` FluxResourcePath *string `url:"flux_resource_path,omitempty" json:"flux_resource_path,omitempty"` AutoStopSetting *string `url:"auto_stop_setting,omitempty" json:"auto_stop_setting,omitempty"` @@ -160,13 +133,13 @@ type EditEnvironmentOptions struct { Description *string `url:"description,omitempty" json:"description,omitempty"` ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"` Tier *string `url:"tier,omitempty" json:"tier,omitempty"` - ClusterAgentID *int `url:"cluster_agent_id,omitempty" json:"cluster_agent_id,omitempty"` + ClusterAgentID *int64 `url:"cluster_agent_id,omitempty" json:"cluster_agent_id,omitempty"` KubernetesNamespace *string `url:"kubernetes_namespace,omitempty" json:"kubernetes_namespace,omitempty"` FluxResourcePath *string `url:"flux_resource_path,omitempty" json:"flux_resource_path,omitempty"` AutoStopSetting *string `url:"auto_stop_setting,omitempty" json:"auto_stop_setting,omitempty"` } -func (s *EnvironmentsService) EditEnvironment(pid any, environment int, opt *EditEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) { +func (s *EnvironmentsService) EditEnvironment(pid any, environment int64, opt *EditEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) { return do[*Environment](s.client, withMethod(http.MethodPut), withPath("projects/%s/environments/%d", ProjectID{pid}, environment), @@ -175,7 +148,7 @@ func (s *EnvironmentsService) EditEnvironment(pid any, environment int, opt *Edi ) } -func (s *EnvironmentsService) DeleteEnvironment(pid any, environment int, options ...RequestOptionFunc) (*Response, error) { +func (s *EnvironmentsService) DeleteEnvironment(pid any, environment int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/environments/%d", ProjectID{pid}, environment), @@ -192,7 +165,7 @@ type StopEnvironmentOptions struct { Force *bool `url:"force,omitempty" json:"force,omitempty"` } -func (s *EnvironmentsService) StopEnvironment(pid any, environmentID int, opt *StopEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) { +func (s *EnvironmentsService) StopEnvironment(pid any, environmentID int64, opt *StopEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) { return do[*Environment](s.client, withMethod(http.MethodPost), withPath("projects/%s/environments/%d/stop", ProjectID{pid}, environmentID), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/epic_issues.go b/vendor/gitlab.com/gitlab-org/api/client-go/epic_issues.go index 7325a71c6..f27bfb859 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/epic_issues.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/epic_issues.go @@ -26,33 +26,13 @@ type ( // Will be removed in v5 of the API, use Work Items API instead EpicIssuesServiceInterface interface { // Will be removed in v5 of the API, use Work Items API instead - // ListEpicIssues get a list of epic issues. - // - // GitLab API docs: - // https://docs.gitlab.com/api/epic_issues/#list-issues-for-an-epic - ListEpicIssues(gid any, epic int, opt *ListOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) - - // AssignEpicIssue assigns an existing issue to an epic. + ListEpicIssues(gid any, epic int64, opt *ListOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) // Will be removed in v5 of the API, use Work Items API instead - // - // GitLab API Docs: - // https://docs.gitlab.com/api/epic_issues/#assign-an-issue-to-the-epic - AssignEpicIssue(gid any, epic, issue int, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) - - // RemoveEpicIssue removes an issue from an epic. + AssignEpicIssue(gid any, epic, issue int64, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) // Will be removed in v5 of the API, use Work Items API instead - // - // GitLab API Docs: - // https://docs.gitlab.com/api/epic_issues/#remove-an-issue-from-the-epic - RemoveEpicIssue(gid any, epic, epicIssue int, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) - - // UpdateEpicIssueAssignmentOptions describes the UpdateEpicIssueAssignment() - // options. + RemoveEpicIssue(gid any, epic, epicIssue int64, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) // Will be removed in v5 of the API, use Work Items API instead - // - // GitLab API Docs: - // https://docs.gitlab.com/api/epic_issues/#update-epic---issue-association - UpdateEpicIssueAssignment(gid any, epic, epicIssue int, opt *UpdateEpicIssueAssignmentOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) + UpdateEpicIssueAssignment(gid any, epic, epicIssue int64, opt *UpdateEpicIssueAssignmentOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) } // EpicIssuesService handles communication with the epic issue related methods @@ -74,12 +54,17 @@ var _ EpicIssuesServiceInterface = (*EpicIssuesService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/epic_issues/ type EpicIssueAssignment struct { - ID int `json:"id"` + ID int64 `json:"id"` Epic *Epic `json:"epic"` Issue *Issue `json:"issue"` } -func (s *EpicIssuesService) ListEpicIssues(gid any, epic int, opt *ListOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { +// ListEpicIssues get a list of epic issues. +// Will be removed in v5 of the API, use Work Items API instead +// +// Gitlab API docs: +// https://docs.gitlab.com/api/epic_issues/#list-issues-for-an-epic +func (s *EpicIssuesService) ListEpicIssues(gid any, epic int64, opt *ListOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -100,7 +85,12 @@ func (s *EpicIssuesService) ListEpicIssues(gid any, epic int, opt *ListOptions, return is, resp, nil } -func (s *EpicIssuesService) AssignEpicIssue(gid any, epic, issue int, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) { +// AssignEpicIssue assigns an existing issue to an epic. +// Will be removed in v5 of the API, use Work Items API instead +// +// Gitlab API Docs: +// https://docs.gitlab.com/api/epic_issues/#assign-an-issue-to-the-epic +func (s *EpicIssuesService) AssignEpicIssue(gid any, epic, issue int64, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -121,7 +111,12 @@ func (s *EpicIssuesService) AssignEpicIssue(gid any, epic, issue int, options .. return a, resp, nil } -func (s *EpicIssuesService) RemoveEpicIssue(gid any, epic, epicIssue int, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) { +// RemoveEpicIssue removes an issue from an epic. +// Will be removed in v5 of the API, use Work Items API instead +// +// Gitlab API Docs: +// https://docs.gitlab.com/api/epic_issues/#remove-an-issue-from-the-epic +func (s *EpicIssuesService) RemoveEpicIssue(gid any, epic, epicIssue int64, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -144,21 +139,17 @@ func (s *EpicIssuesService) RemoveEpicIssue(gid any, epic, epicIssue int, option type UpdateEpicIssueAssignmentOptions struct { *ListOptions - MoveBeforeID *int `url:"move_before_id,omitempty" json:"move_before_id,omitempty"` - MoveAfterID *int `url:"move_after_id,omitempty" json:"move_after_id,omitempty"` + MoveBeforeID *int64 `url:"move_before_id,omitempty" json:"move_before_id,omitempty"` + MoveAfterID *int64 `url:"move_after_id,omitempty" json:"move_after_id,omitempty"` } -// UpdateEpicIsssueAssignmentOptions is kept for backwards compatibility. -// Deprecated: use UpdateEpicIssueAssignmentOptions instead. -type UpdateEpicIsssueAssignmentOptions = UpdateEpicIssueAssignmentOptions - // UpdateEpicIssueAssignment moves an issue before or after another issue in an // epic issue list. // Will be removed in v5 of the API, use Work Items API instead // // Gitlab API Docs: // https://docs.gitlab.com/api/epic_issues/#update-epic---issue-association -func (s *EpicIssuesService) UpdateEpicIssueAssignment(gid any, epic, epicIssue int, opt *UpdateEpicIssueAssignmentOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { +func (s *EpicIssuesService) UpdateEpicIssueAssignment(gid any, epic, epicIssue int64, opt *UpdateEpicIssueAssignmentOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/epics.go b/vendor/gitlab.com/gitlab-org/api/client-go/epics.go index ca194b587..eb4ded332 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/epics.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/epics.go @@ -35,17 +35,9 @@ type ( // GetEpic gets a single group epic. // Will be removed in v5 of the API, use Work Items API instead - // - // GitLab API docs: https://docs.gitlab.com/api/epics/#single-epic - GetEpic(gid any, epic int, options ...RequestOptionFunc) (*Epic, *Response, error) - - // GetEpicLinks gets all child epics of an epic. + GetEpic(gid any, epic int64, options ...RequestOptionFunc) (*Epic, *Response, error) // Will be removed in v5 of the API, use Work Items API instead - // - // GitLab API docs: https://docs.gitlab.com/api/epic_links/ - GetEpicLinks(gid any, epic int, options ...RequestOptionFunc) ([]*Epic, *Response, error) - - // CreateEpic creates a new group epic. + GetEpicLinks(gid any, epic int64, options ...RequestOptionFunc) ([]*Epic, *Response, error) // Will be removed in v5 of the API, use Work Items API instead // // GitLab API docs: https://docs.gitlab.com/api/epics/#new-epic @@ -54,15 +46,9 @@ type ( // UpdateEpic updates an existing group epic. This function is also used // to mark an epic as closed. // Will be removed in v5 of the API, use Work Items API instead - // - // GitLab API docs: https://docs.gitlab.com/api/epics/#update-epic - UpdateEpic(gid any, epic int, opt *UpdateEpicOptions, options ...RequestOptionFunc) (*Epic, *Response, error) - - // DeleteEpic deletes a single group epic. + UpdateEpic(gid any, epic int64, opt *UpdateEpicOptions, options ...RequestOptionFunc) (*Epic, *Response, error) // Will be removed in v5 of the API, use Work Items API instead - // - // GitLab API docs: https://docs.gitlab.com/api/epics/#delete-epic - DeleteEpic(gid any, epic int, options ...RequestOptionFunc) (*Response, error) + DeleteEpic(gid any, epic int64, options ...RequestOptionFunc) (*Response, error) } // EpicsService handles communication with the epic related methods @@ -81,7 +67,7 @@ var _ EpicsServiceInterface = (*EpicsService)(nil) // EpicAuthor represents a author of the epic. // Will be removed in v5 of the API, use Work Items API instead type EpicAuthor struct { - ID int `json:"id"` + ID int64 `json:"id"` State string `json:"state"` WebURL string `json:"web_url"` Name string `json:"name"` @@ -94,10 +80,10 @@ type EpicAuthor struct { // // GitLab API docs: https://docs.gitlab.com/api/epics/ type Epic struct { - ID int `json:"id"` - IID int `json:"iid"` - GroupID int `json:"group_id"` - ParentID int `json:"parent_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + GroupID int64 `json:"group_id"` + ParentID int64 `json:"parent_id"` Title string `json:"title"` Description string `json:"description"` State string `json:"state"` @@ -116,9 +102,9 @@ type Epic struct { UpdatedAt *time.Time `json:"updated_at"` ClosedAt *time.Time `json:"closed_at"` Labels []string `json:"labels"` - Upvotes int `json:"upvotes"` - Downvotes int `json:"downvotes"` - UserNotesCount int `json:"user_notes_count"` + Upvotes int64 `json:"upvotes"` + Downvotes int64 `json:"downvotes"` + UserNotesCount int64 `json:"user_notes_count"` URL string `json:"url"` } @@ -135,7 +121,7 @@ func (e Epic) String() string { // GitLab API docs: https://docs.gitlab.com/api/epics/#list-epics-for-a-group type ListGroupEpicsOptions struct { ListOptions - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` Labels *LabelOptions `url:"labels,comma,omitempty" json:"labels,omitempty"` WithLabelDetails *bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"` OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"` @@ -172,7 +158,11 @@ func (s *EpicsService) ListGroupEpics(gid any, opt *ListGroupEpicsOptions, optio return es, resp, nil } -func (s *EpicsService) GetEpic(gid any, epic int, options ...RequestOptionFunc) (*Epic, *Response, error) { +// GetEpic gets a single group epic. +// Will be removed in v5 of the API, use Work Items API instead +// +// GitLab API docs: https://docs.gitlab.com/api/epics/#single-epic +func (s *EpicsService) GetEpic(gid any, epic int64, options ...RequestOptionFunc) (*Epic, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -193,7 +183,11 @@ func (s *EpicsService) GetEpic(gid any, epic int, options ...RequestOptionFunc) return e, resp, nil } -func (s *EpicsService) GetEpicLinks(gid any, epic int, options ...RequestOptionFunc) ([]*Epic, *Response, error) { +// GetEpicLinks gets all child epics of an epic. +// Will be removed in v5 of the API, use Work Items API instead +// +// GitLab API docs: https://docs.gitlab.com/api/epic_links/ +func (s *EpicsService) GetEpicLinks(gid any, epic int64, options ...RequestOptionFunc) ([]*Epic, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -229,7 +223,7 @@ type CreateEpicOptions struct { StartDateFixed *ISOTime `url:"start_date_fixed,omitempty" json:"start_date_fixed,omitempty"` DueDateIsFixed *bool `url:"due_date_is_fixed,omitempty" json:"due_date_is_fixed,omitempty"` DueDateFixed *ISOTime `url:"due_date_fixed,omitempty" json:"due_date_fixed,omitempty"` - ParentID *int `url:"parent_id,omitempty" json:"parent_id,omitempty"` + ParentID *int64 `url:"parent_id,omitempty" json:"parent_id,omitempty"` } func (s *EpicsService) CreateEpic(gid any, opt *CreateEpicOptions, options ...RequestOptionFunc) (*Epic, *Response, error) { @@ -264,7 +258,7 @@ type UpdateEpicOptions struct { DueDateFixed *ISOTime `url:"due_date_fixed,omitempty" json:"due_date_fixed,omitempty"` DueDateIsFixed *bool `url:"due_date_is_fixed,omitempty" json:"due_date_is_fixed,omitempty"` Labels *LabelOptions `url:"labels,comma,omitempty" json:"labels,omitempty"` - ParentID *int `url:"parent_id,omitempty" json:"parent_id,omitempty"` + ParentID *int64 `url:"parent_id,omitempty" json:"parent_id,omitempty"` RemoveLabels *LabelOptions `url:"remove_labels,omitempty" json:"remove_labels,omitempty"` StartDateFixed *ISOTime `url:"start_date_fixed,omitempty" json:"start_date_fixed,omitempty"` StartDateIsFixed *bool `url:"start_date_is_fixed,omitempty" json:"start_date_is_fixed,omitempty"` @@ -274,7 +268,12 @@ type UpdateEpicOptions struct { Color *string `url:"color,omitempty" json:"color,omitempty"` } -func (s *EpicsService) UpdateEpic(gid any, epic int, opt *UpdateEpicOptions, options ...RequestOptionFunc) (*Epic, *Response, error) { +// UpdateEpic updates an existing group epic. This function is also used +// to mark an epic as closed. +// Will be removed in v5 of the API, use Work Items API instead +// +// GitLab API docs: https://docs.gitlab.com/api/epics/#update-epic +func (s *EpicsService) UpdateEpic(gid any, epic int64, opt *UpdateEpicOptions, options ...RequestOptionFunc) (*Epic, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -295,7 +294,11 @@ func (s *EpicsService) UpdateEpic(gid any, epic int, opt *UpdateEpicOptions, opt return e, resp, nil } -func (s *EpicsService) DeleteEpic(gid any, epic int, options ...RequestOptionFunc) (*Response, error) { +// DeleteEpic deletes a single group epic. +// Will be removed in v5 of the API, use Work Items API instead +// +// GitLab API docs: https://docs.gitlab.com/api/epics/#delete-epic +func (s *EpicsService) DeleteEpic(gid any, epic int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/error_tracking.go b/vendor/gitlab.com/gitlab-org/api/client-go/error_tracking.go index a53adc37c..5512b2edc 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/error_tracking.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/error_tracking.go @@ -53,7 +53,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/error_tracking/#delete-a-client-key - DeleteClientKey(pid any, keyID int, options ...RequestOptionFunc) (*Response, error) + DeleteClientKey(pid any, keyID int64, options ...RequestOptionFunc) (*Response, error) } // ErrorTrackingService handles communication with the error tracking @@ -72,7 +72,7 @@ var _ ErrorTrackingServiceInterface = (*ErrorTrackingService)(nil) // GitLab docs: // https://docs.gitlab.com/api/error_tracking/#error-tracking-client-keys type ErrorTrackingClientKey struct { - ID int `json:"id"` + ID int64 `json:"id"` Active bool `json:"active"` PublicKey string `json:"public_key"` SentryDsn string `json:"sentry_dsn"` @@ -153,7 +153,9 @@ func (s *ErrorTrackingService) EnableDisableErrorTracking(pid any, opt *EnableDi // // GitLab API docs: // https://docs.gitlab.com/api/error_tracking/#list-project-client-keys -type ListClientKeysOptions ListOptions +type ListClientKeysOptions struct { + ListOptions +} func (s *ErrorTrackingService) ListClientKeys(pid any, opt *ListClientKeysOptions, options ...RequestOptionFunc) ([]*ErrorTrackingClientKey, *Response, error) { project, err := parseID(pid) @@ -197,7 +199,11 @@ func (s *ErrorTrackingService) CreateClientKey(pid any, options ...RequestOption return ck, resp, nil } -func (s *ErrorTrackingService) DeleteClientKey(pid any, keyID int, options ...RequestOptionFunc) (*Response, error) { +// DeleteClientKey removes a client key from the project. +// +// GitLab API docs: +// https://docs.gitlab.com/api/error_tracking/#delete-a-client-key +func (s *ErrorTrackingService) DeleteClientKey(pid any, keyID int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/event_parsing.go b/vendor/gitlab.com/gitlab-org/api/client-go/event_parsing.go index 577972e9a..803608bcf 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/event_parsing.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/event_parsing.go @@ -62,10 +62,12 @@ const ( ) type noteEvent struct { - ObjectKind string `json:"object_kind"` - ObjectAttributes struct { - NoteableType string `json:"noteable_type"` - } `json:"object_attributes"` + ObjectKind string `json:"object_kind"` + ObjectAttributes noteEventObjectAttributes `json:"object_attributes"` +} + +type noteEventObjectAttributes struct { + NoteableType string `json:"noteable_type"` } type serviceEvent struct { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/event_systemhook_types.go b/vendor/gitlab.com/gitlab-org/api/client-go/event_systemhook_types.go index 50940e832..fdbc13514 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/event_systemhook_types.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/event_systemhook_types.go @@ -44,7 +44,7 @@ type ProjectSystemEvent struct { Name string `json:"name"` Path string `json:"path"` PathWithNamespace string `json:"path_with_namespace"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` OwnerName string `json:"owner_name"` OwnerEmail string `json:"owner_email"` ProjectVisibility string `json:"project_visibility"` @@ -60,7 +60,7 @@ type GroupSystemEvent struct { Name string `json:"name"` Path string `json:"path"` PathWithNamespace string `json:"full_path"` - GroupID int `json:"group_id"` + GroupID int64 `json:"group_id"` OwnerName string `json:"owner_name"` OwnerEmail string `json:"owner_email"` ProjectVisibility string `json:"project_visibility"` @@ -74,7 +74,7 @@ type GroupSystemEvent struct { // https://docs.gitlab.com/administration/system_hooks/ type KeySystemEvent struct { BaseSystemEvent - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Key string `json:"key"` } @@ -85,7 +85,7 @@ type KeySystemEvent struct { // https://docs.gitlab.com/administration/system_hooks/ type UserSystemEvent struct { BaseSystemEvent - ID int `json:"user_id"` + ID int64 `json:"user_id"` Name string `json:"name"` Username string `json:"username"` OldUsername string `json:"old_username,omitempty"` @@ -99,11 +99,11 @@ type UserSystemEvent struct { // https://docs.gitlab.com/administration/system_hooks/ type UserGroupSystemEvent struct { BaseSystemEvent - ID int `json:"user_id"` + ID int64 `json:"user_id"` Name string `json:"user_name"` Username string `json:"user_username"` Email string `json:"user_email"` - GroupID int `json:"group_id"` + GroupID int64 `json:"group_id"` GroupName string `json:"group_name"` GroupPath string `json:"group_path"` GroupAccess string `json:"group_access"` @@ -115,11 +115,11 @@ type UserGroupSystemEvent struct { // https://docs.gitlab.com/administration/system_hooks/ type UserTeamSystemEvent struct { BaseSystemEvent - ID int `json:"user_id"` + ID int64 `json:"user_id"` Name string `json:"user_name"` Username string `json:"user_username"` Email string `json:"user_email"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` ProjectName string `json:"project_name"` ProjectPath string `json:"project_path"` ProjectPathWithNamespace string `json:"project_path_with_namespace"` @@ -133,41 +133,59 @@ type UserTeamSystemEvent struct { // https://docs.gitlab.com/administration/system_hooks/#push-events type PushSystemEvent struct { BaseSystemEvent - Before string `json:"before"` - After string `json:"after"` - Ref string `json:"ref"` - CheckoutSHA string `json:"checkout_sha"` - UserID int `json:"user_id"` - UserName string `json:"user_name"` - UserUsername string `json:"user_username"` - UserEmail string `json:"user_email"` - UserAvatar string `json:"user_avatar"` - ProjectID int `json:"project_id"` - Project struct { - Name string `json:"name"` - Description string `json:"description"` - WebURL string `json:"web_url"` - AvatarURL string `json:"avatar_url"` - GitHTTPURL string `json:"git_http_url"` - GitSSHURL string `json:"git_ssh_url"` - Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - } `json:"project"` - Commits []struct { - ID string `json:"id"` - Message string `json:"message"` - Timestamp time.Time `json:"timestamp"` - URL string `json:"url"` - Author struct { - Name string `json:"name"` - Email string `json:"email"` - } `json:"author"` - } `json:"commits"` - TotalCommitsCount int `json:"total_commits_count"` + Before string `json:"before"` + After string `json:"after"` + Ref string `json:"ref"` + CheckoutSHA string `json:"checkout_sha"` + UserID int64 `json:"user_id"` + UserName string `json:"user_name"` + UserUsername string `json:"user_username"` + UserEmail string `json:"user_email"` + UserAvatar string `json:"user_avatar"` + ProjectID int64 `json:"project_id"` + Project PushSystemEventProject `json:"project"` + Commits []PushSystemEventCommit `json:"commits"` + TotalCommitsCount int64 `json:"total_commits_count"` +} + +// PushSystemEventProject represents a push system event's project. +// +// GitLab API docs: +// https://docs.gitlab.com/administration/system_hooks/#push-events +type PushSystemEventProject struct { + Name string `json:"name"` + Description string `json:"description"` + WebURL string `json:"web_url"` + AvatarURL string `json:"avatar_url"` + GitHTTPURL string `json:"git_http_url"` + GitSSHURL string `json:"git_ssh_url"` + Namespace string `json:"namespace"` + VisibilityLevel int64 `json:"visibility_level"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` +} + +// PushSystemEventCommit represents a push system event's commit. +// +// GitLab API docs: +// https://docs.gitlab.com/administration/system_hooks/#push-events +type PushSystemEventCommit struct { + ID string `json:"id"` + Message string `json:"message"` + Timestamp time.Time `json:"timestamp"` + URL string `json:"url"` + Author PushSystemEventCommitAuthor `json:"author"` +} + +// PushSystemEventCommitAuthor represents a push system event's commit author. +// +// GitLab API docs: +// https://docs.gitlab.com/administration/system_hooks/#push-events +type PushSystemEventCommitAuthor struct { + Name string `json:"name"` + Email string `json:"email"` } // TagPushSystemEvent represents a tag push system event. @@ -176,41 +194,59 @@ type PushSystemEvent struct { // https://docs.gitlab.com/administration/system_hooks/#tag-events type TagPushSystemEvent struct { BaseSystemEvent - Before string `json:"before"` - After string `json:"after"` - Ref string `json:"ref"` - CheckoutSHA string `json:"checkout_sha"` - UserID int `json:"user_id"` - UserName string `json:"user_name"` - UserUsername string `json:"user_username"` - UserEmail string `json:"user_email"` - UserAvatar string `json:"user_avatar"` - ProjectID int `json:"project_id"` - Project struct { - Name string `json:"name"` - Description string `json:"description"` - WebURL string `json:"web_url"` - AvatarURL string `json:"avatar_url"` - GitHTTPURL string `json:"git_http_url"` - GitSSHURL string `json:"git_ssh_url"` - Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - } `json:"project"` - Commits []struct { - ID string `json:"id"` - Message string `json:"message"` - Timestamp time.Time `json:"timestamp"` - URL string `json:"url"` - Author struct { - Name string `json:"name"` - Email string `json:"email"` - } `json:"author"` - } `json:"commits"` - TotalCommitsCount int `json:"total_commits_count"` + Before string `json:"before"` + After string `json:"after"` + Ref string `json:"ref"` + CheckoutSHA string `json:"checkout_sha"` + UserID int64 `json:"user_id"` + UserName string `json:"user_name"` + UserUsername string `json:"user_username"` + UserEmail string `json:"user_email"` + UserAvatar string `json:"user_avatar"` + ProjectID int64 `json:"project_id"` + Project TagPushSystemEventProject `json:"project"` + Commits []TagPushSystemEventCommit `json:"commits"` + TotalCommitsCount int64 `json:"total_commits_count"` +} + +// TagPushSystemEventProject represents a tag push system event's project. +// +// GitLab API docs: +// https://docs.gitlab.com/administration/system_hooks/#tag-events +type TagPushSystemEventProject struct { + Name string `json:"name"` + Description string `json:"description"` + WebURL string `json:"web_url"` + AvatarURL string `json:"avatar_url"` + GitHTTPURL string `json:"git_http_url"` + GitSSHURL string `json:"git_ssh_url"` + Namespace string `json:"namespace"` + VisibilityLevel int64 `json:"visibility_level"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` +} + +// TagPushSystemEventCommit represents a tag push system event's commit. +// +// GitLab API docs: +// https://docs.gitlab.com/administration/system_hooks/#tag-events +type TagPushSystemEventCommit struct { + ID string `json:"id"` + Message string `json:"message"` + Timestamp time.Time `json:"timestamp"` + URL string `json:"url"` + Author TagPushSystemEventCommitAuthor `json:"author"` +} + +// TagPushSystemEventCommitAuthor represents a tag push system event's commit author. +// +// GitLab API docs: +// https://docs.gitlab.com/administration/system_hooks/#tag-events +type TagPushSystemEventCommitAuthor struct { + Name string `json:"name"` + Email string `json:"email"` } // RepositoryUpdateSystemEvent represents a repository updated system event. @@ -219,31 +255,43 @@ type TagPushSystemEvent struct { // https://docs.gitlab.com/administration/system_hooks/#repository-update-events type RepositoryUpdateSystemEvent struct { BaseSystemEvent - UserID int `json:"user_id"` - UserName string `json:"user_name"` - UserEmail string `json:"user_email"` - UserAvatar string `json:"user_avatar"` - ProjectID int `json:"project_id"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - WebURL string `json:"web_url"` - AvatarURL string `json:"avatar_url"` - GitHTTPURL string `json:"git_http_url"` - GitSSHURL string `json:"git_ssh_url"` - Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - CiConfigPath string `json:"ci_config_path"` - Homepage string `json:"homepage"` - URL string `json:"url"` - } `json:"project"` - Changes []struct { - Before string `json:"before"` - After string `json:"after"` - Ref string `json:"ref"` - } `json:"changes"` - Refs []string `json:"refs"` + UserID int64 `json:"user_id"` + UserName string `json:"user_name"` + UserEmail string `json:"user_email"` + UserAvatar string `json:"user_avatar"` + ProjectID int64 `json:"project_id"` + Project RepositoryUpdateSystemEventProject `json:"project"` + Changes []RepositoryUpdateSystemEventChange `json:"changes"` + Refs []string `json:"refs"` +} + +// RepositoryUpdateSystemEventProject represents a repository updated system event's project. +// +// GitLab API docs: +// https://docs.gitlab.com/administration/system_hooks/#repository-update-events +type RepositoryUpdateSystemEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + WebURL string `json:"web_url"` + AvatarURL string `json:"avatar_url"` + GitHTTPURL string `json:"git_http_url"` + GitSSHURL string `json:"git_ssh_url"` + Namespace string `json:"namespace"` + VisibilityLevel int64 `json:"visibility_level"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + CiConfigPath string `json:"ci_config_path"` + Homepage string `json:"homepage"` + URL string `json:"url"` +} + +// RepositoryUpdateSystemEventChange represents a repository updated system event's change. +// +// GitLab API docs: +// https://docs.gitlab.com/administration/system_hooks/#repository-update-events +type RepositoryUpdateSystemEventChange struct { + Before string `json:"before"` + After string `json:"after"` + Ref string `json:"ref"` } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/event_webhook_types.go b/vendor/gitlab.com/gitlab-org/api/client-go/event_webhook_types.go index 57983cf73..0d4af58bf 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/event_webhook_types.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/event_webhook_types.go @@ -28,7 +28,7 @@ import ( // There are no GitLab API docs on the subject, but the mappings can be found in // GitLab's codebase: // https://gitlab.com/gitlab-org/gitlab-foss/-/blob/ba5be4989e/app/models/concerns/issuable.rb#L39-42 -type StateID int +type StateID int64 const ( StateIDNone StateID = 0 @@ -43,35 +43,37 @@ const ( // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#job-events type BuildEvent struct { - ObjectKind string `json:"object_kind"` - Ref string `json:"ref"` - Tag bool `json:"tag"` - BeforeSHA string `json:"before_sha"` - SHA string `json:"sha"` - BuildID int `json:"build_id"` - BuildName string `json:"build_name"` - BuildStage string `json:"build_stage"` - BuildStatus string `json:"build_status"` - BuildCreatedAt string `json:"build_created_at"` - BuildStartedAt string `json:"build_started_at"` - BuildFinishedAt string `json:"build_finished_at"` - BuildDuration float64 `json:"build_duration"` - BuildAllowFailure bool `json:"build_allow_failure"` - ProjectID int `json:"project_id"` - ProjectName string `json:"project_name"` - User *EventUser `json:"user"` - Commit struct { - ID int `json:"id"` - SHA string `json:"sha"` - Message string `json:"message"` - AuthorName string `json:"author_name"` - AuthorEmail string `json:"author_email"` - Status string `json:"status"` - Duration int `json:"duration"` - StartedAt string `json:"started_at"` - FinishedAt string `json:"finished_at"` - } `json:"commit"` - Repository *Repository `json:"repository"` + ObjectKind string `json:"object_kind"` + Ref string `json:"ref"` + Tag bool `json:"tag"` + BeforeSHA string `json:"before_sha"` + SHA string `json:"sha"` + BuildID int64 `json:"build_id"` + BuildName string `json:"build_name"` + BuildStage string `json:"build_stage"` + BuildStatus string `json:"build_status"` + BuildCreatedAt string `json:"build_created_at"` + BuildStartedAt string `json:"build_started_at"` + BuildFinishedAt string `json:"build_finished_at"` + BuildDuration float64 `json:"build_duration"` + BuildAllowFailure bool `json:"build_allow_failure"` + ProjectID int64 `json:"project_id"` + ProjectName string `json:"project_name"` + User *EventUser `json:"user"` + Commit BuildEventCommit `json:"commit"` + Repository *Repository `json:"repository"` +} + +type BuildEventCommit struct { + ID int64 `json:"id"` + SHA string `json:"sha"` + Message string `json:"message"` + AuthorName string `json:"author_name"` + AuthorEmail string `json:"author_email"` + Status string `json:"status"` + Duration int64 `json:"duration"` + StartedAt string `json:"started_at"` + FinishedAt string `json:"finished_at"` } // CommitCommentEvent represents a comment on a commit event. @@ -79,57 +81,65 @@ type BuildEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#comment-on-a-commit type CommitCommentEvent struct { - ObjectKind string `json:"object_kind"` - EventType string `json:"event_type"` - User *User `json:"user"` - ProjectID int `json:"project_id"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - WebURL string `json:"web_url"` - Visibility VisibilityValue `json:"visibility"` - } `json:"project"` - Repository *Repository `json:"repository"` - ObjectAttributes struct { - ID int `json:"id"` - Note string `json:"note"` - NoteableType string `json:"noteable_type"` - AuthorID int `json:"author_id"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` - ProjectID int `json:"project_id"` - Attachment string `json:"attachment"` - LineCode string `json:"line_code"` - CommitID string `json:"commit_id"` - NoteableID int `json:"noteable_id"` - System bool `json:"system"` - StDiff *Diff `json:"st_diff"` - Description string `json:"description"` - Action CommentEventAction `json:"action"` - URL string `json:"url"` - } `json:"object_attributes"` - Commit *struct { - ID string `json:"id"` - Title string `json:"title"` - Message string `json:"message"` - Timestamp *time.Time `json:"timestamp"` - URL string `json:"url"` - Author struct { - Name string `json:"name"` - Email string `json:"email"` - } `json:"author"` - } `json:"commit"` + ObjectKind string `json:"object_kind"` + EventType string `json:"event_type"` + User *User `json:"user"` + ProjectID int64 `json:"project_id"` + Project CommitCommentEventProject `json:"project"` + Repository *Repository `json:"repository"` + ObjectAttributes CommitCommentEventObjectAttributes `json:"object_attributes"` + Commit *CommitCommentEventCommit `json:"commit"` +} + +type CommitCommentEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + Visibility VisibilityValue `json:"visibility"` +} + +type CommitCommentEventObjectAttributes struct { + ID int64 `json:"id"` + Note string `json:"note"` + NoteableType string `json:"noteable_type"` + AuthorID int64 `json:"author_id"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + ProjectID int64 `json:"project_id"` + Attachment string `json:"attachment"` + LineCode string `json:"line_code"` + CommitID string `json:"commit_id"` + NoteableID int64 `json:"noteable_id"` + System bool `json:"system"` + StDiff *Diff `json:"st_diff"` + Description string `json:"description"` + Action CommentEventAction `json:"action"` + URL string `json:"url"` +} + +type CommitCommentEventCommit struct { + ID string `json:"id"` + Title string `json:"title"` + Message string `json:"message"` + Timestamp *time.Time `json:"timestamp"` + URL string `json:"url"` + Author EventCommitAuthor `json:"author"` +} + +type EventCommitAuthor struct { + Name string `json:"name"` + Email string `json:"email"` } // DeploymentEvent represents a deployment event. @@ -137,39 +147,41 @@ type CommitCommentEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#deployment-events type DeploymentEvent struct { - ObjectKind string `json:"object_kind"` - Status string `json:"status"` - StatusChangedAt string `json:"status_changed_at"` - DeploymentID int `json:"deployment_id"` - DeployableID int `json:"deployable_id"` - DeployableURL string `json:"deployable_url"` - Environment string `json:"environment"` - EnvironmentSlug string `json:"environment_slug"` - EnvironmentExternalURL string `json:"environment_external_url"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - WebURL string `json:"web_url"` - AvatarURL *string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - CIConfigPath string `json:"ci_config_path"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - } `json:"project"` - Ref string `json:"ref"` - ShortSHA string `json:"short_sha"` - User *EventUser `json:"user"` - UserURL string `json:"user_url"` - CommitURL string `json:"commit_url"` - CommitTitle string `json:"commit_title"` + ObjectKind string `json:"object_kind"` + Status string `json:"status"` + StatusChangedAt string `json:"status_changed_at"` + DeploymentID int64 `json:"deployment_id"` + DeployableID int64 `json:"deployable_id"` + DeployableURL string `json:"deployable_url"` + Environment string `json:"environment"` + EnvironmentSlug string `json:"environment_slug"` + EnvironmentExternalURL string `json:"environment_external_url"` + Project DeploymentEventProject `json:"project"` + Ref string `json:"ref"` + ShortSHA string `json:"short_sha"` + User *EventUser `json:"user"` + UserURL string `json:"user_url"` + CommitURL string `json:"commit_url"` + CommitTitle string `json:"commit_title"` +} + +type DeploymentEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + AvatarURL *string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + VisibilityLevel int64 `json:"visibility_level"` + CIConfigPath string `json:"ci_config_path"` } // FeatureFlagEvent represents a feature flag event. @@ -177,33 +189,37 @@ type DeploymentEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#feature-flag-events type FeatureFlagEvent struct { - ObjectKind string `json:"object_kind"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - WebURL string `json:"web_url"` - AvatarURL *string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - CIConfigPath string `json:"ci_config_path"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - } `json:"project"` - User *EventUser `json:"user"` - UserURL string `json:"user_url"` - ObjectAttributes struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - Active bool `json:"active"` - } `json:"object_attributes"` + ObjectKind string `json:"object_kind"` + Project FeatureFlagEventProject `json:"project"` + User *EventUser `json:"user"` + UserURL string `json:"user_url"` + ObjectAttributes FeatureFlagEventObjectAttributes `json:"object_attributes"` +} + +type FeatureFlagEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + AvatarURL *string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + VisibilityLevel int64 `json:"visibility_level"` + CIConfigPath string `json:"ci_config_path"` +} + +type FeatureFlagEventObjectAttributes struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + Active bool `json:"active"` } // GroupResourceAccessTokenEvent represents a resource access token event for a @@ -212,20 +228,24 @@ type FeatureFlagEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#project-and-group-access-token-events type GroupResourceAccessTokenEvent struct { - EventName string `json:"event_name"` - ObjectKind string `json:"object_kind"` - Group struct { - GroupID int `json:"group_id"` - GroupName string `json:"group_name"` - GroupPath string `json:"group_path"` - } `json:"group"` - ObjectAttributes struct { - ID int `json:"id"` - UserID int `json:"user_id"` - Name string `json:"name"` - CreatedAt string `json:"created_at"` - ExpiresAt *ISOTime `json:"expires_at"` - } `json:"object_attributes"` + EventName string `json:"event_name"` + ObjectKind string `json:"object_kind"` + Group GroupResourceAccessTokenEventGroup `json:"group"` + ObjectAttributes GroupResourceAccessTokenEventObjectAttributes `json:"object_attributes"` +} + +type GroupResourceAccessTokenEventGroup struct { + GroupID int64 `json:"group_id"` + GroupName string `json:"group_name"` + GroupPath string `json:"group_path"` +} + +type GroupResourceAccessTokenEventObjectAttributes struct { + ID int64 `json:"id"` + UserID int64 `json:"user_id"` + Name string `json:"name"` + CreatedAt string `json:"created_at"` + ExpiresAt *ISOTime `json:"expires_at"` } // IssueCommentEvent represents a comment on an issue event. @@ -233,74 +253,80 @@ type GroupResourceAccessTokenEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#comment-on-an-issue type IssueCommentEvent struct { - ObjectKind string `json:"object_kind"` - EventType string `json:"event_type"` - User *User `json:"user"` - ProjectID int `json:"project_id"` - Project struct { - Name string `json:"name"` - Description string `json:"description"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - WebURL string `json:"web_url"` - Visibility VisibilityValue `json:"visibility"` - } `json:"project"` - Repository *Repository `json:"repository"` - ObjectAttributes struct { - ID int `json:"id"` - Note string `json:"note"` - NoteableType string `json:"noteable_type"` - AuthorID int `json:"author_id"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` - ProjectID int `json:"project_id"` - Attachment string `json:"attachment"` - LineCode string `json:"line_code"` - CommitID string `json:"commit_id"` - DiscussionID string `json:"discussion_id"` - NoteableID int `json:"noteable_id"` - System bool `json:"system"` - StDiff []*Diff `json:"st_diff"` - Description string `json:"description"` - Action CommentEventAction `json:"action"` - URL string `json:"url"` - } `json:"object_attributes"` - Issue struct { - ID int `json:"id"` - IID int `json:"iid"` - ProjectID int `json:"project_id"` - MilestoneID int `json:"milestone_id"` - AuthorID int `json:"author_id"` - Position int `json:"position"` - BranchName string `json:"branch_name"` - Description string `json:"description"` - State string `json:"state"` - Title string `json:"title"` - Labels []*EventLabel `json:"labels"` - LastEditedAt string `json:"last_edit_at"` - LastEditedByID int `json:"last_edited_by_id"` - UpdatedAt string `json:"updated_at"` - UpdatedByID int `json:"updated_by_id"` - CreatedAt string `json:"created_at"` - ClosedAt string `json:"closed_at"` - DueDate *ISOTime `json:"due_date"` - URL string `json:"url"` - TimeEstimate int `json:"time_estimate"` - Confidential bool `json:"confidential"` - TotalTimeSpent int `json:"total_time_spent"` - HumanTotalTimeSpent string `json:"human_total_time_spent"` - HumanTimeEstimate string `json:"human_time_estimate"` - AssigneeIDs []int `json:"assignee_ids"` - AssigneeID int `json:"assignee_id"` - } `json:"issue"` + ObjectKind string `json:"object_kind"` + EventType string `json:"event_type"` + User *User `json:"user"` + ProjectID int64 `json:"project_id"` + Project IssueCommentEventProject `json:"project"` + Repository *Repository `json:"repository"` + ObjectAttributes IssueCommentEventObjectAttributes `json:"object_attributes"` + Issue IssueCommentEventIssue `json:"issue"` +} + +type IssueCommentEventProject struct { + Name string `json:"name"` + Description string `json:"description"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + Visibility VisibilityValue `json:"visibility"` +} + +type IssueCommentEventObjectAttributes struct { + ID int64 `json:"id"` + Note string `json:"note"` + NoteableType string `json:"noteable_type"` + AuthorID int64 `json:"author_id"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + ProjectID int64 `json:"project_id"` + Attachment string `json:"attachment"` + LineCode string `json:"line_code"` + CommitID string `json:"commit_id"` + DiscussionID string `json:"discussion_id"` + NoteableID int64 `json:"noteable_id"` + System bool `json:"system"` + StDiff []*Diff `json:"st_diff"` + Description string `json:"description"` + Action CommentEventAction `json:"action"` + URL string `json:"url"` +} + +type IssueCommentEventIssue struct { + ID int64 `json:"id"` + IID int64 `json:"iid"` + ProjectID int64 `json:"project_id"` + MilestoneID int64 `json:"milestone_id"` + AuthorID int64 `json:"author_id"` + Position int64 `json:"position"` + BranchName string `json:"branch_name"` + Description string `json:"description"` + State string `json:"state"` + Title string `json:"title"` + Labels []*EventLabel `json:"labels"` + LastEditedAt string `json:"last_edit_at"` + LastEditedByID int64 `json:"last_edited_by_id"` + UpdatedAt string `json:"updated_at"` + UpdatedByID int64 `json:"updated_by_id"` + CreatedAt string `json:"created_at"` + ClosedAt string `json:"closed_at"` + DueDate *ISOTime `json:"due_date"` + URL string `json:"url"` + TimeEstimate int64 `json:"time_estimate"` + Confidential bool `json:"confidential"` + TotalTimeSpent int64 `json:"total_time_spent"` + HumanTotalTimeSpent string `json:"human_total_time_spent"` + HumanTimeEstimate string `json:"human_time_estimate"` + AssigneeIDs []int64 `json:"assignee_ids"` + AssigneeID int64 `json:"assignee_id"` } // IssueEvent represents a issue event. @@ -308,109 +334,135 @@ type IssueCommentEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#work-item-events type IssueEvent struct { - ObjectKind string `json:"object_kind"` - EventType string `json:"event_type"` - User *EventUser `json:"user"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - WebURL string `json:"web_url"` - Visibility VisibilityValue `json:"visibility"` - } `json:"project"` - Repository *Repository `json:"repository"` - ObjectAttributes struct { - ID int `json:"id"` - Title string `json:"title"` - AssigneeIDs []int `json:"assignee_ids"` - AssigneeID int `json:"assignee_id"` - AuthorID int `json:"author_id"` - ProjectID int `json:"project_id"` - CreatedAt string `json:"created_at"` // Should be *time.Time (see GitLab issue #21468) - UpdatedAt string `json:"updated_at"` // Should be *time.Time (see GitLab issue #21468) - UpdatedByID int `json:"updated_by_id"` - LastEditedAt string `json:"last_edited_at"` - LastEditedByID int `json:"last_edited_by_id"` - RelativePosition int `json:"relative_position"` - BranchName string `json:"branch_name"` - Description string `json:"description"` - MilestoneID int `json:"milestone_id"` - StateID StateID `json:"state_id"` - Confidential bool `json:"confidential"` - DiscussionLocked bool `json:"discussion_locked"` - DueDate *ISOTime `json:"due_date"` - MovedToID int `json:"moved_to_id"` - DuplicatedToID int `json:"duplicated_to_id"` - TimeEstimate int `json:"time_estimate"` - TotalTimeSpent int `json:"total_time_spent"` - TimeChange int `json:"time_change"` - HumanTotalTimeSpent string `json:"human_total_time_spent"` - HumanTimeEstimate string `json:"human_time_estimate"` - HumanTimeChange string `json:"human_time_change"` - Weight int `json:"weight"` - IID int `json:"iid"` - URL string `json:"url"` - State string `json:"state"` - Action string `json:"action"` - Severity string `json:"severity"` - EscalationStatus string `json:"escalation_status"` - EscalationPolicy struct { - ID int `json:"id"` - Name string `json:"name"` - } `json:"escalation_policy"` - Labels []*EventLabel `json:"labels"` - } `json:"object_attributes"` - Assignee *EventUser `json:"assignee"` - Assignees *[]EventUser `json:"assignees"` - Labels []*EventLabel `json:"labels"` - Changes struct { - Assignees struct { - Previous []*EventUser `json:"previous"` - Current []*EventUser `json:"current"` - } `json:"assignees"` - Description struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"description"` - Labels struct { - Previous []*EventLabel `json:"previous"` - Current []*EventLabel `json:"current"` - } `json:"labels"` - Title struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"title"` - ClosedAt struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"closed_at"` - StateID struct { - Previous StateID `json:"previous"` - Current StateID `json:"current"` - } `json:"state_id"` - UpdatedAt struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"updated_at"` - UpdatedByID struct { - Previous int `json:"previous"` - Current int `json:"current"` - } `json:"updated_by_id"` - TotalTimeSpent struct { - Previous int `json:"previous"` - Current int `json:"current"` - } `json:"total_time_spent"` - } `json:"changes"` + ObjectKind string `json:"object_kind"` + EventType string `json:"event_type"` + User *EventUser `json:"user"` + Project IssueEventProject `json:"project"` + Repository *Repository `json:"repository"` + ObjectAttributes IssueEventObjectAttributes `json:"object_attributes"` + Assignee *EventUser `json:"assignee"` + Assignees *[]EventUser `json:"assignees"` + Labels []*EventLabel `json:"labels"` + Changes IssueEventChanges `json:"changes"` +} + +type IssueEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + Visibility VisibilityValue `json:"visibility"` +} + +type IssueEventObjectAttributes struct { + ID int64 `json:"id"` + Title string `json:"title"` + AssigneeIDs []int64 `json:"assignee_ids"` + AssigneeID int64 `json:"assignee_id"` + AuthorID int64 `json:"author_id"` + ProjectID int64 `json:"project_id"` + CreatedAt string `json:"created_at"` // Should be *time.Time (see Gitlab issue #21468) + UpdatedAt string `json:"updated_at"` // Should be *time.Time (see Gitlab issue #21468) + UpdatedByID int64 `json:"updated_by_id"` + LastEditedAt string `json:"last_edited_at"` + LastEditedByID int64 `json:"last_edited_by_id"` + RelativePosition int64 `json:"relative_position"` + BranchName string `json:"branch_name"` + Description string `json:"description"` + MilestoneID int64 `json:"milestone_id"` + StateID StateID `json:"state_id"` + Confidential bool `json:"confidential"` + DiscussionLocked bool `json:"discussion_locked"` + DueDate *ISOTime `json:"due_date"` + MovedToID int64 `json:"moved_to_id"` + DuplicatedToID int64 `json:"duplicated_to_id"` + TimeEstimate int64 `json:"time_estimate"` + TotalTimeSpent int64 `json:"total_time_spent"` + TimeChange int64 `json:"time_change"` + HumanTotalTimeSpent string `json:"human_total_time_spent"` + HumanTimeEstimate string `json:"human_time_estimate"` + HumanTimeChange string `json:"human_time_change"` + Weight int64 `json:"weight"` + IID int64 `json:"iid"` + URL string `json:"url"` + State string `json:"state"` + Action string `json:"action"` + Severity string `json:"severity"` + EscalationStatus string `json:"escalation_status"` + EscalationPolicy IssueEventObjectAttributesEscalationPolicy `json:"escalation_policy"` + Labels []*EventLabel `json:"labels"` +} + +type IssueEventObjectAttributesEscalationPolicy struct { + ID int64 `json:"id"` + Name string `json:"name"` +} + +type IssueEventChanges struct { + Assignees EventChangesAssignees `json:"assignees"` + Description EventChangesDescription `json:"description"` + Labels EventChangesLabels `json:"labels"` + Title EventChangesTitle `json:"title"` + ClosedAt IssueEventChangesClosedAt `json:"closed_at"` + StateID EventChangesStateID `json:"state_id"` + UpdatedAt EventChangesUpdatedAt `json:"updated_at"` + UpdatedByID EventChangesUpdatedByID `json:"updated_by_id"` + TotalTimeSpent IssueEventChangesTotalTimeSpent `json:"total_time_spent"` +} + +type EventChangesAssignees struct { + Previous []*EventUser `json:"previous"` + Current []*EventUser `json:"current"` +} + +type EventChangesDescription struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type EventChangesLabels struct { + Previous []*EventLabel `json:"previous"` + Current []*EventLabel `json:"current"` +} + +type EventChangesTitle struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type IssueEventChangesClosedAt struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type EventChangesStateID struct { + Previous StateID `json:"previous"` + Current StateID `json:"current"` +} + +type EventChangesUpdatedAt struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type EventChangesUpdatedByID struct { + Previous int64 `json:"previous"` + Current int64 `json:"current"` +} + +type IssueEventChangesTotalTimeSpent struct { + Previous int64 `json:"previous"` + Current int64 `json:"current"` } // JobEvent represents a job event. @@ -418,63 +470,73 @@ type IssueEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#job-events type JobEvent struct { - ObjectKind string `json:"object_kind"` - Ref string `json:"ref"` - Tag bool `json:"tag"` - BeforeSHA string `json:"before_sha"` - SHA string `json:"sha"` - BuildID int `json:"build_id"` - BuildName string `json:"build_name"` - BuildStage string `json:"build_stage"` - BuildStatus string `json:"build_status"` - BuildCreatedAt string `json:"build_created_at"` - BuildStartedAt string `json:"build_started_at"` - BuildFinishedAt string `json:"build_finished_at"` - BuildDuration float64 `json:"build_duration"` - BuildQueuedDuration float64 `json:"build_queued_duration"` - BuildAllowFailure bool `json:"build_allow_failure"` - BuildFailureReason string `json:"build_failure_reason"` - RetriesCount int `json:"retries_count"` - PipelineID int `json:"pipeline_id"` - ProjectID int `json:"project_id"` - ProjectName string `json:"project_name"` - User *EventUser `json:"user"` - Commit struct { - ID int `json:"id"` - Name string `json:"name"` - SHA string `json:"sha"` - Message string `json:"message"` - AuthorName string `json:"author_name"` - AuthorEmail string `json:"author_email"` - AuthorURL string `json:"author_url"` - Status string `json:"status"` - Duration int `json:"duration"` - StartedAt string `json:"started_at"` - FinishedAt string `json:"finished_at"` - } `json:"commit"` - Repository *Repository `json:"repository"` - Runner struct { - ID int `json:"id"` - Active bool `json:"active"` - RunnerType string `json:"runner_type"` - IsShared bool `json:"is_shared"` - Description string `json:"description"` - Tags []string `json:"tags"` - } `json:"runner"` - Environment struct { - Name string `json:"name"` - Action string `json:"action"` - DeploymentTier string `json:"deployment_tier"` - } `json:"environment"` - SourcePipeline struct { - Project struct { - ID int `json:"id"` - WebURL string `json:"web_url"` - PathWithNamespace string `json:"path_with_namespace"` - } `json:"project"` - PipelineID int `json:"pipeline_id"` - JobID int `json:"job_id"` - } `json:"source_pipeline"` + ObjectKind string `json:"object_kind"` + Ref string `json:"ref"` + Tag bool `json:"tag"` + BeforeSHA string `json:"before_sha"` + SHA string `json:"sha"` + BuildID int64 `json:"build_id"` + BuildName string `json:"build_name"` + BuildStage string `json:"build_stage"` + BuildStatus string `json:"build_status"` + BuildCreatedAt string `json:"build_created_at"` + BuildStartedAt string `json:"build_started_at"` + BuildFinishedAt string `json:"build_finished_at"` + BuildDuration float64 `json:"build_duration"` + BuildQueuedDuration float64 `json:"build_queued_duration"` + BuildAllowFailure bool `json:"build_allow_failure"` + BuildFailureReason string `json:"build_failure_reason"` + RetriesCount int64 `json:"retries_count"` + PipelineID int64 `json:"pipeline_id"` + ProjectID int64 `json:"project_id"` + ProjectName string `json:"project_name"` + User *EventUser `json:"user"` + Commit JobEventCommit `json:"commit"` + Repository *Repository `json:"repository"` + Runner JobEventRunner `json:"runner"` + Environment EventEnvironment `json:"environment"` + SourcePipeline EventSourcePipeline `json:"source_pipeline"` +} + +type JobEventCommit struct { + ID int64 `json:"id"` + Name string `json:"name"` + SHA string `json:"sha"` + Message string `json:"message"` + AuthorName string `json:"author_name"` + AuthorEmail string `json:"author_email"` + AuthorURL string `json:"author_url"` + Status string `json:"status"` + Duration int64 `json:"duration"` + StartedAt string `json:"started_at"` + FinishedAt string `json:"finished_at"` +} + +type JobEventRunner struct { + ID int64 `json:"id"` + Active bool `json:"active"` + RunnerType string `json:"runner_type"` + IsShared bool `json:"is_shared"` + Description string `json:"description"` + Tags []string `json:"tags"` +} + +type EventEnvironment struct { + Name string `json:"name"` + Action string `json:"action"` + DeploymentTier string `json:"deployment_tier"` +} + +type EventSourcePipeline struct { + Project EventSourcePipelineProject `json:"project"` + PipelineID int64 `json:"pipeline_id"` + JobID int64 `json:"job_id"` +} + +type EventSourcePipelineProject struct { + ID int64 `json:"id"` + WebURL string `json:"web_url"` + PathWithNamespace string `json:"path_with_namespace"` } // MemberEvent represents a member event. @@ -486,11 +548,11 @@ type MemberEvent struct { UpdatedAt *time.Time `json:"updated_at"` GroupName string `json:"group_name"` GroupPath string `json:"group_path"` - GroupID int `json:"group_id"` + GroupID int64 `json:"group_id"` UserUsername string `json:"user_username"` UserName string `json:"user_name"` UserEmail string `json:"user_email"` - UserID int `json:"user_id"` + UserID int64 `json:"user_id"` GroupAccess string `json:"group_access"` GroupPlan string `json:"group_plan"` ExpiresAt *time.Time `json:"expires_at"` @@ -502,111 +564,116 @@ type MemberEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#comment-on-a-merge-request type MergeCommentEvent struct { - ObjectKind string `json:"object_kind"` - EventType string `json:"event_type"` - User *EventUser `json:"user"` - ProjectID int `json:"project_id"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - WebURL string `json:"web_url"` - Visibility VisibilityValue `json:"visibility"` - } `json:"project"` - ObjectAttributes struct { - Attachment string `json:"attachment"` - AuthorID int `json:"author_id"` - ChangePosition *NotePosition `json:"change_position"` - CommitID string `json:"commit_id"` - CreatedAt string `json:"created_at"` - DiscussionID string `json:"discussion_id"` - ID int `json:"id"` - LineCode string `json:"line_code"` - Note string `json:"note"` - NoteableID int `json:"noteable_id"` - NoteableType string `json:"noteable_type"` - OriginalPosition *NotePosition `json:"original_position"` - Position *NotePosition `json:"position"` - ProjectID int `json:"project_id"` - ResolvedAt string `json:"resolved_at"` - ResolvedByID int `json:"resolved_by_id"` - ResolvedByPush bool `json:"resolved_by_push"` - StDiff *Diff `json:"st_diff"` - System bool `json:"system"` - Type string `json:"type"` - UpdatedAt string `json:"updated_at"` - UpdatedByID int `json:"updated_by_id"` - Description string `json:"description"` - Action CommentEventAction `json:"action"` - URL string `json:"url"` - } `json:"object_attributes"` - Repository *Repository `json:"repository"` - MergeRequest struct { - ID int `json:"id"` - TargetBranch string `json:"target_branch"` - SourceBranch string `json:"source_branch"` - SourceProjectID int `json:"source_project_id"` - AuthorID int `json:"author_id"` - AssigneeID int `json:"assignee_id"` - AssigneeIDs []int `json:"assignee_ids"` - ReviewerIDs []int `json:"reviewer_ids"` - Title string `json:"title"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` - MilestoneID int `json:"milestone_id"` - State string `json:"state"` - MergeStatus string `json:"merge_status"` - TargetProjectID int `json:"target_project_id"` - IID int `json:"iid"` - Description string `json:"description"` - Position int `json:"position"` - Labels []*EventLabel `json:"labels"` - LockedAt string `json:"locked_at"` - UpdatedByID int `json:"updated_by_id"` - MergeError string `json:"merge_error"` - MergeParams *MergeParams `json:"merge_params"` - MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"` - MergeUserID int `json:"merge_user_id"` - MergeCommitSHA string `json:"merge_commit_sha"` - DeletedAt string `json:"deleted_at"` - InProgressMergeCommitSHA string `json:"in_progress_merge_commit_sha"` - LockVersion int `json:"lock_version"` - ApprovalsBeforeMerge string `json:"approvals_before_merge"` - RebaseCommitSHA string `json:"rebase_commit_sha"` - TimeEstimate int `json:"time_estimate"` - Squash bool `json:"squash"` - LastEditedAt string `json:"last_edited_at"` - LastEditedByID int `json:"last_edited_by_id"` - Source *Repository `json:"source"` - Target *Repository `json:"target"` - LastCommit struct { - ID string `json:"id"` - Title string `json:"title"` - Message string `json:"message"` - Timestamp *time.Time `json:"timestamp"` - URL string `json:"url"` - Author struct { - Name string `json:"name"` - Email string `json:"email"` - } `json:"author"` - } `json:"last_commit"` - WorkInProgress bool `json:"work_in_progress"` - TotalTimeSpent int `json:"total_time_spent"` - HeadPipelineID int `json:"head_pipeline_id"` - Assignee *EventUser `json:"assignee"` - DetailedMergeStatus string `json:"detailed_merge_status"` - URL string `json:"url"` - } `json:"merge_request"` + ObjectKind string `json:"object_kind"` + EventType string `json:"event_type"` + User *EventUser `json:"user"` + ProjectID int64 `json:"project_id"` + Project MergeCommentEventProject `json:"project"` + ObjectAttributes MergeCommentEventObjectAttributes `json:"object_attributes"` + Repository *Repository `json:"repository"` + MergeRequest MergeCommentEventMergeRequest `json:"merge_request"` +} + +type MergeCommentEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + Visibility VisibilityValue `json:"visibility"` +} + +type MergeCommentEventObjectAttributes struct { + Attachment string `json:"attachment"` + AuthorID int64 `json:"author_id"` + ChangePosition *NotePosition `json:"change_position"` + CommitID string `json:"commit_id"` + CreatedAt string `json:"created_at"` + DiscussionID string `json:"discussion_id"` + ID int64 `json:"id"` + LineCode string `json:"line_code"` + Note string `json:"note"` + NoteableID int64 `json:"noteable_id"` + NoteableType string `json:"noteable_type"` + OriginalPosition *NotePosition `json:"original_position"` + Position *NotePosition `json:"position"` + ProjectID int64 `json:"project_id"` + ResolvedAt string `json:"resolved_at"` + ResolvedByID int64 `json:"resolved_by_id"` + ResolvedByPush bool `json:"resolved_by_push"` + StDiff *Diff `json:"st_diff"` + System bool `json:"system"` + Type string `json:"type"` + UpdatedAt string `json:"updated_at"` + UpdatedByID int64 `json:"updated_by_id"` + Description string `json:"description"` + Action CommentEventAction `json:"action"` + URL string `json:"url"` +} + +type MergeCommentEventMergeRequest struct { + ID int64 `json:"id"` + TargetBranch string `json:"target_branch"` + SourceBranch string `json:"source_branch"` + SourceProjectID int64 `json:"source_project_id"` + AuthorID int64 `json:"author_id"` + AssigneeID int64 `json:"assignee_id"` + AssigneeIDs []int64 `json:"assignee_ids"` + ReviewerIDs []int64 `json:"reviewer_ids"` + Title string `json:"title"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + MilestoneID int64 `json:"milestone_id"` + State string `json:"state"` + MergeStatus string `json:"merge_status"` + TargetProjectID int64 `json:"target_project_id"` + IID int64 `json:"iid"` + Description string `json:"description"` + Position int64 `json:"position"` + Labels []*EventLabel `json:"labels"` + LockedAt string `json:"locked_at"` + UpdatedByID int64 `json:"updated_by_id"` + MergeError string `json:"merge_error"` + MergeParams *MergeParams `json:"merge_params"` + MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"` + MergeUserID int64 `json:"merge_user_id"` + MergeCommitSHA string `json:"merge_commit_sha"` + DeletedAt string `json:"deleted_at"` + InProgressMergeCommitSHA string `json:"in_progress_merge_commit_sha"` + LockVersion int64 `json:"lock_version"` + ApprovalsBeforeMerge string `json:"approvals_before_merge"` + RebaseCommitSHA string `json:"rebase_commit_sha"` + TimeEstimate int64 `json:"time_estimate"` + Squash bool `json:"squash"` + LastEditedAt string `json:"last_edited_at"` + LastEditedByID int64 `json:"last_edited_by_id"` + Source *Repository `json:"source"` + Target *Repository `json:"target"` + LastCommit EventMergeRequestLastCommit `json:"last_commit"` + WorkInProgress bool `json:"work_in_progress"` + TotalTimeSpent int64 `json:"total_time_spent"` + HeadPipelineID int64 `json:"head_pipeline_id"` + Assignee *EventUser `json:"assignee"` + DetailedMergeStatus string `json:"detailed_merge_status"` + URL string `json:"url"` +} + +type EventMergeRequestLastCommit struct { + ID string `json:"id"` + Title string `json:"title"` + Message string `json:"message"` + Timestamp *time.Time `json:"timestamp"` + URL string `json:"url"` + Author EventCommitAuthor `json:"author"` } // MergeEvent represents a merge event. @@ -614,173 +681,168 @@ type MergeCommentEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#merge-request-events type MergeEvent struct { - ObjectKind string `json:"object_kind"` - EventType string `json:"event_type"` - User *EventUser `json:"user"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - CIConfigPath string `json:"ci_config_path"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - WebURL string `json:"web_url"` - Visibility VisibilityValue `json:"visibility"` - } `json:"project"` - ObjectAttributes struct { - ID int `json:"id"` - TargetBranch string `json:"target_branch"` - SourceBranch string `json:"source_branch"` - SourceProjectID int `json:"source_project_id"` - AuthorID int `json:"author_id"` - AssigneeID int `json:"assignee_id"` - AssigneeIDs []int `json:"assignee_ids"` - ReviewerIDs []int `json:"reviewer_ids"` - Title string `json:"title"` - CreatedAt string `json:"created_at"` // Should be *time.Time (see GitLab issue #21468) - UpdatedAt string `json:"updated_at"` // Should be *time.Time (see GitLab issue #21468) - StCommits []*Commit `json:"st_commits"` - StDiffs []*Diff `json:"st_diffs"` - LastEditedAt string `json:"last_edited_at"` - LastEditedByID int `json:"last_edited_by_id"` - MilestoneID int `json:"milestone_id"` - StateID StateID `json:"state_id"` - State string `json:"state"` - MergeStatus string `json:"merge_status"` - TargetProjectID int `json:"target_project_id"` - IID int `json:"iid"` - Description string `json:"description"` - Position int `json:"position"` - LockedAt string `json:"locked_at"` - UpdatedByID int `json:"updated_by_id"` - MergeError string `json:"merge_error"` - MergeParams *MergeParams `json:"merge_params"` - MergeWhenBuildSucceeds bool `json:"merge_when_build_succeeds"` - MergeUserID int `json:"merge_user_id"` - MergeCommitSHA string `json:"merge_commit_sha"` - DeletedAt string `json:"deleted_at"` - ApprovalsBeforeMerge string `json:"approvals_before_merge"` - RebaseCommitSHA string `json:"rebase_commit_sha"` - InProgressMergeCommitSHA string `json:"in_progress_merge_commit_sha"` - LockVersion int `json:"lock_version"` - TimeEstimate int `json:"time_estimate"` - Source *Repository `json:"source"` - Target *Repository `json:"target"` - HeadPipelineID *int `json:"head_pipeline_id"` - LastCommit struct { - ID string `json:"id"` - Message string `json:"message"` - Title string `json:"title"` - Timestamp *time.Time `json:"timestamp"` - URL string `json:"url"` - Author struct { - Name string `json:"name"` - Email string `json:"email"` - } `json:"author"` - } `json:"last_commit"` - BlockingDiscussionsResolved bool `json:"blocking_discussions_resolved"` - WorkInProgress bool `json:"work_in_progress"` - Draft bool `json:"draft"` - TotalTimeSpent int `json:"total_time_spent"` - TimeChange int `json:"time_change"` - HumanTotalTimeSpent string `json:"human_total_time_spent"` - HumanTimeChange string `json:"human_time_change"` - HumanTimeEstimate string `json:"human_time_estimate"` - FirstContribution bool `json:"first_contribution"` - URL string `json:"url"` - Labels []*EventLabel `json:"labels"` - Action string `json:"action"` - DetailedMergeStatus string `json:"detailed_merge_status"` - OldRev string `json:"oldrev"` - } `json:"object_attributes"` - Repository *Repository `json:"repository"` - Labels []*EventLabel `json:"labels"` - Changes struct { - Assignees struct { - Previous []*EventUser `json:"previous"` - Current []*EventUser `json:"current"` - } `json:"assignees"` - Reviewers struct { - Previous []*EventUser `json:"previous"` - Current []*EventUser `json:"current"` - } `json:"reviewers"` - Description struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"description"` - Draft struct { - Previous bool `json:"previous"` - Current bool `json:"current"` - } `json:"draft"` - Labels struct { - Previous []*EventLabel `json:"previous"` - Current []*EventLabel `json:"current"` - } `json:"labels"` - LastEditedAt struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"last_edited_at"` - LastEditedByID struct { - Previous int `json:"previous"` - Current int `json:"current"` - } `json:"last_edited_by_id"` - MergeStatus struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"merge_status"` - MilestoneID struct { - Previous int `json:"previous"` - Current int `json:"current"` - } `json:"milestone_id"` - SourceBranch struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"source_branch"` - SourceProjectID struct { - Previous int `json:"previous"` - Current int `json:"current"` - } `json:"source_project_id"` - StateID struct { - Previous StateID `json:"previous"` - Current StateID `json:"current"` - } `json:"state_id"` - TargetBranch struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"target_branch"` - TargetProjectID struct { - Previous int `json:"previous"` - Current int `json:"current"` - } `json:"target_project_id"` - Title struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"title"` - UpdatedAt struct { - Previous string `json:"previous"` - Current string `json:"current"` - } `json:"updated_at"` - UpdatedByID struct { - Previous int `json:"previous"` - Current int `json:"current"` - } `json:"updated_by_id"` - } `json:"changes"` - Assignees []*EventUser `json:"assignees"` - Reviewers []*EventUser `json:"reviewers"` + ObjectKind string `json:"object_kind"` + EventType string `json:"event_type"` + User *EventUser `json:"user"` + Project MergeEventProject `json:"project"` + ObjectAttributes MergeEventObjectAttributes `json:"object_attributes"` + Repository *Repository `json:"repository"` + Labels []*EventLabel `json:"labels"` + Changes MergeEventChanges `json:"changes"` + Assignees []*EventUser `json:"assignees"` + Reviewers []*EventUser `json:"reviewers"` +} + +type MergeEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + CIConfigPath string `json:"ci_config_path"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + Visibility VisibilityValue `json:"visibility"` +} + +type MergeEventObjectAttributes struct { + ID int64 `json:"id"` + TargetBranch string `json:"target_branch"` + SourceBranch string `json:"source_branch"` + SourceProjectID int64 `json:"source_project_id"` + AuthorID int64 `json:"author_id"` + AssigneeID int64 `json:"assignee_id"` + AssigneeIDs []int64 `json:"assignee_ids"` + ReviewerIDs []int64 `json:"reviewer_ids"` + Title string `json:"title"` + CreatedAt string `json:"created_at"` // Should be *time.Time (see Gitlab issue #21468) + UpdatedAt string `json:"updated_at"` // Should be *time.Time (see Gitlab issue #21468) + StCommits []*Commit `json:"st_commits"` + StDiffs []*Diff `json:"st_diffs"` + LastEditedAt string `json:"last_edited_at"` + LastEditedByID int64 `json:"last_edited_by_id"` + MilestoneID int64 `json:"milestone_id"` + StateID StateID `json:"state_id"` + State string `json:"state"` + MergeStatus string `json:"merge_status"` + TargetProjectID int64 `json:"target_project_id"` + IID int64 `json:"iid"` + Description string `json:"description"` + Position int64 `json:"position"` + LockedAt string `json:"locked_at"` + UpdatedByID int64 `json:"updated_by_id"` + MergeError string `json:"merge_error"` + MergeParams *MergeParams `json:"merge_params"` + MergeWhenBuildSucceeds bool `json:"merge_when_build_succeeds"` + MergeUserID int64 `json:"merge_user_id"` + MergeCommitSHA string `json:"merge_commit_sha"` + DeletedAt string `json:"deleted_at"` + ApprovalsBeforeMerge string `json:"approvals_before_merge"` + RebaseCommitSHA string `json:"rebase_commit_sha"` + InProgressMergeCommitSHA string `json:"in_progress_merge_commit_sha"` + LockVersion int64 `json:"lock_version"` + TimeEstimate int64 `json:"time_estimate"` + Source *Repository `json:"source"` + Target *Repository `json:"target"` + HeadPipelineID *int64 `json:"head_pipeline_id"` + LastCommit EventMergeRequestLastCommit `json:"last_commit"` + BlockingDiscussionsResolved bool `json:"blocking_discussions_resolved"` + WorkInProgress bool `json:"work_in_progress"` + Draft bool `json:"draft"` + TotalTimeSpent int64 `json:"total_time_spent"` + TimeChange int64 `json:"time_change"` + HumanTotalTimeSpent string `json:"human_total_time_spent"` + HumanTimeChange string `json:"human_time_change"` + HumanTimeEstimate string `json:"human_time_estimate"` + FirstContribution bool `json:"first_contribution"` + URL string `json:"url"` + Labels []*EventLabel `json:"labels"` + Action string `json:"action"` + DetailedMergeStatus string `json:"detailed_merge_status"` + OldRev string `json:"oldrev"` +} + +type MergeEventChanges struct { + Assignees EventChangesAssignees `json:"assignees"` + Reviewers MergeEventChangesReviewers `json:"reviewers"` + Description EventChangesDescription `json:"description"` + Draft MergeEventChangesDraft `json:"draft"` + Labels EventChangesLabels `json:"labels"` + LastEditedAt MergeEventChangesLastEditedAt `json:"last_edited_at"` + LastEditedByID MergeEventChangesLastEditedByID `json:"last_edited_by_id"` + MergeStatus MergeEventChangesMergeStatus `json:"merge_status"` + MilestoneID MergeEventChangesMilestoneID `json:"milestone_id"` + SourceBranch MergeEventChangesSourceBranch `json:"source_branch"` + SourceProjectID MergeEventChangesSourceProjectID `json:"source_project_id"` + StateID EventChangesStateID `json:"state_id"` + TargetBranch MergeEventChangesTargetBranch `json:"target_branch"` + TargetProjectID MergeEventChangesTargetProjectID `json:"target_project_id"` + Title EventChangesTitle `json:"title"` + UpdatedAt EventChangesUpdatedAt `json:"updated_at"` + UpdatedByID EventChangesUpdatedByID `json:"updated_by_id"` +} + +type MergeEventChangesReviewers struct { + Previous []*EventUser `json:"previous"` + Current []*EventUser `json:"current"` +} + +type MergeEventChangesDraft struct { + Previous bool `json:"previous"` + Current bool `json:"current"` +} + +type MergeEventChangesLastEditedAt struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type MergeEventChangesLastEditedByID struct { + Previous int64 `json:"previous"` + Current int64 `json:"current"` +} + +type MergeEventChangesMergeStatus struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type MergeEventChangesMilestoneID struct { + Previous int64 `json:"previous"` + Current int64 `json:"current"` +} + +type MergeEventChangesSourceBranch struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type MergeEventChangesSourceProjectID struct { + Previous int64 `json:"previous"` + Current int64 `json:"current"` +} + +type MergeEventChangesTargetBranch struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type MergeEventChangesTargetProjectID struct { + Previous int64 `json:"previous"` + Current int64 `json:"current"` } // EventUser represents a user record in an event and is used as an even // initiator or a merge assignee. type EventUser struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Username string `json:"username"` AvatarURL string `json:"avatar_url"` @@ -832,113 +894,114 @@ func (p *MergeParams) UnmarshalJSON(b []byte) error { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#pipeline-events type PipelineEvent struct { - ObjectKind string `json:"object_kind"` - ObjectAttributes struct { - ID int `json:"id"` - IID int `json:"iid"` - Name string `json:"name"` - Ref string `json:"ref"` - Tag bool `json:"tag"` - SHA string `json:"sha"` - BeforeSHA string `json:"before_sha"` - Source string `json:"source"` - Status string `json:"status"` - DetailedStatus string `json:"detailed_status"` - Stages []string `json:"stages"` - CreatedAt string `json:"created_at"` - FinishedAt string `json:"finished_at"` - Duration int `json:"duration"` - QueuedDuration int `json:"queued_duration"` - URL string `json:"url"` - Variables []struct { - Key string `json:"key"` - Value string `json:"value"` - } `json:"variables"` - } `json:"object_attributes"` - MergeRequest struct { - ID int `json:"id"` - IID int `json:"iid"` - Title string `json:"title"` - SourceBranch string `json:"source_branch"` - SourceProjectID int `json:"source_project_id"` - TargetBranch string `json:"target_branch"` - TargetProjectID int `json:"target_project_id"` - State string `json:"state"` - MergeRequestStatus string `json:"merge_status"` - DetailedMergeStatus string `json:"detailed_merge_status"` - URL string `json:"url"` - } `json:"merge_request"` - User *EventUser `json:"user"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - WebURL string `json:"web_url"` - Visibility VisibilityValue `json:"visibility"` - } `json:"project"` - Commit struct { - ID string `json:"id"` - Message string `json:"message"` - Title string `json:"title"` - Timestamp *time.Time `json:"timestamp"` - URL string `json:"url"` - Author struct { - Name string `json:"name"` - Email string `json:"email"` - } `json:"author"` - } `json:"commit"` - SourcePipeline struct { - Project struct { - ID int `json:"id"` - WebURL string `json:"web_url"` - PathWithNamespace string `json:"path_with_namespace"` - } `json:"project"` - PipelineID int `json:"pipeline_id"` - JobID int `json:"job_id"` - } `json:"source_pipeline"` - Builds []struct { - ID int `json:"id"` - Stage string `json:"stage"` - Name string `json:"name"` - Status string `json:"status"` - CreatedAt string `json:"created_at"` - StartedAt string `json:"started_at"` - FinishedAt string `json:"finished_at"` - Duration float64 `json:"duration"` - QueuedDuration float64 `json:"queued_duration"` - FailureReason string `json:"failure_reason"` - When string `json:"when"` - Manual bool `json:"manual"` - AllowFailure bool `json:"allow_failure"` - User *EventUser `json:"user"` - Runner struct { - ID int `json:"id"` - Description string `json:"description"` - Active bool `json:"active"` - IsShared bool `json:"is_shared"` - RunnerType string `json:"runner_type"` - Tags []string `json:"tags"` - } `json:"runner"` - ArtifactsFile struct { - Filename string `json:"filename"` - Size int `json:"size"` - } `json:"artifacts_file"` - Environment struct { - Name string `json:"name"` - Action string `json:"action"` - DeploymentTier string `json:"deployment_tier"` - } `json:"environment"` - } `json:"builds"` + ObjectKind string `json:"object_kind"` + ObjectAttributes PipelineEventObjectAttributes `json:"object_attributes"` + MergeRequest PipelineEventMergeRequest `json:"merge_request"` + User *EventUser `json:"user"` + Project PipelineEventProject `json:"project"` + Commit PipelineEventCommit `json:"commit"` + SourcePipeline EventSourcePipeline `json:"source_pipeline"` + Builds []PipelineEventBuild `json:"builds"` +} + +type PipelineEventObjectAttributes struct { + ID int64 `json:"id"` + IID int64 `json:"iid"` + Name string `json:"name"` + Ref string `json:"ref"` + Tag bool `json:"tag"` + SHA string `json:"sha"` + BeforeSHA string `json:"before_sha"` + Source string `json:"source"` + Status string `json:"status"` + DetailedStatus string `json:"detailed_status"` + Stages []string `json:"stages"` + CreatedAt string `json:"created_at"` + FinishedAt string `json:"finished_at"` + Duration int64 `json:"duration"` + QueuedDuration int64 `json:"queued_duration"` + URL string `json:"url"` + Variables []PipelineEventObjectAttributesVariable `json:"variables"` +} + +type PipelineEventObjectAttributesVariable struct { + Key string `json:"key"` + Value string `json:"value"` +} + +type PipelineEventMergeRequest struct { + ID int64 `json:"id"` + IID int64 `json:"iid"` + Title string `json:"title"` + SourceBranch string `json:"source_branch"` + SourceProjectID int64 `json:"source_project_id"` + TargetBranch string `json:"target_branch"` + TargetProjectID int64 `json:"target_project_id"` + State string `json:"state"` + MergeRequestStatus string `json:"merge_status"` + DetailedMergeStatus string `json:"detailed_merge_status"` + URL string `json:"url"` +} + +type PipelineEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + Visibility VisibilityValue `json:"visibility"` +} + +type PipelineEventCommit struct { + ID string `json:"id"` + Message string `json:"message"` + Title string `json:"title"` + Timestamp *time.Time `json:"timestamp"` + URL string `json:"url"` + Author EventCommitAuthor `json:"author"` +} + +type PipelineEventBuild struct { + ID int64 `json:"id"` + Stage string `json:"stage"` + Name string `json:"name"` + Status string `json:"status"` + CreatedAt string `json:"created_at"` + StartedAt string `json:"started_at"` + FinishedAt string `json:"finished_at"` + Duration float64 `json:"duration"` + QueuedDuration float64 `json:"queued_duration"` + FailureReason string `json:"failure_reason"` + When string `json:"when"` + Manual bool `json:"manual"` + AllowFailure bool `json:"allow_failure"` + User *EventUser `json:"user"` + Runner PipelineEventBuildRunner `json:"runner"` + ArtifactsFile PipelineEventBuildArtifactsFile `json:"artifacts_file"` + Environment EventEnvironment `json:"environment"` +} + +type PipelineEventBuildRunner struct { + ID int64 `json:"id"` + Description string `json:"description"` + Active bool `json:"active"` + IsShared bool `json:"is_shared"` + RunnerType string `json:"runner_type"` + Tags []string `json:"tags"` +} + +type PipelineEventBuildArtifactsFile struct { + Filename string `json:"filename"` + Size int64 `json:"size"` } // ProjectResourceAccessTokenEvent represents a resource access token event for @@ -947,33 +1010,37 @@ type PipelineEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#project-and-group-access-token-events type ProjectResourceAccessTokenEvent struct { - EventName string `json:"event_name"` - ObjectKind string `json:"object_kind"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - WebURL string `json:"web_url"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - CIConfigPath string `json:"ci_config_path"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - } `json:"project"` - ObjectAttributes struct { - ID int `json:"id"` - UserID int `json:"user_id"` - Name string `json:"name"` - CreatedAt string `json:"created_at"` - ExpiresAt *ISOTime `json:"expires_at"` - } `json:"object_attributes"` + EventName string `json:"event_name"` + ObjectKind string `json:"object_kind"` + Project ProjectResourceAccessTokenEventProject `json:"project"` + ObjectAttributes ProjectResourceAccessTokenEventObjectAttributes `json:"object_attributes"` +} + +type ProjectResourceAccessTokenEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + WebURL string `json:"web_url"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + VisibilityLevel int64 `json:"visibility_level"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + CIConfigPath string `json:"ci_config_path"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` +} + +type ProjectResourceAccessTokenEventObjectAttributes struct { + ID int64 `json:"id"` + UserID int64 `json:"user_id"` + Name string `json:"name"` + CreatedAt string `json:"created_at"` + ExpiresAt *ISOTime `json:"expires_at"` } // PushEvent represents a push event. @@ -981,52 +1048,53 @@ type ProjectResourceAccessTokenEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#push-events type PushEvent struct { - ObjectKind string `json:"object_kind"` - EventName string `json:"event_name"` - Before string `json:"before"` - After string `json:"after"` - Ref string `json:"ref"` - RefProtected bool `json:"ref_protected"` - CheckoutSHA string `json:"checkout_sha"` - UserID int `json:"user_id"` - UserName string `json:"user_name"` - UserUsername string `json:"user_username"` - UserEmail string `json:"user_email"` - UserAvatar string `json:"user_avatar"` - ProjectID int `json:"project_id"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - WebURL string `json:"web_url"` - Visibility VisibilityValue `json:"visibility"` - } `json:"project"` - Repository *Repository `json:"repository"` - Commits []*struct { - ID string `json:"id"` - Message string `json:"message"` - Title string `json:"title"` - Timestamp *time.Time `json:"timestamp"` - URL string `json:"url"` - Author struct { - Name string `json:"name"` - Email string `json:"email"` - } `json:"author"` - Added []string `json:"added"` - Modified []string `json:"modified"` - Removed []string `json:"removed"` - } `json:"commits"` - TotalCommitsCount int `json:"total_commits_count"` + ObjectKind string `json:"object_kind"` + EventName string `json:"event_name"` + Before string `json:"before"` + After string `json:"after"` + Ref string `json:"ref"` + RefProtected bool `json:"ref_protected"` + CheckoutSHA string `json:"checkout_sha"` + UserID int64 `json:"user_id"` + UserName string `json:"user_name"` + UserUsername string `json:"user_username"` + UserEmail string `json:"user_email"` + UserAvatar string `json:"user_avatar"` + ProjectID int64 `json:"project_id"` + Project PushEventProject `json:"project"` + Repository *Repository `json:"repository"` + Commits []*PushEventCommit `json:"commits"` + TotalCommitsCount int64 `json:"total_commits_count"` +} + +type PushEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + Visibility VisibilityValue `json:"visibility"` +} + +type PushEventCommit struct { + ID string `json:"id"` + Message string `json:"message"` + Title string `json:"title"` + Timestamp *time.Time `json:"timestamp"` + URL string `json:"url"` + Author EventCommitAuthor `json:"author"` + Added []string `json:"added"` + Modified []string `json:"modified"` + Removed []string `json:"removed"` } // ReleaseEvent represents a release event @@ -1034,58 +1102,65 @@ type PushEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#release-events type ReleaseEvent struct { - ID int `json:"id"` - CreatedAt string `json:"created_at"` // Should be *time.Time (see GitLab issue #21468) - Description string `json:"description"` - Name string `json:"name"` - Tag string `json:"tag"` - ReleasedAt string `json:"released_at"` // Should be *time.Time (see GitLab issue #21468) - ObjectKind string `json:"object_kind"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - WebURL string `json:"web_url"` - AvatarURL *string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - CIConfigPath string `json:"ci_config_path"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - } `json:"project"` + ID int64 `json:"id"` + CreatedAt string `json:"created_at"` // Should be *time.Time (see Gitlab issue #21468) + Description string `json:"description"` + Name string `json:"name"` + Tag string `json:"tag"` + ReleasedAt string `json:"released_at"` // Should be *time.Time (see Gitlab issue #21468) + ObjectKind string `json:"object_kind"` + Project ReleaseEventProject `json:"project"` + URL string `json:"url"` + Action string `json:"action"` + Assets ReleaseEventAssets `json:"assets"` + Commit ReleaseEventCommit `json:"commit"` +} + +type ReleaseEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + WebURL string `json:"web_url"` + AvatarURL *string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + VisibilityLevel int64 `json:"visibility_level"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + CIConfigPath string `json:"ci_config_path"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` +} + +type ReleaseEventAssets struct { + Count int64 `json:"count"` + Links []ReleaseEventAssetsLink `json:"links"` + Sources []ReleaseEventAssetsSource `json:"sources"` +} + +type ReleaseEventAssetsLink struct { + ID int64 `json:"id"` + External bool `json:"external"` + LinkType string `json:"link_type"` + Name string `json:"name"` + URL string `json:"url"` +} + +type ReleaseEventAssetsSource struct { + Format string `json:"format"` URL string `json:"url"` - Action string `json:"action"` - Assets struct { - Count int `json:"count"` - Links []struct { - ID int `json:"id"` - External bool `json:"external"` - LinkType string `json:"link_type"` - Name string `json:"name"` - URL string `json:"url"` - } `json:"links"` - Sources []struct { - Format string `json:"format"` - URL string `json:"url"` - } `json:"sources"` - } `json:"assets"` - Commit struct { - ID string `json:"id"` - Message string `json:"message"` - Title string `json:"title"` - Timestamp string `json:"timestamp"` // Should be *time.Time (see GitLab issue #21468) - URL string `json:"url"` - Author struct { - Name string `json:"name"` - Email string `json:"email"` - } `json:"author"` - } `json:"commit"` +} + +type ReleaseEventCommit struct { + ID string `json:"id"` + Message string `json:"message"` + Title string `json:"title"` + Timestamp string `json:"timestamp"` // Should be *time.Time (see Gitlab issue #21468) + URL string `json:"url"` + Author EventCommitAuthor `json:"author"` } // SnippetCommentEvent represents a comment on a snippet event. @@ -1093,61 +1168,67 @@ type ReleaseEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#comment-on-a-code-snippet type SnippetCommentEvent struct { - ObjectKind string `json:"object_kind"` - EventType string `json:"event_type"` - User *EventUser `json:"user"` - ProjectID int `json:"project_id"` - Project struct { - Name string `json:"name"` - Description string `json:"description"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - WebURL string `json:"web_url"` - Visibility VisibilityValue `json:"visibility"` - } `json:"project"` - Repository *Repository `json:"repository"` - ObjectAttributes struct { - ID int `json:"id"` - Note string `json:"note"` - NoteableType string `json:"noteable_type"` - AuthorID int `json:"author_id"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` - ProjectID int `json:"project_id"` - Attachment string `json:"attachment"` - LineCode string `json:"line_code"` - CommitID string `json:"commit_id"` - NoteableID int `json:"noteable_id"` - System bool `json:"system"` - StDiff *Diff `json:"st_diff"` - Description string `json:"description"` - Action CommentEventAction `json:"action"` - URL string `json:"url"` - } `json:"object_attributes"` - Snippet *struct { - ID int `json:"id"` - Title string `json:"title"` - Content string `json:"content"` - AuthorID int `json:"author_id"` - ProjectID int `json:"project_id"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` - Filename string `json:"file_name"` - ExpiresAt string `json:"expires_at"` - Type string `json:"type"` - VisibilityLevel int `json:"visibility_level"` - Description string `json:"description"` - Secret bool `json:"secret"` - RepositoryReadOnly bool `json:"repository_read_only"` - } `json:"snippet"` + ObjectKind string `json:"object_kind"` + EventType string `json:"event_type"` + User *EventUser `json:"user"` + ProjectID int64 `json:"project_id"` + Project SnippetCommentEventProject `json:"project"` + Repository *Repository `json:"repository"` + ObjectAttributes SnippetCommentEventObjectAttributes `json:"object_attributes"` + Snippet *SnippetCommentEventSnippet `json:"snippet"` +} + +type SnippetCommentEventProject struct { + Name string `json:"name"` + Description string `json:"description"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + Visibility VisibilityValue `json:"visibility"` +} + +type SnippetCommentEventObjectAttributes struct { + ID int64 `json:"id"` + Note string `json:"note"` + NoteableType string `json:"noteable_type"` + AuthorID int64 `json:"author_id"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + ProjectID int64 `json:"project_id"` + Attachment string `json:"attachment"` + LineCode string `json:"line_code"` + CommitID string `json:"commit_id"` + NoteableID int64 `json:"noteable_id"` + System bool `json:"system"` + StDiff *Diff `json:"st_diff"` + Description string `json:"description"` + Action CommentEventAction `json:"action"` + URL string `json:"url"` +} + +type SnippetCommentEventSnippet struct { + ID int64 `json:"id"` + Title string `json:"title"` + Content string `json:"content"` + AuthorID int64 `json:"author_id"` + ProjectID int64 `json:"project_id"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + Filename string `json:"file_name"` + ExpiresAt string `json:"expires_at"` + Type string `json:"type"` + VisibilityLevel int64 `json:"visibility_level"` + Description string `json:"description"` + Secret bool `json:"secret"` + RepositoryReadOnly bool `json:"repository_read_only"` } // SubGroupEvent represents a subgroup event. @@ -1161,8 +1242,8 @@ type SubGroupEvent struct { Name string `json:"name"` Path string `json:"path"` FullPath string `json:"full_path"` - GroupID int `json:"group_id"` - ParentGroupID int `json:"parent_group_id"` + GroupID int64 `json:"group_id"` + ParentGroupID int64 `json:"parent_group_id"` ParentName string `json:"parent_name"` ParentPath string `json:"parent_path"` ParentFullPath string `json:"parent_full_path"` @@ -1173,52 +1254,53 @@ type SubGroupEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#tag-events type TagEvent struct { - ObjectKind string `json:"object_kind"` - EventName string `json:"event_name"` - Before string `json:"before"` - After string `json:"after"` - Ref string `json:"ref"` - CheckoutSHA string `json:"checkout_sha"` - UserID int `json:"user_id"` - UserName string `json:"user_name"` - UserUsername string `json:"user_username"` - UserAvatar string `json:"user_avatar"` - UserEmail string `json:"user_email"` - ProjectID int `json:"project_id"` - Message string `json:"message"` - Project struct { - ID int `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - WebURL string `json:"web_url"` - Visibility VisibilityValue `json:"visibility"` - } `json:"project"` - Repository *Repository `json:"repository"` - Commits []*struct { - ID string `json:"id"` - Message string `json:"message"` - Title string `json:"title"` - Timestamp *time.Time `json:"timestamp"` - URL string `json:"url"` - Author struct { - Name string `json:"name"` - Email string `json:"email"` - } `json:"author"` - Added []string `json:"added"` - Modified []string `json:"modified"` - Removed []string `json:"removed"` - } `json:"commits"` - TotalCommitsCount int `json:"total_commits_count"` + ObjectKind string `json:"object_kind"` + EventName string `json:"event_name"` + Before string `json:"before"` + After string `json:"after"` + Ref string `json:"ref"` + CheckoutSHA string `json:"checkout_sha"` + UserID int64 `json:"user_id"` + UserName string `json:"user_name"` + UserUsername string `json:"user_username"` + UserAvatar string `json:"user_avatar"` + UserEmail string `json:"user_email"` + ProjectID int64 `json:"project_id"` + Message string `json:"message"` + Project TagEventProject `json:"project"` + Repository *Repository `json:"repository"` + Commits []*TagEventCommit `json:"commits"` + TotalCommitsCount int64 `json:"total_commits_count"` +} + +type TagEventProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + Visibility VisibilityValue `json:"visibility"` +} + +type TagEventCommit struct { + ID string `json:"id"` + Message string `json:"message"` + Title string `json:"title"` + Timestamp *time.Time `json:"timestamp"` + URL string `json:"url"` + Author EventCommitAuthor `json:"author"` + Added []string `json:"added"` + Modified []string `json:"modified"` + Removed []string `json:"removed"` } // WikiPageEvent represents a wiki page event. @@ -1226,41 +1308,47 @@ type TagEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#wiki-page-events type WikiPageEvent struct { - ObjectKind string `json:"object_kind"` - User *EventUser `json:"user"` - Project struct { - Name string `json:"name"` - Description string `json:"description"` - AvatarURL string `json:"avatar_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - Namespace string `json:"namespace"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - Homepage string `json:"homepage"` - URL string `json:"url"` - SSHURL string `json:"ssh_url"` - HTTPURL string `json:"http_url"` - WebURL string `json:"web_url"` - Visibility VisibilityValue `json:"visibility"` - } `json:"project"` - Wiki struct { - WebURL string `json:"web_url"` - GitSSHURL string `json:"git_ssh_url"` - GitHTTPURL string `json:"git_http_url"` - PathWithNamespace string `json:"path_with_namespace"` - DefaultBranch string `json:"default_branch"` - } `json:"wiki"` - ObjectAttributes struct { - Title string `json:"title"` - Content string `json:"content"` - Format string `json:"format"` - Message string `json:"message"` - Slug string `json:"slug"` - URL string `json:"url"` - Action string `json:"action"` - DiffURL string `json:"diff_url"` - } `json:"object_attributes"` + ObjectKind string `json:"object_kind"` + User *EventUser `json:"user"` + Project WikiPageEventProject `json:"project"` + Wiki WikiPageEventWiki `json:"wiki"` + ObjectAttributes WikiPageEventObjectAttributes `json:"object_attributes"` +} + +type WikiPageEventProject struct { + Name string `json:"name"` + Description string `json:"description"` + AvatarURL string `json:"avatar_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` + Homepage string `json:"homepage"` + URL string `json:"url"` + SSHURL string `json:"ssh_url"` + HTTPURL string `json:"http_url"` + WebURL string `json:"web_url"` + Visibility VisibilityValue `json:"visibility"` +} + +type WikiPageEventWiki struct { + WebURL string `json:"web_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + PathWithNamespace string `json:"path_with_namespace"` + DefaultBranch string `json:"default_branch"` +} + +type WikiPageEventObjectAttributes struct { + Title string `json:"title"` + Content string `json:"content"` + Format string `json:"format"` + Message string `json:"message"` + Slug string `json:"slug"` + URL string `json:"url"` + Action string `json:"action"` + DiffURL string `json:"diff_url"` } // EventLabel represents a label inside a webhook event. @@ -1268,14 +1356,14 @@ type WikiPageEvent struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#work-item-events type EventLabel struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` Color string `json:"color"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Template bool `json:"template"` Description string `json:"description"` Type string `json:"type"` - GroupID int `json:"group_id"` + GroupID int64 `json:"group_id"` } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/events.go b/vendor/gitlab.com/gitlab-org/api/client-go/events.go index 366a8c35f..1ed6043e9 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/events.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/events.go @@ -53,35 +53,34 @@ var _ EventsServiceInterface = (*EventsService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/events/#get-user-contribution-events type ContributionEvent struct { - ID int `json:"id"` - Title string `json:"title"` - ProjectID int `json:"project_id"` - ActionName string `json:"action_name"` - TargetID int `json:"target_id"` - TargetIID int `json:"target_iid"` - TargetType string `json:"target_type"` - AuthorID int `json:"author_id"` - TargetTitle string `json:"target_title"` - CreatedAt *time.Time `json:"created_at"` - PushData struct { - CommitCount int `json:"commit_count"` - Action string `json:"action"` - RefType string `json:"ref_type"` - CommitFrom string `json:"commit_from"` - CommitTo string `json:"commit_to"` - Ref string `json:"ref"` - CommitTitle string `json:"commit_title"` - } `json:"push_data"` - Note *Note `json:"note"` - Author struct { - Name string `json:"name"` - Username string `json:"username"` - ID int `json:"id"` - State string `json:"state"` - AvatarURL string `json:"avatar_url"` - WebURL string `json:"web_url"` - } `json:"author"` - AuthorUsername string `json:"author_username"` + ID int64 `json:"id"` + Title string `json:"title"` + ProjectID int64 `json:"project_id"` + ActionName string `json:"action_name"` + TargetID int64 `json:"target_id"` + TargetIID int64 `json:"target_iid"` + TargetType string `json:"target_type"` + AuthorID int64 `json:"author_id"` + TargetTitle string `json:"target_title"` + CreatedAt *time.Time `json:"created_at"` + PushData ContributionEventPushData `json:"push_data"` + Note *Note `json:"note"` + Author BasicUser `json:"author"` + AuthorUsername string `json:"author_username"` +} + +// ContributionEventPushData represents a user's contribution push data. +// +// GitLab API docs: +// https://docs.gitlab.com/api/events/#get-user-contribution-events +type ContributionEventPushData struct { + CommitCount int64 `json:"commit_count"` + Action string `json:"action"` + RefType string `json:"ref_type"` + CommitFrom string `json:"commit_from"` + CommitTo string `json:"commit_to"` + Ref string `json:"ref"` + CommitTitle string `json:"commit_title"` } // ListContributionEventsOptions represents the options for GetUserContributionEvents @@ -123,69 +122,102 @@ func (s *EventsService) ListCurrentUserContributionEvents(opt *ListContributionE // GitLab API docs: // https://docs.gitlab.com/api/events/#list-a-projects-visible-events type ProjectEvent struct { - ID int `json:"id"` - Title string `json:"title"` - ProjectID int `json:"project_id"` - ActionName string `json:"action_name"` - TargetID int `json:"target_id"` - TargetIID int `json:"target_iid"` - TargetType string `json:"target_type"` - AuthorID int `json:"author_id"` - TargetTitle string `json:"target_title"` - CreatedAt string `json:"created_at"` - Author struct { - Name string `json:"name"` - Username string `json:"username"` - ID int `json:"id"` - State string `json:"state"` - AvatarURL string `json:"avatar_url"` - WebURL string `json:"web_url"` - } `json:"author"` - AuthorUsername string `json:"author_username"` - Data struct { - Before string `json:"before"` - After string `json:"after"` - Ref string `json:"ref"` - UserID int `json:"user_id"` - UserName string `json:"user_name"` - Repository *Repository `json:"repository"` - Commits []*Commit `json:"commits"` - TotalCommitsCount int `json:"total_commits_count"` - } `json:"data"` - Note struct { - ID int `json:"id"` - Body string `json:"body"` - Attachment string `json:"attachment"` - Author struct { - ID int `json:"id"` - Username string `json:"username"` - Email string `json:"email"` - Name string `json:"name"` - State string `json:"state"` - AvatarURL string `json:"avatar_url"` - WebURL string `json:"web_url"` - } `json:"author"` - CreatedAt *time.Time `json:"created_at"` - System bool `json:"system"` - NoteableID int `json:"noteable_id"` - NoteableType string `json:"noteable_type"` - NoteableIID int `json:"noteable_iid"` - } `json:"note"` - PushData struct { - CommitCount int `json:"commit_count"` - Action string `json:"action"` - RefType string `json:"ref_type"` - CommitFrom string `json:"commit_from"` - CommitTo string `json:"commit_to"` - Ref string `json:"ref"` - CommitTitle string `json:"commit_title"` - } `json:"push_data"` + ID int64 `json:"id"` + Title string `json:"title"` + ProjectID int64 `json:"project_id"` + ActionName string `json:"action_name"` + TargetID int64 `json:"target_id"` + TargetIID int64 `json:"target_iid"` + TargetType string `json:"target_type"` + AuthorID int64 `json:"author_id"` + TargetTitle string `json:"target_title"` + CreatedAt string `json:"created_at"` + Author BasicUser `json:"author"` + AuthorUsername string `json:"author_username"` + Data ProjectEventData `json:"data"` + Note ProjectEventNote `json:"note"` + PushData ProjectEventPushData `json:"push_data"` } func (s ProjectEvent) String() string { return Stringify(s) } +// ProjectEventData represents the GitLab project event data. +// +// GitLab API docs: +// https://docs.gitlab.com/api/events/#list-a-projects-visible-events +type ProjectEventData struct { + Before string `json:"before"` + After string `json:"after"` + Ref string `json:"ref"` + UserID int64 `json:"user_id"` + UserName string `json:"user_name"` + Repository *Repository `json:"repository"` + Commits []*Commit `json:"commits"` + TotalCommitsCount int64 `json:"total_commits_count"` +} + +func (d ProjectEventData) String() string { + return Stringify(d) +} + +// ProjectEventNote represents a GitLab project event note. +// +// GitLab API docs: +// https://docs.gitlab.com/api/events/#list-a-projects-visible-events +type ProjectEventNote struct { + ID int64 `json:"id"` + Body string `json:"body"` + Attachment string `json:"attachment"` + Author ProjectEventNoteAuthor `json:"author"` + CreatedAt *time.Time `json:"created_at"` + System bool `json:"system"` + NoteableID int64 `json:"noteable_id"` + NoteableType string `json:"noteable_type"` + NoteableIID int64 `json:"noteable_iid"` +} + +func (n ProjectEventNote) String() string { + return Stringify(n) +} + +// ProjectEventNoteAuthor represents a GitLab project event note author. +// +// GitLab API docs: +// https://docs.gitlab.com/api/events/#list-a-projects-visible-events +type ProjectEventNoteAuthor struct { + ID int64 `json:"id"` + Username string `json:"username"` + Email string `json:"email"` + Name string `json:"name"` + State string `json:"state"` + AvatarURL string `json:"avatar_url"` + WebURL string `json:"web_url"` +} + +func (a ProjectEventNoteAuthor) String() string { + return Stringify(a) +} + +// ProjectEventPushData represents a GitLab project event push data. +// +// GitLab API docs: +// https://docs.gitlab.com/api/events/#list-a-projects-visible-events +type ProjectEventPushData struct { + CommitCount int64 `json:"commit_count"` + Action string `json:"action"` + RefType string `json:"ref_type"` + CommitFrom string `json:"commit_from"` + CommitTo string `json:"commit_to"` + Ref string `json:"ref"` + CommitTitle string `json:"commit_title"` +} + +func (d ProjectEventPushData) String() string { + return Stringify(d) +} + // ListProjectVisibleEventsOptions represents the available // ListProjectVisibleEvents() options. // diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/external_status_checks.go b/vendor/gitlab.com/gitlab-org/api/client-go/external_status_checks.go index 0678a4878..7bfbcf05a 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/external_status_checks.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/external_status_checks.go @@ -21,14 +21,14 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#delete-external-status-check-service - DeleteExternalStatusCheck(pid any, check int, options ...RequestOptionFunc) (*Response, error) + DeleteExternalStatusCheck(pid any, check int64, options ...RequestOptionFunc) (*Response, error) // UpdateExternalStatusCheck updates an external status check. // Deprecated: to be removed in 1.0; use UpdateProjectExternalStatusCheck instead // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#update-external-status-check-service - UpdateExternalStatusCheck(pid any, check int, opt *UpdateExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) + UpdateExternalStatusCheck(pid any, check int64, opt *UpdateExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) // ListMergeStatusChecks lists the external status checks that apply to it // and their status for a single merge request. @@ -36,7 +36,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#list-status-checks-for-a-merge-request - ListMergeStatusChecks(pid any, mr int, opt *ListOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) + ListMergeStatusChecks(pid any, mr int64, opt *ListOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) // ListProjectStatusChecks lists the project external status checks. // Deprecated: to be removed in 1.0; use ListProjectExternalStatusChecks instead @@ -50,21 +50,21 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#retry-failed-status-check-for-a-merge-request - RetryFailedStatusCheckForAMergeRequest(pid any, mergeRequest int, externalStatusCheck int, options ...RequestOptionFunc) (*Response, error) + RetryFailedStatusCheckForAMergeRequest(pid any, mergeRequest int64, externalStatusCheck int64, options ...RequestOptionFunc) (*Response, error) // SetExternalStatusCheckStatus sets the status of an external status check. // Deprecated: to be removed in 1.0; use SetProjectMergeRequestExternalStatusCheckStatus instead // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#set-status-of-an-external-status-check - SetExternalStatusCheckStatus(pid any, mergeRequest int, opt *SetExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) + SetExternalStatusCheckStatus(pid any, mergeRequest int64, opt *SetExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) // ListProjectMergeRequestExternalStatusChecks lists the external status checks that apply to it // and their status for a single merge request. // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#list-status-checks-for-a-merge-request - ListProjectMergeRequestExternalStatusChecks(pid any, mr int, opt *ListProjectMergeRequestExternalStatusChecksOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) + ListProjectMergeRequestExternalStatusChecks(pid any, mr int64, opt *ListProjectMergeRequestExternalStatusChecksOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) // ListProjectExternalStatusChecks lists the project external status checks. // @@ -76,7 +76,7 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#retry-failed-status-check-for-a-merge-request - RetryFailedExternalStatusCheckForProjectMergeRequest(pid any, mergeRequest int, externalStatusCheck int, opt *RetryFailedExternalStatusCheckForProjectMergeRequestOptions, options ...RequestOptionFunc) (*Response, error) + RetryFailedExternalStatusCheckForProjectMergeRequest(pid any, mergeRequest int64, externalStatusCheck int64, opt *RetryFailedExternalStatusCheckForProjectMergeRequestOptions, options ...RequestOptionFunc) (*Response, error) // CreateProjectExternalStatusCheck creates an external status check. // @@ -88,19 +88,19 @@ type ( // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#update-external-status-check-service - UpdateProjectExternalStatusCheck(pid any, check int, opt *UpdateProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*ProjectStatusCheck, *Response, error) + UpdateProjectExternalStatusCheck(pid any, check int64, opt *UpdateProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*ProjectStatusCheck, *Response, error) // DeleteProjectExternalStatusCheck deletes an external status check. // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#delete-external-status-check-service - DeleteProjectExternalStatusCheck(pid any, check int, opt *DeleteProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) + DeleteProjectExternalStatusCheck(pid any, check int64, opt *DeleteProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) // SetProjectMergeRequestExternalStatusCheckStatus sets the status of an external status check. // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#set-status-of-an-external-status-check - SetProjectMergeRequestExternalStatusCheckStatus(pid any, mergeRequest int, opt *SetProjectMergeRequestExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) + SetProjectMergeRequestExternalStatusCheckStatus(pid any, mergeRequest int64, opt *SetProjectMergeRequestExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) } // ExternalStatusChecksService handles communication with the external @@ -115,31 +115,37 @@ type ( var _ ExternalStatusChecksServiceInterface = (*ExternalStatusChecksService)(nil) type MergeStatusCheck struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` ExternalURL string `json:"external_url"` Status string `json:"status"` } type ProjectStatusCheck struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` ExternalURL string `json:"external_url"` HMAC bool `json:"hmac"` ProtectedBranches []StatusCheckProtectedBranch `json:"protected_branches"` } type StatusCheckProtectedBranch struct { - ID int `json:"id"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + ProjectID int64 `json:"project_id"` Name string `json:"name"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` CodeOwnerApprovalRequired bool `json:"code_owner_approval_required"` } -func (s *ExternalStatusChecksService) ListMergeStatusChecks(pid any, mr int, opt *ListOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) { +// ListMergeStatusChecks lists the external status checks that apply to it +// and their status for a single merge request. +// Deprecated: to be removed in 1.0; use ListProjectMergeRequestExternalStatusChecks instead +// +// GitLab API docs: +// https://docs.gitlab.com/api/status_checks/#list-status-checks-for-a-merge-request +func (s *ExternalStatusChecksService) ListMergeStatusChecks(pid any, mr int64, opt *ListOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -168,11 +174,16 @@ func (s *ExternalStatusChecksService) ListMergeStatusChecks(pid any, mr int, opt // https://docs.gitlab.com/api/status_checks/#set-status-of-an-external-status-check type SetExternalStatusCheckStatusOptions struct { SHA *string `url:"sha,omitempty" json:"sha,omitempty"` - ExternalStatusCheckID *int `url:"external_status_check_id,omitempty" json:"external_status_check_id,omitempty"` + ExternalStatusCheckID *int64 `url:"external_status_check_id,omitempty" json:"external_status_check_id,omitempty"` Status *string `url:"status,omitempty" json:"status,omitempty"` } -func (s *ExternalStatusChecksService) SetExternalStatusCheckStatus(pid any, mergeRequest int, opt *SetExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) { +// SetExternalStatusCheckStatus sets the status of an external status check. +// Deprecated: to be removed in 1.0; use SetProjectMergeRequestExternalStatusCheckStatus instead +// +// Gitlab API docs: +// https://docs.gitlab.com/api/status_checks/#set-status-of-an-external-status-check +func (s *ExternalStatusChecksService) SetExternalStatusCheckStatus(pid any, mergeRequest int64, opt *SetExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -215,9 +226,9 @@ func (s *ExternalStatusChecksService) ListProjectStatusChecks(pid any, opt *List // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#create-external-status-check-service type CreateExternalStatusCheckOptions struct { - Name *string `url:"name,omitempty" json:"name,omitempty"` - ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"` - ProtectedBranchIDs *[]int `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` + Name *string `url:"name,omitempty" json:"name,omitempty"` + ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"` + ProtectedBranchIDs *[]int64 `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` } func (s *ExternalStatusChecksService) CreateExternalStatusCheck(pid any, opt *CreateExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) { @@ -235,7 +246,12 @@ func (s *ExternalStatusChecksService) CreateExternalStatusCheck(pid any, opt *Cr return s.client.Do(req, nil) } -func (s *ExternalStatusChecksService) DeleteExternalStatusCheck(pid any, check int, options ...RequestOptionFunc) (*Response, error) { +// DeleteExternalStatusCheck deletes an external status check. +// Deprecated: to be removed in 1.0; use DeleteProjectExternalStatusCheck instead +// +// Gitlab API docs: +// https://docs.gitlab.com/api/status_checks/#delete-external-status-check-service +func (s *ExternalStatusChecksService) DeleteExternalStatusCheck(pid any, check int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -257,12 +273,17 @@ func (s *ExternalStatusChecksService) DeleteExternalStatusCheck(pid any, check i // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#update-external-status-check-service type UpdateExternalStatusCheckOptions struct { - Name *string `url:"name,omitempty" json:"name,omitempty"` - ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"` - ProtectedBranchIDs *[]int `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` + Name *string `url:"name,omitempty" json:"name,omitempty"` + ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"` + ProtectedBranchIDs *[]int64 `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` } -func (s *ExternalStatusChecksService) UpdateExternalStatusCheck(pid any, check int, opt *UpdateExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) { +// UpdateExternalStatusCheck updates an external status check. +// Deprecated: to be removed in 1.0; use UpdateProjectExternalStatusCheck instead +// +// Gitlab API docs: +// https://docs.gitlab.com/api/status_checks/#update-external-status-check-service +func (s *ExternalStatusChecksService) UpdateExternalStatusCheck(pid any, check int64, opt *UpdateExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -277,7 +298,12 @@ func (s *ExternalStatusChecksService) UpdateExternalStatusCheck(pid any, check i return s.client.Do(req, nil) } -func (s *ExternalStatusChecksService) RetryFailedStatusCheckForAMergeRequest(pid any, mergeRequest int, externalStatusCheck int, options ...RequestOptionFunc) (*Response, error) { +// RetryFailedStatusCheckForAMergeRequest retries the specified failed external status check. +// Deprecated: to be removed in 1.0; use RetryFailedExternalStatusCheckForProjectMergeRequest instead +// +// Gitlab API docs: +// https://docs.gitlab.com/api/status_checks/#retry-failed-status-check-for-a-merge-request +func (s *ExternalStatusChecksService) RetryFailedStatusCheckForAMergeRequest(pid any, mergeRequest int64, externalStatusCheck int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -301,7 +327,12 @@ type ListProjectMergeRequestExternalStatusChecksOptions struct { ListOptions } -func (s *ExternalStatusChecksService) ListProjectMergeRequestExternalStatusChecks(pid any, mr int, opt *ListProjectMergeRequestExternalStatusChecksOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) { +// ListProjectMergeRequestExternalStatusChecks lists the external status checks that apply to it +// and their status for a single merge request. +// +// GitLab API docs: +// https://docs.gitlab.com/api/status_checks/#list-status-checks-for-a-merge-request +func (s *ExternalStatusChecksService) ListProjectMergeRequestExternalStatusChecks(pid any, mr int64, opt *ListProjectMergeRequestExternalStatusChecksOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -358,10 +389,10 @@ func (s *ExternalStatusChecksService) ListProjectExternalStatusChecks(pid any, o // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#create-external-status-check-service type CreateProjectExternalStatusCheckOptions struct { - Name *string `url:"name,omitempty" json:"name,omitempty"` - ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"` - SharedSecret *string `url:"shared_secret,omitempty" json:"shared_secret,omitempty"` - ProtectedBranchIDs *[]int `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` + Name *string `url:"name,omitempty" json:"name,omitempty"` + ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"` + SharedSecret *string `url:"shared_secret,omitempty" json:"shared_secret,omitempty"` + ProtectedBranchIDs *[]int64 `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` } func (s *ExternalStatusChecksService) CreateProjectExternalStatusCheck(pid any, opt *CreateProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*ProjectStatusCheck, *Response, error) { @@ -392,7 +423,11 @@ func (s *ExternalStatusChecksService) CreateProjectExternalStatusCheck(pid any, // https://docs.gitlab.com/api/status_checks/#delete-external-status-check-service type DeleteProjectExternalStatusCheckOptions struct{} -func (s *ExternalStatusChecksService) DeleteProjectExternalStatusCheck(pid any, check int, opt *DeleteProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) { +// DeleteProjectExternalStatusCheck deletes an external status check. +// +// Gitlab API docs: +// https://docs.gitlab.com/api/status_checks/#delete-external-status-check-service +func (s *ExternalStatusChecksService) DeleteProjectExternalStatusCheck(pid any, check int64, opt *DeleteProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -413,13 +448,17 @@ func (s *ExternalStatusChecksService) DeleteProjectExternalStatusCheck(pid any, // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#update-external-status-check-service type UpdateProjectExternalStatusCheckOptions struct { - Name *string `url:"name,omitempty" json:"name,omitempty"` - ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"` - SharedSecret *string `url:"shared_secret,omitempty" json:"shared_secret,omitempty"` - ProtectedBranchIDs *[]int `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` + Name *string `url:"name,omitempty" json:"name,omitempty"` + ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"` + SharedSecret *string `url:"shared_secret,omitempty" json:"shared_secret,omitempty"` + ProtectedBranchIDs *[]int64 `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` } -func (s *ExternalStatusChecksService) UpdateProjectExternalStatusCheck(pid any, check int, opt *UpdateProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*ProjectStatusCheck, *Response, error) { +// UpdateProjectExternalStatusCheck updates an external status check. +// +// Gitlab API docs: +// https://docs.gitlab.com/api/status_checks/#update-external-status-check-service +func (s *ExternalStatusChecksService) UpdateProjectExternalStatusCheck(pid any, check int64, opt *UpdateProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*ProjectStatusCheck, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -447,7 +486,11 @@ func (s *ExternalStatusChecksService) UpdateProjectExternalStatusCheck(pid any, // https://docs.gitlab.com/api/status_checks/#retry-failed-status-check-for-a-merge-request type RetryFailedExternalStatusCheckForProjectMergeRequestOptions struct{} -func (s *ExternalStatusChecksService) RetryFailedExternalStatusCheckForProjectMergeRequest(pid any, mergeRequest int, externalStatusCheck int, opt *RetryFailedExternalStatusCheckForProjectMergeRequestOptions, options ...RequestOptionFunc) (*Response, error) { +// RetryFailedExternalStatusCheckForProjectMergeRequest retries the specified failed external status check. +// +// Gitlab API docs: +// https://docs.gitlab.com/api/status_checks/#retry-failed-status-check-for-a-merge-request +func (s *ExternalStatusChecksService) RetryFailedExternalStatusCheckForProjectMergeRequest(pid any, mergeRequest int64, externalStatusCheck int64, opt *RetryFailedExternalStatusCheckForProjectMergeRequestOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -469,11 +512,15 @@ func (s *ExternalStatusChecksService) RetryFailedExternalStatusCheckForProjectMe // https://docs.gitlab.com/api/status_checks/#set-status-of-an-external-status-check type SetProjectMergeRequestExternalStatusCheckStatusOptions struct { SHA *string `url:"sha,omitempty" json:"sha,omitempty"` - ExternalStatusCheckID *int `url:"external_status_check_id,omitempty" json:"external_status_check_id,omitempty"` + ExternalStatusCheckID *int64 `url:"external_status_check_id,omitempty" json:"external_status_check_id,omitempty"` Status *string `url:"status,omitempty" json:"status,omitempty"` } -func (s *ExternalStatusChecksService) SetProjectMergeRequestExternalStatusCheckStatus(pid any, mergeRequest int, opt *SetProjectMergeRequestExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) { +// SetProjectMergeRequestExternalStatusCheckStatus sets the status of an external status check. +// +// Gitlab API docs: +// https://docs.gitlab.com/api/status_checks/#set-status-of-an-external-status-check +func (s *ExternalStatusChecksService) SetProjectMergeRequestExternalStatusCheckStatus(pid any, mergeRequest int64, opt *SetProjectMergeRequestExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/feature_flag_user_lists.go b/vendor/gitlab.com/gitlab-org/api/client-go/feature_flag_user_lists.go index 74722b055..e0445460f 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/feature_flag_user_lists.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/feature_flag_user_lists.go @@ -23,9 +23,9 @@ type ( FeatureFlagUserListsServiceInterface interface { ListFeatureFlagUserLists(pid any, opt *ListFeatureFlagUserListsOptions, options ...RequestOptionFunc) ([]*FeatureFlagUserList, *Response, error) CreateFeatureFlagUserList(pid any, opt *CreateFeatureFlagUserListOptions, options ...RequestOptionFunc) (*FeatureFlagUserList, *Response, error) - GetFeatureFlagUserList(pid any, iid int, options ...RequestOptionFunc) (*FeatureFlagUserList, *Response, error) - UpdateFeatureFlagUserList(pid any, iid int, opt *UpdateFeatureFlagUserListOptions, options ...RequestOptionFunc) (*FeatureFlagUserList, *Response, error) - DeleteFeatureFlagUserList(pid any, iid int, options ...RequestOptionFunc) (*Response, error) + GetFeatureFlagUserList(pid any, iid int64, options ...RequestOptionFunc) (*FeatureFlagUserList, *Response, error) + UpdateFeatureFlagUserList(pid any, iid int64, opt *UpdateFeatureFlagUserListOptions, options ...RequestOptionFunc) (*FeatureFlagUserList, *Response, error) + DeleteFeatureFlagUserList(pid any, iid int64, options ...RequestOptionFunc) (*Response, error) } // FeatureFlagUserListsService handles communication with the feature flag @@ -45,9 +45,9 @@ var _ FeatureFlagUserListsServiceInterface = (*FeatureFlagUserListsService)(nil) type FeatureFlagUserList struct { Name string `url:"name" json:"name"` UserXIDs string `url:"user_xids" json:"user_xids"` - ID int `url:"id" json:"id"` - IID int `url:"iid" json:"iid"` - ProjectID int `url:"project_id" json:"project_id"` + ID int64 `url:"id" json:"id"` + IID int64 `url:"iid" json:"iid"` + ProjectID int64 `url:"project_id" json:"project_id"` CreatedAt *time.Time `url:"created_at" json:"created_at"` UpdatedAt *time.Time `url:"updated_at" json:"updated_at"` } @@ -102,7 +102,7 @@ func (s *FeatureFlagUserListsService) CreateFeatureFlagUserList(pid any, opt *Cr // // GitLab API docs: // https://docs.gitlab.com/api/feature_flag_user_lists/#get-a-feature-flag-user-list -func (s *FeatureFlagUserListsService) GetFeatureFlagUserList(pid any, iid int, options ...RequestOptionFunc) (*FeatureFlagUserList, *Response, error) { +func (s *FeatureFlagUserListsService) GetFeatureFlagUserList(pid any, iid int64, options ...RequestOptionFunc) (*FeatureFlagUserList, *Response, error) { return do[*FeatureFlagUserList](s.client, withPath("projects/%s/feature_flags_user_lists/%d", ProjectID{pid}, iid), withRequestOpts(options...), @@ -123,7 +123,7 @@ type UpdateFeatureFlagUserListOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/feature_flag_user_lists/#update-a-feature-flag-user-list -func (s *FeatureFlagUserListsService) UpdateFeatureFlagUserList(pid any, iid int, opt *UpdateFeatureFlagUserListOptions, options ...RequestOptionFunc) (*FeatureFlagUserList, *Response, error) { +func (s *FeatureFlagUserListsService) UpdateFeatureFlagUserList(pid any, iid int64, opt *UpdateFeatureFlagUserListOptions, options ...RequestOptionFunc) (*FeatureFlagUserList, *Response, error) { return do[*FeatureFlagUserList](s.client, withMethod(http.MethodPut), withPath("projects/%s/feature_flags_user_lists/%d", ProjectID{pid}, iid), @@ -136,7 +136,7 @@ func (s *FeatureFlagUserListsService) UpdateFeatureFlagUserList(pid any, iid int // // GitLab API docs: // https://docs.gitlab.com/api/feature_flag_user_lists/#delete-feature-flag-user-list -func (s *FeatureFlagUserListsService) DeleteFeatureFlagUserList(pid any, iid int, options ...RequestOptionFunc) (*Response, error) { +func (s *FeatureFlagUserListsService) DeleteFeatureFlagUserList(pid any, iid int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/feature_flags_user_lists/%d", ProjectID{pid}, iid), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/freeze_periods.go b/vendor/gitlab.com/gitlab-org/api/client-go/freeze_periods.go index 8662ac4df..ef12aca2b 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/freeze_periods.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/freeze_periods.go @@ -30,10 +30,10 @@ type ( // FreezePeriodsServiceInterface defines all the API methods for the FreezePeriodsService FreezePeriodsServiceInterface interface { ListFreezePeriods(pid any, opt *ListFreezePeriodsOptions, options ...RequestOptionFunc) ([]*FreezePeriod, *Response, error) - GetFreezePeriod(pid any, freezePeriod int, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) + GetFreezePeriod(pid any, freezePeriod int64, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) CreateFreezePeriodOptions(pid any, opt *CreateFreezePeriodOptions, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) - UpdateFreezePeriodOptions(pid any, freezePeriod int, opt *UpdateFreezePeriodOptions, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) - DeleteFreezePeriod(pid any, freezePeriod int, options ...RequestOptionFunc) (*Response, error) + UpdateFreezePeriodOptions(pid any, freezePeriod int64, opt *UpdateFreezePeriodOptions, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) + DeleteFreezePeriod(pid any, freezePeriod int64, options ...RequestOptionFunc) (*Response, error) } // FreezePeriodsService handles the communication with the freeze periods @@ -52,7 +52,7 @@ var _ FreezePeriodsServiceInterface = (*FreezePeriodsService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/freeze_periods/#list-freeze-periods type FreezePeriod struct { - ID int `json:"id"` + ID int64 `json:"id"` FreezeStart string `json:"freeze_start"` FreezeEnd string `json:"freeze_end"` CronTimezone string `json:"cron_timezone"` @@ -65,7 +65,9 @@ type FreezePeriod struct { // // GitLab API docs: // https://docs.gitlab.com/api/freeze_periods/#list-freeze-periods -type ListFreezePeriodsOptions ListOptions +type ListFreezePeriodsOptions struct { + ListOptions +} // ListFreezePeriods gets a list of project freeze periods. // @@ -96,7 +98,7 @@ func (s *FreezePeriodsService) ListFreezePeriods(pid any, opt *ListFreezePeriods // // GitLab API docs: // https://docs.gitlab.com/api/freeze_periods/#get-a-freeze-period-by-a-freeze_period_id -func (s *FreezePeriodsService) GetFreezePeriod(pid any, freezePeriod int, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) { +func (s *FreezePeriodsService) GetFreezePeriod(pid any, freezePeriod int64, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -168,7 +170,7 @@ type UpdateFreezePeriodOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/freeze_periods/#update-a-freeze-period -func (s *FreezePeriodsService) UpdateFreezePeriodOptions(pid any, freezePeriod int, opt *UpdateFreezePeriodOptions, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) { +func (s *FreezePeriodsService) UpdateFreezePeriodOptions(pid any, freezePeriod int64, opt *UpdateFreezePeriodOptions, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -195,7 +197,7 @@ func (s *FreezePeriodsService) UpdateFreezePeriodOptions(pid any, freezePeriod i // // GitLab API docs: // https://docs.gitlab.com/api/freeze_periods/#delete-a-freeze-period -func (s *FreezePeriodsService) DeleteFreezePeriod(pid any, freezePeriod int, options ...RequestOptionFunc) (*Response, error) { +func (s *FreezePeriodsService) DeleteFreezePeriod(pid any, freezePeriod int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/generic_packages.go b/vendor/gitlab.com/gitlab-org/api/client-go/generic_packages.go index e80fb5bbd..aa64403f6 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/generic_packages.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/generic_packages.go @@ -49,27 +49,33 @@ var _ GenericPackagesServiceInterface = (*GenericPackagesService)(nil) // GitLab API docs: // https://docs.gitlab.com/user/packages/generic_packages/#publish-a-single-file type GenericPackagesFile struct { - ID int `json:"id"` - PackageID int `json:"package_id"` - CreatedAt *time.Time `json:"created_at"` - UpdatedAt *time.Time `json:"updated_at"` - Size int `json:"size"` - FileStore int `json:"file_store"` - FileMD5 string `json:"file_md5"` - FileSHA1 string `json:"file_sha1"` - FileName string `json:"file_name"` - File struct { - URL string `json:"url"` - } `json:"file"` - FileSHA256 string `json:"file_sha256"` - VerificationRetryAt *time.Time `json:"verification_retry_at"` - VerifiedAt *time.Time `json:"verified_at"` - VerificationFailure bool `json:"verification_failure"` - VerificationRetryCount int `json:"verification_retry_count"` - VerificationChecksum string `json:"verification_checksum"` - VerificationState int `json:"verification_state"` - VerificationStartedAt *time.Time `json:"verification_started_at"` - NewFilePath string `json:"new_file_path"` + ID int64 `json:"id"` + PackageID int64 `json:"package_id"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` + Size int64 `json:"size"` + FileStore int64 `json:"file_store"` + FileMD5 string `json:"file_md5"` + FileSHA1 string `json:"file_sha1"` + FileName string `json:"file_name"` + File GenericPackagesFileURL `json:"file"` + FileSHA256 string `json:"file_sha256"` + VerificationRetryAt *time.Time `json:"verification_retry_at"` + VerifiedAt *time.Time `json:"verified_at"` + VerificationFailure bool `json:"verification_failure"` + VerificationRetryCount int64 `json:"verification_retry_count"` + VerificationChecksum string `json:"verification_checksum"` + VerificationState int64 `json:"verification_state"` + VerificationStartedAt *time.Time `json:"verification_started_at"` + NewFilePath string `json:"new_file_path"` +} + +// GenericPackagesFileURL represents a GitLab generic package file URL. +// +// GitLab API docs: +// https://docs.gitlab.com/user/packages/generic_packages/#publish-a-single-file +type GenericPackagesFileURL struct { + URL string `json:"url"` } // FormatPackageURL returns the GitLab Package Registry URL for the given artifact metadata, without the BaseURL. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/geo_nodes.go b/vendor/gitlab.com/gitlab-org/api/client-go/geo_nodes.go index 124cc8312..720731a95 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/geo_nodes.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/geo_nodes.go @@ -29,17 +29,17 @@ type ( // Deprecated: will be removed in v5 of the API, use Geo Sites API instead ListGeoNodes(*ListGeoNodesOptions, ...RequestOptionFunc) ([]*GeoNode, *Response, error) // Deprecated: will be removed in v5 of the API, use Geo Sites API instead - GetGeoNode(int, ...RequestOptionFunc) (*GeoNode, *Response, error) + GetGeoNode(int64, ...RequestOptionFunc) (*GeoNode, *Response, error) // Deprecated: will be removed in v5 of the API, use Geo Sites API instead - EditGeoNode(int, *UpdateGeoNodesOptions, ...RequestOptionFunc) (*GeoNode, *Response, error) + EditGeoNode(int64, *UpdateGeoNodesOptions, ...RequestOptionFunc) (*GeoNode, *Response, error) // Deprecated: will be removed in v5 of the API, use Geo Sites API instead - DeleteGeoNode(int, ...RequestOptionFunc) (*Response, error) + DeleteGeoNode(int64, ...RequestOptionFunc) (*Response, error) // Deprecated: will be removed in v5 of the API, use Geo Sites API instead - RepairGeoNode(int, ...RequestOptionFunc) (*GeoNode, *Response, error) + RepairGeoNode(int64, ...RequestOptionFunc) (*GeoNode, *Response, error) // Deprecated: will be removed in v5 of the API, use Geo Sites API instead RetrieveStatusOfAllGeoNodes(...RequestOptionFunc) ([]*GeoNodeStatus, *Response, error) // Deprecated: will be removed in v5 of the API, use Geo Sites API instead - RetrieveStatusOfGeoNode(int, ...RequestOptionFunc) (*GeoNodeStatus, *Response, error) + RetrieveStatusOfGeoNode(int64, ...RequestOptionFunc) (*GeoNodeStatus, *Response, error) } // GeoNodesService handles communication with Geo Nodes related methods @@ -60,21 +60,21 @@ var _ GeoNodesServiceInterface = (*GeoNodesService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/geo_nodes/ type GeoNode struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` URL string `json:"url"` InternalURL string `json:"internal_url"` Primary bool `json:"primary"` Enabled bool `json:"enabled"` Current bool `json:"current"` - FilesMaxCapacity int `json:"files_max_capacity"` - ReposMaxCapacity int `json:"repos_max_capacity"` - VerificationMaxCapacity int `json:"verification_max_capacity"` + FilesMaxCapacity int64 `json:"files_max_capacity"` + ReposMaxCapacity int64 `json:"repos_max_capacity"` + VerificationMaxCapacity int64 `json:"verification_max_capacity"` SelectiveSyncType string `json:"selective_sync_type"` SelectiveSyncShards []string `json:"selective_sync_shards"` - SelectiveSyncNamespaceIds []int `json:"selective_sync_namespace_ids"` - MinimumReverificationInterval int `json:"minimum_reverification_interval"` - ContainerRepositoriesMaxCapacity int `json:"container_repositories_max_capacity"` + SelectiveSyncNamespaceIDs []int64 `json:"selective_sync_namespace_ids"` + MinimumReverificationInterval int64 `json:"minimum_reverification_interval"` + ContainerRepositoriesMaxCapacity int64 `json:"container_repositories_max_capacity"` SyncObjectStorage bool `json:"sync_object_storage"` CloneProtocol string `json:"clone_protocol"` WebEditURL string `json:"web_edit_url"` @@ -103,15 +103,15 @@ type CreateGeoNodesOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` URL *string `url:"url,omitempty" json:"url,omitempty"` InternalURL *string `url:"internal_url,omitempty" json:"internal_url,omitempty"` - FilesMaxCapacity *int `url:"files_max_capacity,omitempty" json:"files_max_capacity,omitempty"` - ReposMaxCapacity *int `url:"repos_max_capacity,omitempty" json:"repos_max_capacity,omitempty"` - VerificationMaxCapacity *int `url:"verification_max_capacity,omitempty" json:"verification_max_capacity,omitempty"` - ContainerRepositoriesMaxCapacity *int `url:"container_repositories_max_capacity,omitempty" json:"container_repositories_max_capacity,omitempty"` + FilesMaxCapacity *int64 `url:"files_max_capacity,omitempty" json:"files_max_capacity,omitempty"` + ReposMaxCapacity *int64 `url:"repos_max_capacity,omitempty" json:"repos_max_capacity,omitempty"` + VerificationMaxCapacity *int64 `url:"verification_max_capacity,omitempty" json:"verification_max_capacity,omitempty"` + ContainerRepositoriesMaxCapacity *int64 `url:"container_repositories_max_capacity,omitempty" json:"container_repositories_max_capacity,omitempty"` SyncObjectStorage *bool `url:"sync_object_storage,omitempty" json:"sync_object_storage,omitempty"` SelectiveSyncType *string `url:"selective_sync_type,omitempty" json:"selective_sync_type,omitempty"` SelectiveSyncShards *[]string `url:"selective_sync_shards,omitempty" json:"selective_sync_shards,omitempty"` - SelectiveSyncNamespaceIds *[]int `url:"selective_sync_namespace_ids,omitempty" json:"selective_sync_namespace_ids,omitempty"` - MinimumReverificationInterval *int `url:"minimum_reverification_interval,omitempty" json:"minimum_reverification_interval,omitempty"` + SelectiveSyncNamespaceIDs *[]int64 `url:"selective_sync_namespace_ids,omitempty" json:"selective_sync_namespace_ids,omitempty"` + MinimumReverificationInterval *int64 `url:"minimum_reverification_interval,omitempty" json:"minimum_reverification_interval,omitempty"` } // CreateGeoNode creates a new Geo Node. @@ -139,7 +139,9 @@ func (s *GeoNodesService) CreateGeoNode(opt *CreateGeoNodesOptions, options ...R // // GitLab API docs: // https://docs.gitlab.com/api/geo_nodes/#retrieve-configuration-about-all-geo-nodes -type ListGeoNodesOptions ListOptions +type ListGeoNodesOptions struct { + ListOptions +} // ListGeoNodes gets a list of geo nodes. // Deprecated: will be removed in v5 of the API, use Geo Sites API instead @@ -166,7 +168,7 @@ func (s *GeoNodesService) ListGeoNodes(opt *ListGeoNodesOptions, options ...Requ // // GitLab API docs: // https://docs.gitlab.com/api/geo_nodes/#retrieve-configuration-about-a-specific-geo-node -func (s *GeoNodesService) GetGeoNode(id int, options ...RequestOptionFunc) (*GeoNode, *Response, error) { +func (s *GeoNodesService) GetGeoNode(id int64, options ...RequestOptionFunc) (*GeoNode, *Response, error) { u := fmt.Sprintf("geo_nodes/%d", id) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -189,20 +191,20 @@ func (s *GeoNodesService) GetGeoNode(id int, options ...RequestOptionFunc) (*Geo // GitLab API docs: // https://docs.gitlab.com/api/geo_nodes/#edit-a-geo-node type UpdateGeoNodesOptions struct { - ID *int `url:"primary,omitempty" json:"primary,omitempty"` + ID *int64 `url:"primary,omitempty" json:"primary,omitempty"` Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"` Name *string `url:"name,omitempty" json:"name,omitempty"` URL *string `url:"url,omitempty" json:"url,omitempty"` InternalURL *string `url:"internal_url,omitempty" json:"internal_url,omitempty"` - FilesMaxCapacity *int `url:"files_max_capacity,omitempty" json:"files_max_capacity,omitempty"` - ReposMaxCapacity *int `url:"repos_max_capacity,omitempty" json:"repos_max_capacity,omitempty"` - VerificationMaxCapacity *int `url:"verification_max_capacity,omitempty" json:"verification_max_capacity,omitempty"` - ContainerRepositoriesMaxCapacity *int `url:"container_repositories_max_capacity,omitempty" json:"container_repositories_max_capacity,omitempty"` + FilesMaxCapacity *int64 `url:"files_max_capacity,omitempty" json:"files_max_capacity,omitempty"` + ReposMaxCapacity *int64 `url:"repos_max_capacity,omitempty" json:"repos_max_capacity,omitempty"` + VerificationMaxCapacity *int64 `url:"verification_max_capacity,omitempty" json:"verification_max_capacity,omitempty"` + ContainerRepositoriesMaxCapacity *int64 `url:"container_repositories_max_capacity,omitempty" json:"container_repositories_max_capacity,omitempty"` SyncObjectStorage *bool `url:"sync_object_storage,omitempty" json:"sync_object_storage,omitempty"` SelectiveSyncType *string `url:"selective_sync_type,omitempty" json:"selective_sync_type,omitempty"` SelectiveSyncShards *[]string `url:"selective_sync_shards,omitempty" json:"selective_sync_shards,omitempty"` - SelectiveSyncNamespaceIds *[]int `url:"selective_sync_namespace_ids,omitempty" json:"selective_sync_namespace_ids,omitempty"` - MinimumReverificationInterval *int `url:"minimum_reverification_interval,omitempty" json:"minimum_reverification_interval,omitempty"` + SelectiveSyncNamespaceIDs *[]int64 `url:"selective_sync_namespace_ids,omitempty" json:"selective_sync_namespace_ids,omitempty"` + MinimumReverificationInterval *int64 `url:"minimum_reverification_interval,omitempty" json:"minimum_reverification_interval,omitempty"` } // EditGeoNode updates settings of an existing Geo node. @@ -210,7 +212,7 @@ type UpdateGeoNodesOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/geo_nodes/#edit-a-geo-node -func (s *GeoNodesService) EditGeoNode(id int, opt *UpdateGeoNodesOptions, options ...RequestOptionFunc) (*GeoNode, *Response, error) { +func (s *GeoNodesService) EditGeoNode(id int64, opt *UpdateGeoNodesOptions, options ...RequestOptionFunc) (*GeoNode, *Response, error) { u := fmt.Sprintf("geo_nodes/%d", id) req, err := s.client.NewRequest(http.MethodPut, u, opt, options) @@ -232,7 +234,7 @@ func (s *GeoNodesService) EditGeoNode(id int, opt *UpdateGeoNodesOptions, option // // GitLab API docs: // https://docs.gitlab.com/api/geo_nodes/#delete-a-geo-node -func (s *GeoNodesService) DeleteGeoNode(id int, options ...RequestOptionFunc) (*Response, error) { +func (s *GeoNodesService) DeleteGeoNode(id int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("geo_nodes/%d", id) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -248,7 +250,7 @@ func (s *GeoNodesService) DeleteGeoNode(id int, options ...RequestOptionFunc) (* // // GitLab API docs: // https://docs.gitlab.com/api/geo_nodes/#repair-a-geo-node -func (s *GeoNodesService) RepairGeoNode(id int, options ...RequestOptionFunc) (*GeoNode, *Response, error) { +func (s *GeoNodesService) RepairGeoNode(id int64, options ...RequestOptionFunc) (*GeoNode, *Response, error) { u := fmt.Sprintf("geo_nodes/%d/repair", id) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -271,162 +273,162 @@ func (s *GeoNodesService) RepairGeoNode(id int, options ...RequestOptionFunc) (* // GitLab API docs: // https://docs.gitlab.com/api/geo_nodes/#retrieve-status-about-all-geo-nodes type GeoNodeStatus struct { - GeoNodeID int `json:"geo_node_id"` + GeoNodeID int64 `json:"geo_node_id"` Healthy bool `json:"healthy"` Health string `json:"health"` HealthStatus string `json:"health_status"` MissingOauthApplication bool `json:"missing_oauth_application"` - AttachmentsCount int `json:"attachments_count"` - AttachmentsSyncedCount int `json:"attachments_synced_count"` - AttachmentsFailedCount int `json:"attachments_failed_count"` - AttachmentsSyncedMissingOnPrimaryCount int `json:"attachments_synced_missing_on_primary_count"` + AttachmentsCount int64 `json:"attachments_count"` + AttachmentsSyncedCount int64 `json:"attachments_synced_count"` + AttachmentsFailedCount int64 `json:"attachments_failed_count"` + AttachmentsSyncedMissingOnPrimaryCount int64 `json:"attachments_synced_missing_on_primary_count"` AttachmentsSyncedInPercentage string `json:"attachments_synced_in_percentage"` - DbReplicationLagSeconds int `json:"db_replication_lag_seconds"` - LfsObjectsCount int `json:"lfs_objects_count"` - LfsObjectsSyncedCount int `json:"lfs_objects_synced_count"` - LfsObjectsFailedCount int `json:"lfs_objects_failed_count"` - LfsObjectsSyncedMissingOnPrimaryCount int `json:"lfs_objects_synced_missing_on_primary_count"` + DbReplicationLagSeconds int64 `json:"db_replication_lag_seconds"` + LfsObjectsCount int64 `json:"lfs_objects_count"` + LfsObjectsSyncedCount int64 `json:"lfs_objects_synced_count"` + LfsObjectsFailedCount int64 `json:"lfs_objects_failed_count"` + LfsObjectsSyncedMissingOnPrimaryCount int64 `json:"lfs_objects_synced_missing_on_primary_count"` LfsObjectsSyncedInPercentage string `json:"lfs_objects_synced_in_percentage"` - JobArtifactsCount int `json:"job_artifacts_count"` - JobArtifactsSyncedCount int `json:"job_artifacts_synced_count"` - JobArtifactsFailedCount int `json:"job_artifacts_failed_count"` - JobArtifactsSyncedMissingOnPrimaryCount int `json:"job_artifacts_synced_missing_on_primary_count"` + JobArtifactsCount int64 `json:"job_artifacts_count"` + JobArtifactsSyncedCount int64 `json:"job_artifacts_synced_count"` + JobArtifactsFailedCount int64 `json:"job_artifacts_failed_count"` + JobArtifactsSyncedMissingOnPrimaryCount int64 `json:"job_artifacts_synced_missing_on_primary_count"` JobArtifactsSyncedInPercentage string `json:"job_artifacts_synced_in_percentage"` - ContainerRepositoriesCount int `json:"container_repositories_count"` - ContainerRepositoriesSyncedCount int `json:"container_repositories_synced_count"` - ContainerRepositoriesFailedCount int `json:"container_repositories_failed_count"` + ContainerRepositoriesCount int64 `json:"container_repositories_count"` + ContainerRepositoriesSyncedCount int64 `json:"container_repositories_synced_count"` + ContainerRepositoriesFailedCount int64 `json:"container_repositories_failed_count"` ContainerRepositoriesSyncedInPercentage string `json:"container_repositories_synced_in_percentage"` - DesignRepositoriesCount int `json:"design_repositories_count"` - DesignRepositoriesSyncedCount int `json:"design_repositories_synced_count"` - DesignRepositoriesFailedCount int `json:"design_repositories_failed_count"` + DesignRepositoriesCount int64 `json:"design_repositories_count"` + DesignRepositoriesSyncedCount int64 `json:"design_repositories_synced_count"` + DesignRepositoriesFailedCount int64 `json:"design_repositories_failed_count"` DesignRepositoriesSyncedInPercentage string `json:"design_repositories_synced_in_percentage"` - ProjectsCount int `json:"projects_count"` - RepositoriesCount int `json:"repositories_count"` - RepositoriesFailedCount int `json:"repositories_failed_count"` - RepositoriesSyncedCount int `json:"repositories_synced_count"` + ProjectsCount int64 `json:"projects_count"` + RepositoriesCount int64 `json:"repositories_count"` + RepositoriesFailedCount int64 `json:"repositories_failed_count"` + RepositoriesSyncedCount int64 `json:"repositories_synced_count"` RepositoriesSyncedInPercentage string `json:"repositories_synced_in_percentage"` - WikisCount int `json:"wikis_count"` - WikisFailedCount int `json:"wikis_failed_count"` - WikisSyncedCount int `json:"wikis_synced_count"` + WikisCount int64 `json:"wikis_count"` + WikisFailedCount int64 `json:"wikis_failed_count"` + WikisSyncedCount int64 `json:"wikis_synced_count"` WikisSyncedInPercentage string `json:"wikis_synced_in_percentage"` - ReplicationSlotsCount int `json:"replication_slots_count"` - ReplicationSlotsUsedCount int `json:"replication_slots_used_count"` + ReplicationSlotsCount int64 `json:"replication_slots_count"` + ReplicationSlotsUsedCount int64 `json:"replication_slots_used_count"` ReplicationSlotsUsedInPercentage string `json:"replication_slots_used_in_percentage"` - ReplicationSlotsMaxRetainedWalBytes int `json:"replication_slots_max_retained_wal_bytes"` - RepositoriesCheckedCount int `json:"repositories_checked_count"` - RepositoriesCheckedFailedCount int `json:"repositories_checked_failed_count"` + ReplicationSlotsMaxRetainedWalBytes int64 `json:"replication_slots_max_retained_wal_bytes"` + RepositoriesCheckedCount int64 `json:"repositories_checked_count"` + RepositoriesCheckedFailedCount int64 `json:"repositories_checked_failed_count"` RepositoriesCheckedInPercentage string `json:"repositories_checked_in_percentage"` - RepositoriesChecksummedCount int `json:"repositories_checksummed_count"` - RepositoriesChecksumFailedCount int `json:"repositories_checksum_failed_count"` + RepositoriesChecksummedCount int64 `json:"repositories_checksummed_count"` + RepositoriesChecksumFailedCount int64 `json:"repositories_checksum_failed_count"` RepositoriesChecksummedInPercentage string `json:"repositories_checksummed_in_percentage"` - WikisChecksummedCount int `json:"wikis_checksummed_count"` - WikisChecksumFailedCount int `json:"wikis_checksum_failed_count"` + WikisChecksummedCount int64 `json:"wikis_checksummed_count"` + WikisChecksumFailedCount int64 `json:"wikis_checksum_failed_count"` WikisChecksummedInPercentage string `json:"wikis_checksummed_in_percentage"` - RepositoriesVerifiedCount int `json:"repositories_verified_count"` - RepositoriesVerificationFailedCount int `json:"repositories_verification_failed_count"` + RepositoriesVerifiedCount int64 `json:"repositories_verified_count"` + RepositoriesVerificationFailedCount int64 `json:"repositories_verification_failed_count"` RepositoriesVerifiedInPercentage string `json:"repositories_verified_in_percentage"` - RepositoriesChecksumMismatchCount int `json:"repositories_checksum_mismatch_count"` - WikisVerifiedCount int `json:"wikis_verified_count"` - WikisVerificationFailedCount int `json:"wikis_verification_failed_count"` + RepositoriesChecksumMismatchCount int64 `json:"repositories_checksum_mismatch_count"` + WikisVerifiedCount int64 `json:"wikis_verified_count"` + WikisVerificationFailedCount int64 `json:"wikis_verification_failed_count"` WikisVerifiedInPercentage string `json:"wikis_verified_in_percentage"` - WikisChecksumMismatchCount int `json:"wikis_checksum_mismatch_count"` - RepositoriesRetryingVerificationCount int `json:"repositories_retrying_verification_count"` - WikisRetryingVerificationCount int `json:"wikis_retrying_verification_count"` - LastEventID int `json:"last_event_id"` - LastEventTimestamp int `json:"last_event_timestamp"` - CursorLastEventID int `json:"cursor_last_event_id"` - CursorLastEventTimestamp int `json:"cursor_last_event_timestamp"` - LastSuccessfulStatusCheckTimestamp int `json:"last_successful_status_check_timestamp"` + WikisChecksumMismatchCount int64 `json:"wikis_checksum_mismatch_count"` + RepositoriesRetryingVerificationCount int64 `json:"repositories_retrying_verification_count"` + WikisRetryingVerificationCount int64 `json:"wikis_retrying_verification_count"` + LastEventID int64 `json:"last_event_id"` + LastEventTimestamp int64 `json:"last_event_timestamp"` + CursorLastEventID int64 `json:"cursor_last_event_id"` + CursorLastEventTimestamp int64 `json:"cursor_last_event_timestamp"` + LastSuccessfulStatusCheckTimestamp int64 `json:"last_successful_status_check_timestamp"` Version string `json:"version"` Revision string `json:"revision"` - MergeRequestDiffsCount int `json:"merge_request_diffs_count"` - MergeRequestDiffsChecksumTotalCount int `json:"merge_request_diffs_checksum_total_count"` - MergeRequestDiffsChecksummedCount int `json:"merge_request_diffs_checksummed_count"` - MergeRequestDiffsChecksumFailedCount int `json:"merge_request_diffs_checksum_failed_count"` - MergeRequestDiffsSyncedCount int `json:"merge_request_diffs_synced_count"` - MergeRequestDiffsFailedCount int `json:"merge_request_diffs_failed_count"` - MergeRequestDiffsRegistryCount int `json:"merge_request_diffs_registry_count"` - MergeRequestDiffsVerificationTotalCount int `json:"merge_request_diffs_verification_total_count"` - MergeRequestDiffsVerifiedCount int `json:"merge_request_diffs_verified_count"` - MergeRequestDiffsVerificationFailedCount int `json:"merge_request_diffs_verification_failed_count"` + MergeRequestDiffsCount int64 `json:"merge_request_diffs_count"` + MergeRequestDiffsChecksumTotalCount int64 `json:"merge_request_diffs_checksum_total_count"` + MergeRequestDiffsChecksummedCount int64 `json:"merge_request_diffs_checksummed_count"` + MergeRequestDiffsChecksumFailedCount int64 `json:"merge_request_diffs_checksum_failed_count"` + MergeRequestDiffsSyncedCount int64 `json:"merge_request_diffs_synced_count"` + MergeRequestDiffsFailedCount int64 `json:"merge_request_diffs_failed_count"` + MergeRequestDiffsRegistryCount int64 `json:"merge_request_diffs_registry_count"` + MergeRequestDiffsVerificationTotalCount int64 `json:"merge_request_diffs_verification_total_count"` + MergeRequestDiffsVerifiedCount int64 `json:"merge_request_diffs_verified_count"` + MergeRequestDiffsVerificationFailedCount int64 `json:"merge_request_diffs_verification_failed_count"` MergeRequestDiffsSyncedInPercentage string `json:"merge_request_diffs_synced_in_percentage"` MergeRequestDiffsVerifiedInPercentage string `json:"merge_request_diffs_verified_in_percentage"` - PackageFilesCount int `json:"package_files_count"` - PackageFilesChecksumTotalCount int `json:"package_files_checksum_total_count"` - PackageFilesChecksummedCount int `json:"package_files_checksummed_count"` - PackageFilesChecksumFailedCount int `json:"package_files_checksum_failed_count"` - PackageFilesSyncedCount int `json:"package_files_synced_count"` - PackageFilesFailedCount int `json:"package_files_failed_count"` - PackageFilesRegistryCount int `json:"package_files_registry_count"` - PackageFilesVerificationTotalCount int `json:"package_files_verification_total_count"` - PackageFilesVerifiedCount int `json:"package_files_verified_count"` - PackageFilesVerificationFailedCount int `json:"package_files_verification_failed_count"` + PackageFilesCount int64 `json:"package_files_count"` + PackageFilesChecksumTotalCount int64 `json:"package_files_checksum_total_count"` + PackageFilesChecksummedCount int64 `json:"package_files_checksummed_count"` + PackageFilesChecksumFailedCount int64 `json:"package_files_checksum_failed_count"` + PackageFilesSyncedCount int64 `json:"package_files_synced_count"` + PackageFilesFailedCount int64 `json:"package_files_failed_count"` + PackageFilesRegistryCount int64 `json:"package_files_registry_count"` + PackageFilesVerificationTotalCount int64 `json:"package_files_verification_total_count"` + PackageFilesVerifiedCount int64 `json:"package_files_verified_count"` + PackageFilesVerificationFailedCount int64 `json:"package_files_verification_failed_count"` PackageFilesSyncedInPercentage string `json:"package_files_synced_in_percentage"` PackageFilesVerifiedInPercentage string `json:"package_files_verified_in_percentage"` - PagesDeploymentsCount int `json:"pages_deployments_count"` - PagesDeploymentsChecksumTotalCount int `json:"pages_deployments_checksum_total_count"` - PagesDeploymentsChecksummedCount int `json:"pages_deployments_checksummed_count"` - PagesDeploymentsChecksumFailedCount int `json:"pages_deployments_checksum_failed_count"` - PagesDeploymentsSyncedCount int `json:"pages_deployments_synced_count"` - PagesDeploymentsFailedCount int `json:"pages_deployments_failed_count"` - PagesDeploymentsRegistryCount int `json:"pages_deployments_registry_count"` - PagesDeploymentsVerificationTotalCount int `json:"pages_deployments_verification_total_count"` - PagesDeploymentsVerifiedCount int `json:"pages_deployments_verified_count"` - PagesDeploymentsVerificationFailedCount int `json:"pages_deployments_verification_failed_count"` + PagesDeploymentsCount int64 `json:"pages_deployments_count"` + PagesDeploymentsChecksumTotalCount int64 `json:"pages_deployments_checksum_total_count"` + PagesDeploymentsChecksummedCount int64 `json:"pages_deployments_checksummed_count"` + PagesDeploymentsChecksumFailedCount int64 `json:"pages_deployments_checksum_failed_count"` + PagesDeploymentsSyncedCount int64 `json:"pages_deployments_synced_count"` + PagesDeploymentsFailedCount int64 `json:"pages_deployments_failed_count"` + PagesDeploymentsRegistryCount int64 `json:"pages_deployments_registry_count"` + PagesDeploymentsVerificationTotalCount int64 `json:"pages_deployments_verification_total_count"` + PagesDeploymentsVerifiedCount int64 `json:"pages_deployments_verified_count"` + PagesDeploymentsVerificationFailedCount int64 `json:"pages_deployments_verification_failed_count"` PagesDeploymentsSyncedInPercentage string `json:"pages_deployments_synced_in_percentage"` PagesDeploymentsVerifiedInPercentage string `json:"pages_deployments_verified_in_percentage"` - TerraformStateVersionsCount int `json:"terraform_state_versions_count"` - TerraformStateVersionsChecksumTotalCount int `json:"terraform_state_versions_checksum_total_count"` - TerraformStateVersionsChecksummedCount int `json:"terraform_state_versions_checksummed_count"` - TerraformStateVersionsChecksumFailedCount int `json:"terraform_state_versions_checksum_failed_count"` - TerraformStateVersionsSyncedCount int `json:"terraform_state_versions_synced_count"` - TerraformStateVersionsFailedCount int `json:"terraform_state_versions_failed_count"` - TerraformStateVersionsRegistryCount int `json:"terraform_state_versions_registry_count"` - TerraformStateVersionsVerificationTotalCount int `json:"terraform_state_versions_verification_total_count"` - TerraformStateVersionsVerifiedCount int `json:"terraform_state_versions_verified_count"` - TerraformStateVersionsVerificationFailedCount int `json:"terraform_state_versions_verification_failed_count"` + TerraformStateVersionsCount int64 `json:"terraform_state_versions_count"` + TerraformStateVersionsChecksumTotalCount int64 `json:"terraform_state_versions_checksum_total_count"` + TerraformStateVersionsChecksummedCount int64 `json:"terraform_state_versions_checksummed_count"` + TerraformStateVersionsChecksumFailedCount int64 `json:"terraform_state_versions_checksum_failed_count"` + TerraformStateVersionsSyncedCount int64 `json:"terraform_state_versions_synced_count"` + TerraformStateVersionsFailedCount int64 `json:"terraform_state_versions_failed_count"` + TerraformStateVersionsRegistryCount int64 `json:"terraform_state_versions_registry_count"` + TerraformStateVersionsVerificationTotalCount int64 `json:"terraform_state_versions_verification_total_count"` + TerraformStateVersionsVerifiedCount int64 `json:"terraform_state_versions_verified_count"` + TerraformStateVersionsVerificationFailedCount int64 `json:"terraform_state_versions_verification_failed_count"` TerraformStateVersionsSyncedInPercentage string `json:"terraform_state_versions_synced_in_percentage"` TerraformStateVersionsVerifiedInPercentage string `json:"terraform_state_versions_verified_in_percentage"` - SnippetRepositoriesCount int `json:"snippet_repositories_count"` - SnippetRepositoriesChecksumTotalCount int `json:"snippet_repositories_checksum_total_count"` - SnippetRepositoriesChecksummedCount int `json:"snippet_repositories_checksummed_count"` - SnippetRepositoriesChecksumFailedCount int `json:"snippet_repositories_checksum_failed_count"` - SnippetRepositoriesSyncedCount int `json:"snippet_repositories_synced_count"` - SnippetRepositoriesFailedCount int `json:"snippet_repositories_failed_count"` - SnippetRepositoriesRegistryCount int `json:"snippet_repositories_registry_count"` - SnippetRepositoriesVerificationTotalCount int `json:"snippet_repositories_verification_total_count"` - SnippetRepositoriesVerifiedCount int `json:"snippet_repositories_verified_count"` - SnippetRepositoriesVerificationFailedCount int `json:"snippet_repositories_verification_failed_count"` + SnippetRepositoriesCount int64 `json:"snippet_repositories_count"` + SnippetRepositoriesChecksumTotalCount int64 `json:"snippet_repositories_checksum_total_count"` + SnippetRepositoriesChecksummedCount int64 `json:"snippet_repositories_checksummed_count"` + SnippetRepositoriesChecksumFailedCount int64 `json:"snippet_repositories_checksum_failed_count"` + SnippetRepositoriesSyncedCount int64 `json:"snippet_repositories_synced_count"` + SnippetRepositoriesFailedCount int64 `json:"snippet_repositories_failed_count"` + SnippetRepositoriesRegistryCount int64 `json:"snippet_repositories_registry_count"` + SnippetRepositoriesVerificationTotalCount int64 `json:"snippet_repositories_verification_total_count"` + SnippetRepositoriesVerifiedCount int64 `json:"snippet_repositories_verified_count"` + SnippetRepositoriesVerificationFailedCount int64 `json:"snippet_repositories_verification_failed_count"` SnippetRepositoriesSyncedInPercentage string `json:"snippet_repositories_synced_in_percentage"` SnippetRepositoriesVerifiedInPercentage string `json:"snippet_repositories_verified_in_percentage"` - GroupWikiRepositoriesCount int `json:"group_wiki_repositories_count"` - GroupWikiRepositoriesChecksumTotalCount int `json:"group_wiki_repositories_checksum_total_count"` - GroupWikiRepositoriesChecksummedCount int `json:"group_wiki_repositories_checksummed_count"` - GroupWikiRepositoriesChecksumFailedCount int `json:"group_wiki_repositories_checksum_failed_count"` - GroupWikiRepositoriesSyncedCount int `json:"group_wiki_repositories_synced_count"` - GroupWikiRepositoriesFailedCount int `json:"group_wiki_repositories_failed_count"` - GroupWikiRepositoriesRegistryCount int `json:"group_wiki_repositories_registry_count"` - GroupWikiRepositoriesVerificationTotalCount int `json:"group_wiki_repositories_verification_total_count"` - GroupWikiRepositoriesVerifiedCount int `json:"group_wiki_repositories_verified_count"` - GroupWikiRepositoriesVerificationFailedCount int `json:"group_wiki_repositories_verification_failed_count"` + GroupWikiRepositoriesCount int64 `json:"group_wiki_repositories_count"` + GroupWikiRepositoriesChecksumTotalCount int64 `json:"group_wiki_repositories_checksum_total_count"` + GroupWikiRepositoriesChecksummedCount int64 `json:"group_wiki_repositories_checksummed_count"` + GroupWikiRepositoriesChecksumFailedCount int64 `json:"group_wiki_repositories_checksum_failed_count"` + GroupWikiRepositoriesSyncedCount int64 `json:"group_wiki_repositories_synced_count"` + GroupWikiRepositoriesFailedCount int64 `json:"group_wiki_repositories_failed_count"` + GroupWikiRepositoriesRegistryCount int64 `json:"group_wiki_repositories_registry_count"` + GroupWikiRepositoriesVerificationTotalCount int64 `json:"group_wiki_repositories_verification_total_count"` + GroupWikiRepositoriesVerifiedCount int64 `json:"group_wiki_repositories_verified_count"` + GroupWikiRepositoriesVerificationFailedCount int64 `json:"group_wiki_repositories_verification_failed_count"` GroupWikiRepositoriesSyncedInPercentage string `json:"group_wiki_repositories_synced_in_percentage"` GroupWikiRepositoriesVerifiedInPercentage string `json:"group_wiki_repositories_verified_in_percentage"` - PipelineArtifactsCount int `json:"pipeline_artifacts_count"` - PipelineArtifactsChecksumTotalCount int `json:"pipeline_artifacts_checksum_total_count"` - PipelineArtifactsChecksummedCount int `json:"pipeline_artifacts_checksummed_count"` - PipelineArtifactsChecksumFailedCount int `json:"pipeline_artifacts_checksum_failed_count"` - PipelineArtifactsSyncedCount int `json:"pipeline_artifacts_synced_count"` - PipelineArtifactsFailedCount int `json:"pipeline_artifacts_failed_count"` - PipelineArtifactsRegistryCount int `json:"pipeline_artifacts_registry_count"` - PipelineArtifactsVerificationTotalCount int `json:"pipeline_artifacts_verification_total_count"` - PipelineArtifactsVerifiedCount int `json:"pipeline_artifacts_verified_count"` - PipelineArtifactsVerificationFailedCount int `json:"pipeline_artifacts_verification_failed_count"` + PipelineArtifactsCount int64 `json:"pipeline_artifacts_count"` + PipelineArtifactsChecksumTotalCount int64 `json:"pipeline_artifacts_checksum_total_count"` + PipelineArtifactsChecksummedCount int64 `json:"pipeline_artifacts_checksummed_count"` + PipelineArtifactsChecksumFailedCount int64 `json:"pipeline_artifacts_checksum_failed_count"` + PipelineArtifactsSyncedCount int64 `json:"pipeline_artifacts_synced_count"` + PipelineArtifactsFailedCount int64 `json:"pipeline_artifacts_failed_count"` + PipelineArtifactsRegistryCount int64 `json:"pipeline_artifacts_registry_count"` + PipelineArtifactsVerificationTotalCount int64 `json:"pipeline_artifacts_verification_total_count"` + PipelineArtifactsVerifiedCount int64 `json:"pipeline_artifacts_verified_count"` + PipelineArtifactsVerificationFailedCount int64 `json:"pipeline_artifacts_verification_failed_count"` PipelineArtifactsSyncedInPercentage string `json:"pipeline_artifacts_synced_in_percentage"` PipelineArtifactsVerifiedInPercentage string `json:"pipeline_artifacts_verified_in_percentage"` - UploadsCount int `json:"uploads_count"` - UploadsSyncedCount int `json:"uploads_synced_count"` - UploadsFailedCount int `json:"uploads_failed_count"` - UploadsRegistryCount int `json:"uploads_registry_count"` + UploadsCount int64 `json:"uploads_count"` + UploadsSyncedCount int64 `json:"uploads_synced_count"` + UploadsFailedCount int64 `json:"uploads_failed_count"` + UploadsRegistryCount int64 `json:"uploads_registry_count"` UploadsSyncedInPercentage string `json:"uploads_synced_in_percentage"` } @@ -455,7 +457,7 @@ func (s *GeoNodesService) RetrieveStatusOfAllGeoNodes(options ...RequestOptionFu // // GitLab API docs: // https://docs.gitlab.com/api/geo_nodes/#retrieve-status-about-a-specific-geo-node -func (s *GeoNodesService) RetrieveStatusOfGeoNode(id int, options ...RequestOptionFunc) (*GeoNodeStatus, *Response, error) { +func (s *GeoNodesService) RetrieveStatusOfGeoNode(id int64, options ...RequestOptionFunc) (*GeoNodeStatus, *Response, error) { u := fmt.Sprintf("geo_nodes/%d/status", id) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/geo_sites.go b/vendor/gitlab.com/gitlab-org/api/client-go/geo_sites.go index 754af53d0..afce62fc0 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/geo_sites.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/geo_sites.go @@ -23,12 +23,12 @@ type ( GeoSitesServiceInterface interface { CreateGeoSite(*CreateGeoSitesOptions, ...RequestOptionFunc) (*GeoSite, *Response, error) ListGeoSites(*ListGeoSitesOptions, ...RequestOptionFunc) ([]*GeoSite, *Response, error) - GetGeoSite(int, ...RequestOptionFunc) (*GeoSite, *Response, error) - EditGeoSite(int, *EditGeoSiteOptions, ...RequestOptionFunc) (*GeoSite, *Response, error) - DeleteGeoSite(int, ...RequestOptionFunc) (*Response, error) - RepairGeoSite(int, ...RequestOptionFunc) (*GeoSite, *Response, error) + GetGeoSite(int64, ...RequestOptionFunc) (*GeoSite, *Response, error) + EditGeoSite(int64, *EditGeoSiteOptions, ...RequestOptionFunc) (*GeoSite, *Response, error) + DeleteGeoSite(int64, ...RequestOptionFunc) (*Response, error) + RepairGeoSite(int64, ...RequestOptionFunc) (*GeoSite, *Response, error) ListStatusOfAllGeoSites(*ListStatusOfAllGeoSitesOptions, ...RequestOptionFunc) ([]*GeoSiteStatus, *Response, error) - GetStatusOfGeoSite(int, ...RequestOptionFunc) (*GeoSiteStatus, *Response, error) + GetStatusOfGeoSite(int64, ...RequestOptionFunc) (*GeoSiteStatus, *Response, error) } // GeoSitesService handles communication with Geo Sites related methods @@ -46,21 +46,21 @@ var _ GeoSitesServiceInterface = (*GeoSitesService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/geo_sites/ type GeoSite struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` URL string `json:"url"` InternalURL string `json:"internal_url"` Primary bool `json:"primary"` Enabled bool `json:"enabled"` Current bool `json:"current"` - FilesMaxCapacity int `json:"files_max_capacity"` - ReposMaxCapacity int `json:"repos_max_capacity"` - VerificationMaxCapacity int `json:"verification_max_capacity"` - ContainerRepositoriesMaxCapacity int `json:"container_repositories_max_capacity"` + FilesMaxCapacity int64 `json:"files_max_capacity"` + ReposMaxCapacity int64 `json:"repos_max_capacity"` + VerificationMaxCapacity int64 `json:"verification_max_capacity"` + ContainerRepositoriesMaxCapacity int64 `json:"container_repositories_max_capacity"` SelectiveSyncType string `json:"selective_sync_type"` SelectiveSyncShards []string `json:"selective_sync_shards"` - SelectiveSyncNamespaceIDs []int `json:"selective_sync_namespace_ids"` - MinimumReverificationInterval int `json:"minimum_reverification_interval"` + SelectiveSyncNamespaceIDs []int64 `json:"selective_sync_namespace_ids"` + MinimumReverificationInterval int64 `json:"minimum_reverification_interval"` SyncObjectStorage bool `json:"sync_object_storage"` WebEditURL string `json:"web_edit_url"` WebGeoReplicationDetailsURL string `json:"web_geo_replication_details_url"` @@ -86,15 +86,15 @@ type CreateGeoSitesOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` URL *string `url:"url,omitempty" json:"url,omitempty"` InternalURL *string `url:"internal_url,omitempty" json:"internal_url,omitempty"` - FilesMaxCapacity *int `url:"files_max_capacity,omitempty" json:"files_max_capacity,omitempty"` - ReposMaxCapacity *int `url:"repos_max_capacity,omitempty" json:"repos_max_capacity,omitempty"` - VerificationMaxCapacity *int `url:"verification_max_capacity,omitempty" json:"verification_max_capacity,omitempty"` - ContainerRepositoriesMaxCapacity *int `url:"container_repositories_max_capacity,omitempty" json:"container_repositories_max_capacity,omitempty"` + FilesMaxCapacity *int64 `url:"files_max_capacity,omitempty" json:"files_max_capacity,omitempty"` + ReposMaxCapacity *int64 `url:"repos_max_capacity,omitempty" json:"repos_max_capacity,omitempty"` + VerificationMaxCapacity *int64 `url:"verification_max_capacity,omitempty" json:"verification_max_capacity,omitempty"` + ContainerRepositoriesMaxCapacity *int64 `url:"container_repositories_max_capacity,omitempty" json:"container_repositories_max_capacity,omitempty"` SyncObjectStorage *bool `url:"sync_object_storage,omitempty" json:"sync_object_storage,omitempty"` SelectiveSyncType *string `url:"selective_sync_type,omitempty" json:"selective_sync_type,omitempty"` SelectiveSyncShards *[]string `url:"selective_sync_shards,omitempty" json:"selective_sync_shards,omitempty"` - SelectiveSyncNamespaceIDs *[]int `url:"selective_sync_namespace_ids,omitempty" json:"selective_sync_namespace_ids,omitempty"` - MinimumReverificationInterval *int `url:"minimum_reverification_interval,omitempty" json:"minimum_reverification_interval,omitempty"` + SelectiveSyncNamespaceIDs *[]int64 `url:"selective_sync_namespace_ids,omitempty" json:"selective_sync_namespace_ids,omitempty"` + MinimumReverificationInterval *int64 `url:"minimum_reverification_interval,omitempty" json:"minimum_reverification_interval,omitempty"` } // CreateGeoSite creates a new Geo Site. @@ -114,7 +114,9 @@ func (s *GeoSitesService) CreateGeoSite(opt *CreateGeoSitesOptions, options ...R // // GitLab API docs: // https://docs.gitlab.com/api/geo_sites/#retrieve-configuration-about-all-geo-sites -type ListGeoSitesOptions ListOptions +type ListGeoSitesOptions struct { + ListOptions +} // ListGeoSites gets a list of geo sites. // @@ -132,7 +134,7 @@ func (s *GeoSitesService) ListGeoSites(opt *ListGeoSitesOptions, options ...Requ // // GitLab API docs: // https://docs.gitlab.com/api/geo_sites/#retrieve-configuration-about-a-specific-geo-site -func (s *GeoSitesService) GetGeoSite(id int, options ...RequestOptionFunc) (*GeoSite, *Response, error) { +func (s *GeoSitesService) GetGeoSite(id int64, options ...RequestOptionFunc) (*GeoSite, *Response, error) { return do[*GeoSite](s.client, withPath("geo_sites/%d", id), withRequestOpts(options...), @@ -148,21 +150,21 @@ type EditGeoSiteOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` URL *string `url:"url,omitempty" json:"url,omitempty"` InternalURL *string `url:"internal_url,omitempty" json:"internal_url,omitempty"` - FilesMaxCapacity *int `url:"files_max_capacity,omitempty" json:"files_max_capacity,omitempty"` - ReposMaxCapacity *int `url:"repos_max_capacity,omitempty" json:"repos_max_capacity,omitempty"` - VerificationMaxCapacity *int `url:"verification_max_capacity,omitempty" json:"verification_max_capacity,omitempty"` - ContainerRepositoriesMaxCapacity *int `url:"container_repositories_max_capacity,omitempty" json:"container_repositories_max_capacity,omitempty"` + FilesMaxCapacity *int64 `url:"files_max_capacity,omitempty" json:"files_max_capacity,omitempty"` + ReposMaxCapacity *int64 `url:"repos_max_capacity,omitempty" json:"repos_max_capacity,omitempty"` + VerificationMaxCapacity *int64 `url:"verification_max_capacity,omitempty" json:"verification_max_capacity,omitempty"` + ContainerRepositoriesMaxCapacity *int64 `url:"container_repositories_max_capacity,omitempty" json:"container_repositories_max_capacity,omitempty"` SelectiveSyncType *string `url:"selective_sync_type,omitempty" json:"selective_sync_type,omitempty"` SelectiveSyncShards *[]string `url:"selective_sync_shards,omitempty" json:"selective_sync_shards,omitempty"` - SelectiveSyncNamespaceIDs *[]int `url:"selective_sync_namespace_ids,omitempty" json:"selective_sync_namespace_ids,omitempty"` - MinimumReverificationInterval *int `url:"minimum_reverification_interval,omitempty" json:"minimum_reverification_interval,omitempty"` + SelectiveSyncNamespaceIDs *[]int64 `url:"selective_sync_namespace_ids,omitempty" json:"selective_sync_namespace_ids,omitempty"` + MinimumReverificationInterval *int64 `url:"minimum_reverification_interval,omitempty" json:"minimum_reverification_interval,omitempty"` } // EditGeoSite updates settings of an existing Geo site. // // GitLab API docs: // https://docs.gitlab.com/api/geo_sites/#edit-a-geo-site -func (s *GeoSitesService) EditGeoSite(id int, opt *EditGeoSiteOptions, options ...RequestOptionFunc) (*GeoSite, *Response, error) { +func (s *GeoSitesService) EditGeoSite(id int64, opt *EditGeoSiteOptions, options ...RequestOptionFunc) (*GeoSite, *Response, error) { return do[*GeoSite](s.client, withMethod(http.MethodPut), withPath("geo_sites/%d", id), @@ -175,7 +177,7 @@ func (s *GeoSitesService) EditGeoSite(id int, opt *EditGeoSiteOptions, options . // // GitLab API docs: // https://docs.gitlab.com/api/geo_sites/#delete-a-geo-site -func (s *GeoSitesService) DeleteGeoSite(id int, options ...RequestOptionFunc) (*Response, error) { +func (s *GeoSitesService) DeleteGeoSite(id int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("geo_sites/%d", id), @@ -188,7 +190,7 @@ func (s *GeoSitesService) DeleteGeoSite(id int, options ...RequestOptionFunc) (* // // GitLab API docs: // https://docs.gitlab.com/api/geo_sites/#repair-a-geo-site -func (s *GeoSitesService) RepairGeoSite(id int, options ...RequestOptionFunc) (*GeoSite, *Response, error) { +func (s *GeoSitesService) RepairGeoSite(id int64, options ...RequestOptionFunc) (*GeoSite, *Response, error) { return do[*GeoSite](s.client, withMethod(http.MethodPost), withPath("geo_sites/%d/repair", id), @@ -201,163 +203,163 @@ func (s *GeoSitesService) RepairGeoSite(id int, options ...RequestOptionFunc) (* // GitLab API docs: // https://docs.gitlab.com/api/geo_sites/#retrieve-status-about-all-geo-sites type GeoSiteStatus struct { - GeoNodeID int `json:"geo_node_id"` - ProjectsCount int `json:"projects_count"` + GeoNodeID int64 `json:"geo_node_id"` + ProjectsCount int64 `json:"projects_count"` ContainerRepositoriesReplicationEnabled bool `json:"container_repositories_replication_enabled"` - LFSObjectsCount int `json:"lfs_objects_count"` - LFSObjectsChecksumTotalCount int `json:"lfs_objects_checksum_total_count"` - LFSObjectsChecksummedCount int `json:"lfs_objects_checksummed_count"` - LFSObjectsChecksumFailedCount int `json:"lfs_objects_checksum_failed_count"` - LFSObjectsSyncedCount int `json:"lfs_objects_synced_count"` - LFSObjectsFailedCount int `json:"lfs_objects_failed_count"` - LFSObjectsRegistryCount int `json:"lfs_objects_registry_count"` - LFSObjectsVerificationTotalCount int `json:"lfs_objects_verification_total_count"` - LFSObjectsVerifiedCount int `json:"lfs_objects_verified_count"` - LFSObjectsVerificationFailedCount int `json:"lfs_objects_verification_failed_count"` - MergeRequestDiffsCount int `json:"merge_request_diffs_count"` - MergeRequestDiffsChecksumTotalCount int `json:"merge_request_diffs_checksum_total_count"` - MergeRequestDiffsChecksummedCount int `json:"merge_request_diffs_checksummed_count"` - MergeRequestDiffsChecksumFailedCount int `json:"merge_request_diffs_checksum_failed_count"` - MergeRequestDiffsSyncedCount int `json:"merge_request_diffs_synced_count"` - MergeRequestDiffsFailedCount int `json:"merge_request_diffs_failed_count"` - MergeRequestDiffsRegistryCount int `json:"merge_request_diffs_registry_count"` - MergeRequestDiffsVerificationTotalCount int `json:"merge_request_diffs_verification_total_count"` - MergeRequestDiffsVerifiedCount int `json:"merge_request_diffs_verified_count"` - MergeRequestDiffsVerificationFailedCount int `json:"merge_request_diffs_verification_failed_count"` - PackageFilesCount int `json:"package_files_count"` - PackageFilesChecksumTotalCount int `json:"package_files_checksum_total_count"` - PackageFilesChecksummedCount int `json:"package_files_checksummed_count"` - PackageFilesChecksumFailedCount int `json:"package_files_checksum_failed_count"` - PackageFilesSyncedCount int `json:"package_files_synced_count"` - PackageFilesFailedCount int `json:"package_files_failed_count"` - PackageFilesRegistryCount int `json:"package_files_registry_count"` - PackageFilesVerificationTotalCount int `json:"package_files_verification_total_count"` - PackageFilesVerifiedCount int `json:"package_files_verified_count"` - PackageFilesVerificationFailedCount int `json:"package_files_verification_failed_count"` - TerraformStateVersionsCount int `json:"terraform_state_versions_count"` - TerraformStateVersionsChecksumTotalCount int `json:"terraform_state_versions_checksum_total_count"` - TerraformStateVersionsChecksummedCount int `json:"terraform_state_versions_checksummed_count"` - TerraformStateVersionsChecksumFailedCount int `json:"terraform_state_versions_checksum_failed_count"` - TerraformStateVersionsSyncedCount int `json:"terraform_state_versions_synced_count"` - TerraformStateVersionsFailedCount int `json:"terraform_state_versions_failed_count"` - TerraformStateVersionsRegistryCount int `json:"terraform_state_versions_registry_count"` - TerraformStateVersionsVerificationTotalCount int `json:"terraform_state_versions_verification_total_count"` - TerraformStateVersionsVerifiedCount int `json:"terraform_state_versions_verified_count"` - TerraformStateVersionsVerificationFailedCount int `json:"terraform_state_versions_verification_failed_count"` - SnippetRepositoriesCount int `json:"snippet_repositories_count"` - SnippetRepositoriesChecksumTotalCount int `json:"snippet_repositories_checksum_total_count"` - SnippetRepositoriesChecksummedCount int `json:"snippet_repositories_checksummed_count"` - SnippetRepositoriesChecksumFailedCount int `json:"snippet_repositories_checksum_failed_count"` - SnippetRepositoriesSyncedCount int `json:"snippet_repositories_synced_count"` - SnippetRepositoriesFailedCount int `json:"snippet_repositories_failed_count"` - SnippetRepositoriesRegistryCount int `json:"snippet_repositories_registry_count"` - SnippetRepositoriesVerificationTotalCount int `json:"snippet_repositories_verification_total_count"` - SnippetRepositoriesVerifiedCount int `json:"snippet_repositories_verified_count"` - SnippetRepositoriesVerificationFailedCount int `json:"snippet_repositories_verification_failed_count"` - GroupWikiRepositoriesCount int `json:"group_wiki_repositories_count"` - GroupWikiRepositoriesChecksumTotalCount int `json:"group_wiki_repositories_checksum_total_count"` - GroupWikiRepositoriesChecksummedCount int `json:"group_wiki_repositories_checksummed_count"` - GroupWikiRepositoriesChecksumFailedCount int `json:"group_wiki_repositories_checksum_failed_count"` - GroupWikiRepositoriesSyncedCount int `json:"group_wiki_repositories_synced_count"` - GroupWikiRepositoriesFailedCount int `json:"group_wiki_repositories_failed_count"` - GroupWikiRepositoriesRegistryCount int `json:"group_wiki_repositories_registry_count"` - GrupWikiRepositoriesVerificationTotalCount int `json:"group_wiki_repositories_verification_total_count"` - GroupWikiRepositoriesVerifiedCount int `json:"group_wiki_repositories_verified_count"` - GroupWikiRepositoriesVerificationFailedCount int `json:"group_wiki_repositories_verification_failed_count"` - PipelineArtifactsCount int `json:"pipeline_artifacts_count"` - PipelineArtifactsChecksumTotalCount int `json:"pipeline_artifacts_checksum_total_count"` - PipelineArtifactsChecksummedCount int `json:"pipeline_artifacts_checksummed_count"` - PipelineArtifactsChecksumFailedCount int `json:"pipeline_artifacts_checksum_failed_count"` - PipelineArtifactsSyncedCount int `json:"pipeline_artifacts_synced_count"` - PipelineArtifactsFailedCount int `json:"pipeline_artifacts_failed_count"` - PipelineArtifactsRegistryCount int `json:"pipeline_artifacts_registry_count"` - PipelineArtifactsVerificationTotalCount int `json:"pipeline_artifacts_verification_total_count"` - PipelineArtifactsVerifiedCount int `json:"pipeline_artifacts_verified_count"` - PipelineArtifactsVerificationFailedCount int `json:"pipeline_artifacts_verification_failed_count"` - PagesDeploymentsCount int `json:"pages_deployments_count"` - PagesDeploymentsChecksumTotalCount int `json:"pages_deployments_checksum_total_count"` - PagesDeploymentsChecksummedCount int `json:"pages_deployments_checksummed_count"` - PagesDeploymentsChecksumFailedCount int `json:"pages_deployments_checksum_failed_count"` - PagesDeploymentsSyncedCount int `json:"pages_deployments_synced_count"` - PagesDeploymentsFailedCount int `json:"pages_deployments_failed_count"` - PagesDeploymentsRegistryCount int `json:"pages_deployments_registry_count"` - PagesDeploymentsVerificationTotalCount int `json:"pages_deployments_verification_total_count"` - PagesDeploymentsVerifiedCount int `json:"pages_deployments_verified_count"` - PagesDeploymentsVerificationFailedCount int `json:"pages_deployments_verification_failed_count"` - UploadsCount int `json:"uploads_count"` - UploadsChecksumTotalCount int `json:"uploads_checksum_total_count"` - UploadsChecksummedCount int `json:"uploads_checksummed_count"` - UploadsChecksumFailedCount int `json:"uploads_checksum_failed_count"` - UploadsSyncedCount int `json:"uploads_synced_count"` - UploadsFailedCount int `json:"uploads_failed_count"` - UploadsRegistryCount int `json:"uploads_registry_count"` - UploadsVerificationTotalCount int `json:"uploads_verification_total_count"` - UploadsVerifiedCount int `json:"uploads_verified_count"` - UploadsVerificationFailedCount int `json:"uploads_verification_failed_count"` - JobArtifactsCount int `json:"job_artifacts_count"` - JobArtifactsChecksumTotalCount int `json:"job_artifacts_checksum_total_count"` - JobArtifactsChecksummedCount int `json:"job_artifacts_checksummed_count"` - JobArtifactsChecksumFailedCount int `json:"job_artifacts_checksum_failed_count"` - JobArtifactsSyncedCount int `json:"job_artifacts_synced_count"` - JobArtifactsFailedCount int `json:"job_artifacts_failed_count"` - JobArtifactsRegistryCount int `json:"job_artifacts_registry_count"` - JobArtifactsVerificationTotalCount int `json:"job_artifacts_verification_total_count"` - JobArtifactsVerifiedCount int `json:"job_artifacts_verified_count"` - JobArtifactsVerificationFailedCount int `json:"job_artifacts_verification_failed_count"` - CISecureFilesCount int `json:"ci_secure_files_count"` - CISecureFilesChecksumTotalCount int `json:"ci_secure_files_checksum_total_count"` - CISecureFilesChecksummedCount int `json:"ci_secure_files_checksummed_count"` - CISecureFilesChecksumFailedCount int `json:"ci_secure_files_checksum_failed_count"` - CISecureFilesSyncedCount int `json:"ci_secure_files_synced_count"` - CISecureFilesFailedCount int `json:"ci_secure_files_failed_count"` - CISecureFilesRegistryCount int `json:"ci_secure_files_registry_count"` - CISecureFilesVerificationTotalCount int `json:"ci_secure_files_verification_total_count"` - CISecureFilesVerifiedCount int `json:"ci_secure_files_verified_count"` - CISecureFilesVerificationFailedCount int `json:"ci_secure_files_verification_failed_count"` - ContainerRepositoriesCount int `json:"container_repositories_count"` - ContainerRepositoriesChecksumTotalCount int `json:"container_repositories_checksum_total_count"` - ContainerRepositoriesChecksummedCount int `json:"container_repositories_checksummed_count"` - ContainerRepositoriesChecksumFailedCount int `json:"container_repositories_checksum_failed_count"` - ContainerRepositoriesSyncedCount int `json:"container_repositories_synced_count"` - ContainerRepositoriesFailedCount int `json:"container_repositories_failed_count"` - ContainerRepositoriesRegistryCount int `json:"container_repositories_registry_count"` - ContainerRepositoriesVerificationTotalCount int `json:"container_repositories_verification_total_count"` - ContainerRepositoriesVerifiedCount int `json:"container_repositories_verified_count"` - ContainerRepositoriesVerificationFailedCount int `json:"container_repositories_verification_failed_count"` - DependencyProxyBlobsCount int `json:"dependency_proxy_blobs_count"` - DependencyProxyBlobsChecksumTotalCount int `json:"dependency_proxy_blobs_checksum_total_count"` - DependencyProxyBlobsChecksummedCount int `json:"dependency_proxy_blobs_checksummed_count"` - DependencyProxyBlobsChecksumFailedCount int `json:"dependency_proxy_blobs_checksum_failed_count"` - DependencyProxyBlobsSyncedCount int `json:"dependency_proxy_blobs_synced_count"` - DependencyProxyBlobsFailedCount int `json:"dependency_proxy_blobs_failed_count"` - DependencyProxyBlobsRegistryCount int `json:"dependency_proxy_blobs_registry_count"` - DependencyProxyBlobsVerificationTotalCount int `json:"dependency_proxy_blobs_verification_total_count"` - DependencyProxyBlobsVerifiedCount int `json:"dependency_proxy_blobs_verified_count"` - DependencyProxyBlobsVerificationFailedCount int `json:"dependency_proxy_blobs_verification_failed_count"` - DependencyProxyManifestsCount int `json:"dependency_proxy_manifests_count"` - DependencyProxyManifestsChecksumTotalCount int `json:"dependency_proxy_manifests_checksum_total_count"` - DependencyProxyManifestsChecksummedCount int `json:"dependency_proxy_manifests_checksummed_count"` - DependencyProxyManifestsChecksumFailedCount int `json:"dependency_proxy_manifests_checksum_failed_count"` - DependencyProxyManifestsSyncedCount int `json:"dependency_proxy_manifests_synced_count"` - DependencyProxyManifestsFailedCount int `json:"dependency_proxy_manifests_failed_count"` - DependencyProxyManifestsRegistryCount int `json:"dependency_proxy_manifests_registry_count"` - DependencyProxyManifestsVerificationTotalCount int `json:"dependency_proxy_manifests_verification_total_count"` - DependencyProxyManifestsVerifiedCount int `json:"dependency_proxy_manifests_verified_count"` - DependencyProxyManifestsVerificationFailedCount int `json:"dependency_proxy_manifests_verification_failed_count"` - ProjectWikiRepositoriesCount int `json:"project_wiki_repositories_count"` - ProjectWikiRepositoriesChecksumTotalCount int `json:"project_wiki_repositories_checksum_total_count"` - ProjectWikiRepositoriesChecksummedCount int `json:"project_wiki_repositories_checksummed_count"` - ProjectWikiRepositoriesChecksumFailedCount int `json:"project_wiki_repositories_checksum_failed_count"` - ProjectWikiRepositoriesSyncedCount int `json:"project_wiki_repositories_synced_count"` - ProjectWikiRepositoriesFailedCount int `json:"project_wiki_repositories_failed_count"` - ProjectWikiRepositoriesRegistryCount int `json:"project_wiki_repositories_registry_count"` - ProjectWikiRepositoriesVerificationTotalCount int `json:"project_wiki_repositories_verification_total_count"` - ProjectWikiRepositoriesVerifiedCount int `json:"project_wiki_repositories_verified_count"` - ProjectWikiRepositoriesVerificationFailedCount int `json:"project_wiki_repositories_verification_failed_count"` - GitFetchEventCountWeekly int `json:"git_fetch_event_count_weekly"` - GitPushEventCountWeekly int `json:"git_push_event_count_weekly"` - ProxyRemoteRequestsEventCountWeekly int `json:"proxy_remote_requests_event_count_weekly"` - ProxyLocalRequestsEventCountWeekly int `json:"proxy_local_requests_event_count_weekly"` + LFSObjectsCount int64 `json:"lfs_objects_count"` + LFSObjectsChecksumTotalCount int64 `json:"lfs_objects_checksum_total_count"` + LFSObjectsChecksummedCount int64 `json:"lfs_objects_checksummed_count"` + LFSObjectsChecksumFailedCount int64 `json:"lfs_objects_checksum_failed_count"` + LFSObjectsSyncedCount int64 `json:"lfs_objects_synced_count"` + LFSObjectsFailedCount int64 `json:"lfs_objects_failed_count"` + LFSObjectsRegistryCount int64 `json:"lfs_objects_registry_count"` + LFSObjectsVerificationTotalCount int64 `json:"lfs_objects_verification_total_count"` + LFSObjectsVerifiedCount int64 `json:"lfs_objects_verified_count"` + LFSObjectsVerificationFailedCount int64 `json:"lfs_objects_verification_failed_count"` + MergeRequestDiffsCount int64 `json:"merge_request_diffs_count"` + MergeRequestDiffsChecksumTotalCount int64 `json:"merge_request_diffs_checksum_total_count"` + MergeRequestDiffsChecksummedCount int64 `json:"merge_request_diffs_checksummed_count"` + MergeRequestDiffsChecksumFailedCount int64 `json:"merge_request_diffs_checksum_failed_count"` + MergeRequestDiffsSyncedCount int64 `json:"merge_request_diffs_synced_count"` + MergeRequestDiffsFailedCount int64 `json:"merge_request_diffs_failed_count"` + MergeRequestDiffsRegistryCount int64 `json:"merge_request_diffs_registry_count"` + MergeRequestDiffsVerificationTotalCount int64 `json:"merge_request_diffs_verification_total_count"` + MergeRequestDiffsVerifiedCount int64 `json:"merge_request_diffs_verified_count"` + MergeRequestDiffsVerificationFailedCount int64 `json:"merge_request_diffs_verification_failed_count"` + PackageFilesCount int64 `json:"package_files_count"` + PackageFilesChecksumTotalCount int64 `json:"package_files_checksum_total_count"` + PackageFilesChecksummedCount int64 `json:"package_files_checksummed_count"` + PackageFilesChecksumFailedCount int64 `json:"package_files_checksum_failed_count"` + PackageFilesSyncedCount int64 `json:"package_files_synced_count"` + PackageFilesFailedCount int64 `json:"package_files_failed_count"` + PackageFilesRegistryCount int64 `json:"package_files_registry_count"` + PackageFilesVerificationTotalCount int64 `json:"package_files_verification_total_count"` + PackageFilesVerifiedCount int64 `json:"package_files_verified_count"` + PackageFilesVerificationFailedCount int64 `json:"package_files_verification_failed_count"` + TerraformStateVersionsCount int64 `json:"terraform_state_versions_count"` + TerraformStateVersionsChecksumTotalCount int64 `json:"terraform_state_versions_checksum_total_count"` + TerraformStateVersionsChecksummedCount int64 `json:"terraform_state_versions_checksummed_count"` + TerraformStateVersionsChecksumFailedCount int64 `json:"terraform_state_versions_checksum_failed_count"` + TerraformStateVersionsSyncedCount int64 `json:"terraform_state_versions_synced_count"` + TerraformStateVersionsFailedCount int64 `json:"terraform_state_versions_failed_count"` + TerraformStateVersionsRegistryCount int64 `json:"terraform_state_versions_registry_count"` + TerraformStateVersionsVerificationTotalCount int64 `json:"terraform_state_versions_verification_total_count"` + TerraformStateVersionsVerifiedCount int64 `json:"terraform_state_versions_verified_count"` + TerraformStateVersionsVerificationFailedCount int64 `json:"terraform_state_versions_verification_failed_count"` + SnippetRepositoriesCount int64 `json:"snippet_repositories_count"` + SnippetRepositoriesChecksumTotalCount int64 `json:"snippet_repositories_checksum_total_count"` + SnippetRepositoriesChecksummedCount int64 `json:"snippet_repositories_checksummed_count"` + SnippetRepositoriesChecksumFailedCount int64 `json:"snippet_repositories_checksum_failed_count"` + SnippetRepositoriesSyncedCount int64 `json:"snippet_repositories_synced_count"` + SnippetRepositoriesFailedCount int64 `json:"snippet_repositories_failed_count"` + SnippetRepositoriesRegistryCount int64 `json:"snippet_repositories_registry_count"` + SnippetRepositoriesVerificationTotalCount int64 `json:"snippet_repositories_verification_total_count"` + SnippetRepositoriesVerifiedCount int64 `json:"snippet_repositories_verified_count"` + SnippetRepositoriesVerificationFailedCount int64 `json:"snippet_repositories_verification_failed_count"` + GroupWikiRepositoriesCount int64 `json:"group_wiki_repositories_count"` + GroupWikiRepositoriesChecksumTotalCount int64 `json:"group_wiki_repositories_checksum_total_count"` + GroupWikiRepositoriesChecksummedCount int64 `json:"group_wiki_repositories_checksummed_count"` + GroupWikiRepositoriesChecksumFailedCount int64 `json:"group_wiki_repositories_checksum_failed_count"` + GroupWikiRepositoriesSyncedCount int64 `json:"group_wiki_repositories_synced_count"` + GroupWikiRepositoriesFailedCount int64 `json:"group_wiki_repositories_failed_count"` + GroupWikiRepositoriesRegistryCount int64 `json:"group_wiki_repositories_registry_count"` + GrupWikiRepositoriesVerificationTotalCount int64 `json:"group_wiki_repositories_verification_total_count"` + GroupWikiRepositoriesVerifiedCount int64 `json:"group_wiki_repositories_verified_count"` + GroupWikiRepositoriesVerificationFailedCount int64 `json:"group_wiki_repositories_verification_failed_count"` + PipelineArtifactsCount int64 `json:"pipeline_artifacts_count"` + PipelineArtifactsChecksumTotalCount int64 `json:"pipeline_artifacts_checksum_total_count"` + PipelineArtifactsChecksummedCount int64 `json:"pipeline_artifacts_checksummed_count"` + PipelineArtifactsChecksumFailedCount int64 `json:"pipeline_artifacts_checksum_failed_count"` + PipelineArtifactsSyncedCount int64 `json:"pipeline_artifacts_synced_count"` + PipelineArtifactsFailedCount int64 `json:"pipeline_artifacts_failed_count"` + PipelineArtifactsRegistryCount int64 `json:"pipeline_artifacts_registry_count"` + PipelineArtifactsVerificationTotalCount int64 `json:"pipeline_artifacts_verification_total_count"` + PipelineArtifactsVerifiedCount int64 `json:"pipeline_artifacts_verified_count"` + PipelineArtifactsVerificationFailedCount int64 `json:"pipeline_artifacts_verification_failed_count"` + PagesDeploymentsCount int64 `json:"pages_deployments_count"` + PagesDeploymentsChecksumTotalCount int64 `json:"pages_deployments_checksum_total_count"` + PagesDeploymentsChecksummedCount int64 `json:"pages_deployments_checksummed_count"` + PagesDeploymentsChecksumFailedCount int64 `json:"pages_deployments_checksum_failed_count"` + PagesDeploymentsSyncedCount int64 `json:"pages_deployments_synced_count"` + PagesDeploymentsFailedCount int64 `json:"pages_deployments_failed_count"` + PagesDeploymentsRegistryCount int64 `json:"pages_deployments_registry_count"` + PagesDeploymentsVerificationTotalCount int64 `json:"pages_deployments_verification_total_count"` + PagesDeploymentsVerifiedCount int64 `json:"pages_deployments_verified_count"` + PagesDeploymentsVerificationFailedCount int64 `json:"pages_deployments_verification_failed_count"` + UploadsCount int64 `json:"uploads_count"` + UploadsChecksumTotalCount int64 `json:"uploads_checksum_total_count"` + UploadsChecksummedCount int64 `json:"uploads_checksummed_count"` + UploadsChecksumFailedCount int64 `json:"uploads_checksum_failed_count"` + UploadsSyncedCount int64 `json:"uploads_synced_count"` + UploadsFailedCount int64 `json:"uploads_failed_count"` + UploadsRegistryCount int64 `json:"uploads_registry_count"` + UploadsVerificationTotalCount int64 `json:"uploads_verification_total_count"` + UploadsVerifiedCount int64 `json:"uploads_verified_count"` + UploadsVerificationFailedCount int64 `json:"uploads_verification_failed_count"` + JobArtifactsCount int64 `json:"job_artifacts_count"` + JobArtifactsChecksumTotalCount int64 `json:"job_artifacts_checksum_total_count"` + JobArtifactsChecksummedCount int64 `json:"job_artifacts_checksummed_count"` + JobArtifactsChecksumFailedCount int64 `json:"job_artifacts_checksum_failed_count"` + JobArtifactsSyncedCount int64 `json:"job_artifacts_synced_count"` + JobArtifactsFailedCount int64 `json:"job_artifacts_failed_count"` + JobArtifactsRegistryCount int64 `json:"job_artifacts_registry_count"` + JobArtifactsVerificationTotalCount int64 `json:"job_artifacts_verification_total_count"` + JobArtifactsVerifiedCount int64 `json:"job_artifacts_verified_count"` + JobArtifactsVerificationFailedCount int64 `json:"job_artifacts_verification_failed_count"` + CISecureFilesCount int64 `json:"ci_secure_files_count"` + CISecureFilesChecksumTotalCount int64 `json:"ci_secure_files_checksum_total_count"` + CISecureFilesChecksummedCount int64 `json:"ci_secure_files_checksummed_count"` + CISecureFilesChecksumFailedCount int64 `json:"ci_secure_files_checksum_failed_count"` + CISecureFilesSyncedCount int64 `json:"ci_secure_files_synced_count"` + CISecureFilesFailedCount int64 `json:"ci_secure_files_failed_count"` + CISecureFilesRegistryCount int64 `json:"ci_secure_files_registry_count"` + CISecureFilesVerificationTotalCount int64 `json:"ci_secure_files_verification_total_count"` + CISecureFilesVerifiedCount int64 `json:"ci_secure_files_verified_count"` + CISecureFilesVerificationFailedCount int64 `json:"ci_secure_files_verification_failed_count"` + ContainerRepositoriesCount int64 `json:"container_repositories_count"` + ContainerRepositoriesChecksumTotalCount int64 `json:"container_repositories_checksum_total_count"` + ContainerRepositoriesChecksummedCount int64 `json:"container_repositories_checksummed_count"` + ContainerRepositoriesChecksumFailedCount int64 `json:"container_repositories_checksum_failed_count"` + ContainerRepositoriesSyncedCount int64 `json:"container_repositories_synced_count"` + ContainerRepositoriesFailedCount int64 `json:"container_repositories_failed_count"` + ContainerRepositoriesRegistryCount int64 `json:"container_repositories_registry_count"` + ContainerRepositoriesVerificationTotalCount int64 `json:"container_repositories_verification_total_count"` + ContainerRepositoriesVerifiedCount int64 `json:"container_repositories_verified_count"` + ContainerRepositoriesVerificationFailedCount int64 `json:"container_repositories_verification_failed_count"` + DependencyProxyBlobsCount int64 `json:"dependency_proxy_blobs_count"` + DependencyProxyBlobsChecksumTotalCount int64 `json:"dependency_proxy_blobs_checksum_total_count"` + DependencyProxyBlobsChecksummedCount int64 `json:"dependency_proxy_blobs_checksummed_count"` + DependencyProxyBlobsChecksumFailedCount int64 `json:"dependency_proxy_blobs_checksum_failed_count"` + DependencyProxyBlobsSyncedCount int64 `json:"dependency_proxy_blobs_synced_count"` + DependencyProxyBlobsFailedCount int64 `json:"dependency_proxy_blobs_failed_count"` + DependencyProxyBlobsRegistryCount int64 `json:"dependency_proxy_blobs_registry_count"` + DependencyProxyBlobsVerificationTotalCount int64 `json:"dependency_proxy_blobs_verification_total_count"` + DependencyProxyBlobsVerifiedCount int64 `json:"dependency_proxy_blobs_verified_count"` + DependencyProxyBlobsVerificationFailedCount int64 `json:"dependency_proxy_blobs_verification_failed_count"` + DependencyProxyManifestsCount int64 `json:"dependency_proxy_manifests_count"` + DependencyProxyManifestsChecksumTotalCount int64 `json:"dependency_proxy_manifests_checksum_total_count"` + DependencyProxyManifestsChecksummedCount int64 `json:"dependency_proxy_manifests_checksummed_count"` + DependencyProxyManifestsChecksumFailedCount int64 `json:"dependency_proxy_manifests_checksum_failed_count"` + DependencyProxyManifestsSyncedCount int64 `json:"dependency_proxy_manifests_synced_count"` + DependencyProxyManifestsFailedCount int64 `json:"dependency_proxy_manifests_failed_count"` + DependencyProxyManifestsRegistryCount int64 `json:"dependency_proxy_manifests_registry_count"` + DependencyProxyManifestsVerificationTotalCount int64 `json:"dependency_proxy_manifests_verification_total_count"` + DependencyProxyManifestsVerifiedCount int64 `json:"dependency_proxy_manifests_verified_count"` + DependencyProxyManifestsVerificationFailedCount int64 `json:"dependency_proxy_manifests_verification_failed_count"` + ProjectWikiRepositoriesCount int64 `json:"project_wiki_repositories_count"` + ProjectWikiRepositoriesChecksumTotalCount int64 `json:"project_wiki_repositories_checksum_total_count"` + ProjectWikiRepositoriesChecksummedCount int64 `json:"project_wiki_repositories_checksummed_count"` + ProjectWikiRepositoriesChecksumFailedCount int64 `json:"project_wiki_repositories_checksum_failed_count"` + ProjectWikiRepositoriesSyncedCount int64 `json:"project_wiki_repositories_synced_count"` + ProjectWikiRepositoriesFailedCount int64 `json:"project_wiki_repositories_failed_count"` + ProjectWikiRepositoriesRegistryCount int64 `json:"project_wiki_repositories_registry_count"` + ProjectWikiRepositoriesVerificationTotalCount int64 `json:"project_wiki_repositories_verification_total_count"` + ProjectWikiRepositoriesVerifiedCount int64 `json:"project_wiki_repositories_verified_count"` + ProjectWikiRepositoriesVerificationFailedCount int64 `json:"project_wiki_repositories_verification_failed_count"` + GitFetchEventCountWeekly int64 `json:"git_fetch_event_count_weekly"` + GitPushEventCountWeekly int64 `json:"git_push_event_count_weekly"` + ProxyRemoteRequestsEventCountWeekly int64 `json:"proxy_remote_requests_event_count_weekly"` + ProxyLocalRequestsEventCountWeekly int64 `json:"proxy_local_requests_event_count_weekly"` RepositoriesCheckedInPercentage string `json:"repositories_checked_in_percentage"` ReplicationSlotsUsedInPercentage string `json:"replication_slots_used_in_percentage"` LFSObjectsSyncedInPercentage string `json:"lfs_objects_synced_in_percentage"` @@ -390,21 +392,21 @@ type GeoSiteStatus struct { DependencyProxyManifestsVerifiedInPercentage string `json:"dependency_proxy_manifests_verified_in_percentage"` ProjectWikiRepositoriesSyncedInPercentage string `json:"project_wiki_repositories_synced_in_percentage"` ProjectWikiRepositoriesVerifiedInPercentage string `json:"project_wiki_repositories_verified_in_percentage"` - ReplicationSlotsCount int `json:"replication_slots_count"` - ReplicationSlotsUsedCount int `json:"replication_slots_used_count"` + ReplicationSlotsCount int64 `json:"replication_slots_count"` + ReplicationSlotsUsedCount int64 `json:"replication_slots_used_count"` Healthy bool `json:"healthy"` Health string `json:"health"` HealthStatus string `json:"health_status"` MissingOAuthApplication bool `json:"missing_oauth_application"` - DBReplicationLagSeconds int `json:"db_replication_lag_seconds"` - ReplicationSlotsMaxRetainedWalBytes int `json:"replication_slots_max_retained_wal_bytes"` - RepositoriesCheckedCount int `json:"repositories_checked_count"` - RepositoriesCheckedFailedCount int `json:"repositories_checked_failed_count"` - LastEventID int `json:"last_event_id"` - LastEventTimestamp int `json:"last_event_timestamp"` - CursorLastEventID int `json:"cursor_last_event_id"` - CursorLastEventTimestamp int `json:"cursor_last_event_timestamp"` - LastSuccessfulStatusCheckTimestamp int `json:"last_successful_status_check_timestamp"` + DBReplicationLagSeconds int64 `json:"db_replication_lag_seconds"` + ReplicationSlotsMaxRetainedWalBytes int64 `json:"replication_slots_max_retained_wal_bytes"` + RepositoriesCheckedCount int64 `json:"repositories_checked_count"` + RepositoriesCheckedFailedCount int64 `json:"repositories_checked_failed_count"` + LastEventID int64 `json:"last_event_id"` + LastEventTimestamp int64 `json:"last_event_timestamp"` + CursorLastEventID int64 `json:"cursor_last_event_id"` + CursorLastEventTimestamp int64 `json:"cursor_last_event_timestamp"` + LastSuccessfulStatusCheckTimestamp int64 `json:"last_successful_status_check_timestamp"` Version string `json:"version"` Revision string `json:"revision"` SelectiveSyncType string `json:"selective_sync_type"` @@ -427,7 +429,9 @@ type GeoSiteStatusLink struct { // // GitLab API docs: // https://docs.gitlab.com/api/geo_sites/#retrieve-status-about-all-geo-sites -type ListStatusOfAllGeoSitesOptions ListOptions +type ListStatusOfAllGeoSitesOptions struct { + ListOptions +} // ListStatusOfAllGeoSites get the list of status of all Geo Sites. // @@ -445,7 +449,7 @@ func (s *GeoSitesService) ListStatusOfAllGeoSites(opt *ListStatusOfAllGeoSitesOp // // GitLab API docs: // https://docs.gitlab.com/api/geo_sites/#retrieve-status-about-a-specific-geo-site -func (s *GeoSitesService) GetStatusOfGeoSite(id int, options ...RequestOptionFunc) (*GeoSiteStatus, *Response, error) { +func (s *GeoSitesService) GetStatusOfGeoSite(id int64, options ...RequestOptionFunc) (*GeoSiteStatus, *Response, error) { return do[*GeoSiteStatus](s.client, withPath("geo_sites/%d/status", id), withRequestOpts(options...), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/gitignore_templates.go b/vendor/gitlab.com/gitlab-org/api/client-go/gitignore_templates.go index 9817c8f35..44b9b4778 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/gitignore_templates.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/gitignore_templates.go @@ -54,7 +54,9 @@ type GitIgnoreTemplateListItem struct { // // GitLab API docs: // https://docs.gitlab.com/api/templates/gitignores/#get-all-gitignore-templates -type ListTemplatesOptions ListOptions +type ListTemplatesOptions struct { + ListOptions +} // ListTemplates get a list of available git ignore templates // diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/gitlab.go b/vendor/gitlab.com/gitlab-org/api/client-go/gitlab.go index d4b4d1571..b391cb1ab 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/gitlab.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/gitlab.go @@ -50,11 +50,11 @@ const ( apiVersionPath = "api/v4/" userAgent = "go-gitlab" - headerRateLimit = "RateLimit-Limit" - headerRateReset = "RateLimit-Reset" + headerRateLimit = "Ratelimit-Limit" + headerRateReset = "Ratelimit-Reset" - AccessTokenHeaderName = "PRIVATE-TOKEN" - JobTokenHeaderName = "JOB-TOKEN" + AccessTokenHeaderName = "Private-Token" + JobTokenHeaderName = "Job-Token" ) // AuthType represents an authentication type within GitLab. @@ -119,10 +119,12 @@ type Client struct { // Services used for talking to different parts of the GitLab API. AccessRequests AccessRequestsServiceInterface + AdminCompliancePolicySettings AdminCompliancePolicySettingsServiceInterface AlertManagement AlertManagementServiceInterface Appearance AppearanceServiceInterface Applications ApplicationsServiceInterface ApplicationStatistics ApplicationStatisticsServiceInterface + Attestations AttestationsServiceInterface AuditEvents AuditEventsServiceInterface Avatar AvatarRequestsServiceInterface AwardEmoji AwardEmojiServiceInterface @@ -166,6 +168,7 @@ type Client struct { GroupActivityAnalytics GroupActivityAnalyticsServiceInterface GroupBadges GroupBadgesServiceInterface GroupCluster GroupClustersServiceInterface + GroupCredentials GroupCredentialsServiceInterface GroupEpicBoards GroupEpicBoardsServiceInterface GroupImportExport GroupImportExportServiceInterface Integrations IntegrationsServiceInterface @@ -252,6 +255,8 @@ type Client struct { ResourceMilestoneEvents ResourceMilestoneEventsServiceInterface ResourceStateEvents ResourceStateEventsServiceInterface ResourceWeightEvents ResourceWeightEventsServiceInterface + RunnerControllers RunnerControllersServiceInterface + RunnerControllerTokens RunnerControllerTokensServiceInterface Runners RunnersServiceInterface Search SearchServiceInterface SecureFiles SecureFilesServiceInterface @@ -304,9 +309,9 @@ type ListOptions struct { // For keyset-based paginated result sets, the value must be `"keyset"` Pagination string `url:"pagination,omitempty" json:"pagination,omitempty"` // For offset-based and keyset-based paginated result sets, the number of results to include per page. - PerPage int `url:"per_page,omitempty" json:"per_page,omitempty"` + PerPage int64 `url:"per_page,omitempty" json:"per_page,omitempty"` // For offset-based paginated result sets, page of results to retrieve. - Page int `url:"page,omitempty" json:"page,omitempty"` + Page int64 `url:"page,omitempty" json:"page,omitempty"` // For keyset-based paginated result sets, tree record ID at which to fetch the next page. PageToken string `url:"page_token,omitempty" json:"page_token,omitempty"` // For keyset-based paginated result sets, name of the column by which to order @@ -432,10 +437,12 @@ func NewAuthSourceClient(as AuthSource, options ...ClientOptionFunc) (*Client, e // Create all the public services. c.AccessRequests = &AccessRequestsService{client: c} + c.AdminCompliancePolicySettings = &AdminCompliancePolicySettingsService{client: c} c.AlertManagement = &AlertManagementService{client: c} c.Appearance = &AppearanceService{client: c} c.Applications = &ApplicationsService{client: c} c.ApplicationStatistics = &ApplicationStatisticsService{client: c} + c.Attestations = &AttestationsService{client: c} c.AuditEvents = &AuditEventsService{client: c} c.Avatar = &AvatarRequestsService{client: c} c.AwardEmoji = &AwardEmojiService{client: c} @@ -479,6 +486,7 @@ func NewAuthSourceClient(as AuthSource, options ...ClientOptionFunc) (*Client, e c.GroupActivityAnalytics = &GroupActivityAnalyticsService{client: c} c.GroupBadges = &GroupBadgesService{client: c} c.GroupCluster = &GroupClustersService{client: c} + c.GroupCredentials = &GroupCredentialsService{client: c} c.GroupEpicBoards = &GroupEpicBoardsService{client: c} c.GroupImportExport = &GroupImportExportService{client: c} c.Integrations = &IntegrationsService{client: c} @@ -565,6 +573,8 @@ func NewAuthSourceClient(as AuthSource, options ...ClientOptionFunc) (*Client, e c.ResourceMilestoneEvents = &ResourceMilestoneEventsService{client: c} c.ResourceStateEvents = &ResourceStateEventsService{client: c} c.ResourceWeightEvents = &ResourceWeightEventsService{client: c} + c.RunnerControllers = &RunnerControllersService{client: c} + c.RunnerControllerTokens = &RunnerControllerTokensService{client: c} c.Runners = &RunnersService{client: c} c.Search = &SearchService{client: c} c.SecureFiles = &SecureFilesService{client: c} @@ -719,7 +729,7 @@ func (c *Client) retryHTTPBackoff(min, max time.Duration, attemptNum int, resp * } // rateLimitBackoff provides a callback for Client.Backoff which will use the -// RateLimit-Reset header to determine the time to wait. We add some jitter +// Ratelimit-Reset header to determine the time to wait. We add some jitter // to prevent a thundering herd. // // min and max are mainly used for bounding the jitter that will be added to @@ -741,7 +751,7 @@ func rateLimitBackoff(min, max time.Duration, attemptNum int, resp *http.Respons } } } else { - // In case the RateLimit-Reset header is not set, back off an additional + // In case the Ratelimit-Reset header is not set, back off an additional // 100% exponentially. With the default milliseconds being set to 100 for // `min`, this makes the 5th retry wait 3.2 seconds (3,200 ms) by default. min = time.Duration(float64(min) * math.Pow(2, float64(attemptNum))) @@ -963,12 +973,12 @@ type Response struct { *http.Response // Fields used for offset-based pagination. - TotalItems int - TotalPages int - ItemsPerPage int - CurrentPage int - NextPage int - PreviousPage int + TotalItems int64 + TotalPages int64 + ItemsPerPage int64 + CurrentPage int64 + NextPage int64 + PreviousPage int64 // Fields used for keyset-based pagination. PreviousLink string @@ -1005,28 +1015,28 @@ const ( // various pagination link values in the Response. func (r *Response) populatePageValues() { if totalItems := r.Header.Get(xTotal); totalItems != "" { - r.TotalItems, _ = strconv.Atoi(totalItems) + r.TotalItems, _ = strconv.ParseInt(totalItems, 10, 64) } if totalPages := r.Header.Get(xTotalPages); totalPages != "" { - r.TotalPages, _ = strconv.Atoi(totalPages) + r.TotalPages, _ = strconv.ParseInt(totalPages, 10, 64) } if itemsPerPage := r.Header.Get(xPerPage); itemsPerPage != "" { - r.ItemsPerPage, _ = strconv.Atoi(itemsPerPage) + r.ItemsPerPage, _ = strconv.ParseInt(itemsPerPage, 10, 64) } if currentPage := r.Header.Get(xPage); currentPage != "" { - r.CurrentPage, _ = strconv.Atoi(currentPage) + r.CurrentPage, _ = strconv.ParseInt(currentPage, 10, 64) } if nextPage := r.Header.Get(xNextPage); nextPage != "" { - r.NextPage, _ = strconv.Atoi(nextPage) + r.NextPage, _ = strconv.ParseInt(nextPage, 10, 64) } if previousPage := r.Header.Get(xPrevPage); previousPage != "" { - r.PreviousPage, _ = strconv.Atoi(previousPage) + r.PreviousPage, _ = strconv.ParseInt(previousPage, 10, 64) } } func (r *Response) populateLinkValues() { if link := r.Header.Get("Link"); link != "" { - for _, link := range strings.Split(link, ",") { + for link := range strings.SplitSeq(link, ",") { parts := strings.Split(link, ";") if len(parts) < 2 { continue @@ -1141,6 +1151,8 @@ func parseID(id any) (string, error) { switch v := id.(type) { case int: return strconv.Itoa(v), nil + case int64: + return strconv.FormatInt(v, 10), nil case string: return v, nil default: diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_access_tokens.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_access_tokens.go index 08946643d..e4cde050b 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_access_tokens.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_access_tokens.go @@ -17,7 +17,6 @@ package gitlab import ( - "fmt" "net/http" ) @@ -25,11 +24,11 @@ type ( // GroupAccessTokensServiceInterface defines all the API methods for the GroupAccessTokensService GroupAccessTokensServiceInterface interface { ListGroupAccessTokens(gid any, opt *ListGroupAccessTokensOptions, options ...RequestOptionFunc) ([]*GroupAccessToken, *Response, error) - GetGroupAccessToken(gid any, id int, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) + GetGroupAccessToken(gid any, id int64, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) CreateGroupAccessToken(gid any, opt *CreateGroupAccessTokenOptions, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) - RotateGroupAccessToken(gid any, id int, opt *RotateGroupAccessTokenOptions, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) + RotateGroupAccessToken(gid any, id int64, opt *RotateGroupAccessTokenOptions, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) RotateGroupAccessTokenSelf(gid any, opt *RotateGroupAccessTokenOptions, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) - RevokeGroupAccessToken(gid any, id int, options ...RequestOptionFunc) (*Response, error) + RevokeGroupAccessToken(gid any, id int64, options ...RequestOptionFunc) (*Response, error) } // GroupAccessTokensService handles communication with the @@ -75,49 +74,25 @@ type ListGroupAccessTokensOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_access_tokens/#list-all-group-access-tokens func (s *GroupAccessTokensService) ListGroupAccessTokens(gid any, opt *ListGroupAccessTokensOptions, options ...RequestOptionFunc) ([]*GroupAccessToken, *Response, error) { - groups, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/access_tokens", PathEscape(groups)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var gats []*GroupAccessToken - resp, err := s.client.Do(req, &gats) - if err != nil { - return nil, resp, err - } - - return gats, resp, nil + return do[[]*GroupAccessToken](s.client, + withMethod(http.MethodGet), + withPath("groups/%s/access_tokens", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // GetGroupAccessToken gets a single group access tokens in a group. // // GitLab API docs: // https://docs.gitlab.com/api/group_access_tokens/#get-details-on-a-group-access-token -func (s *GroupAccessTokensService) GetGroupAccessToken(gid any, id int, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) { - groups, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/access_tokens/%d", PathEscape(groups), id) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - gat := new(GroupAccessToken) - resp, err := s.client.Do(req, &gat) - if err != nil { - return nil, resp, err - } - - return gat, resp, nil +func (s *GroupAccessTokensService) GetGroupAccessToken(gid any, id int64, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) { + return do[*GroupAccessToken](s.client, + withMethod(http.MethodGet), + withPath("groups/%s/access_tokens/%d", GroupID{gid}, id), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // CreateGroupAccessTokenOptions represents the available CreateVariable() @@ -138,24 +113,12 @@ type CreateGroupAccessTokenOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_access_tokens/#create-a-group-access-token func (s *GroupAccessTokensService) CreateGroupAccessToken(gid any, opt *CreateGroupAccessTokenOptions, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) { - groups, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/access_tokens", PathEscape(groups)) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - pat := new(GroupAccessToken) - resp, err := s.client.Do(req, pat) - if err != nil { - return nil, resp, err - } - - return pat, resp, nil + return do[*GroupAccessToken](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/access_tokens", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // RotateGroupAccessTokenOptions represents the available RotateGroupAccessToken() @@ -172,24 +135,13 @@ type RotateGroupAccessTokenOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_access_tokens/#rotate-a-group-access-token -func (s *GroupAccessTokensService) RotateGroupAccessToken(gid any, id int, opt *RotateGroupAccessTokenOptions, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) { - groups, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/access_tokens/%d/rotate", PathEscape(groups), id) - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - gat := new(GroupAccessToken) - resp, err := s.client.Do(req, gat) - if err != nil { - return nil, resp, err - } - - return gat, resp, nil +func (s *GroupAccessTokensService) RotateGroupAccessToken(gid any, id int64, opt *RotateGroupAccessTokenOptions, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) { + return do[*GroupAccessToken](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/access_tokens/%d/rotate", GroupID{gid}, id), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // RotateGroupAccessTokenSelf revokes the group access token used for the request @@ -198,40 +150,24 @@ func (s *GroupAccessTokensService) RotateGroupAccessToken(gid any, id int, opt * // GitLab API docs: // https://docs.gitlab.com/api/group_access_tokens/#self-rotate func (s *GroupAccessTokensService) RotateGroupAccessTokenSelf(gid any, opt *RotateGroupAccessTokenOptions, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) { - groups, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/access_tokens/self/rotate", PathEscape(groups)) - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - gat := new(GroupAccessToken) - resp, err := s.client.Do(req, gat) - if err != nil { - return nil, resp, err - } - - return gat, resp, nil + return do[*GroupAccessToken](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/access_tokens/self/rotate", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // RevokeGroupAccessToken revokes a group access token. // // GitLab API docs: // https://docs.gitlab.com/api/group_access_tokens/#revoke-a-group-access-token -func (s *GroupAccessTokensService) RevokeGroupAccessToken(gid any, id int, options ...RequestOptionFunc) (*Response, error) { - groups, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/access_tokens/%d", PathEscape(groups), id) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *GroupAccessTokensService) RevokeGroupAccessToken(gid any, id int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("groups/%s/access_tokens/%d", GroupID{gid}, id), + withAPIOpts(nil), + withRequestOpts(options...), + ) + return resp, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_activity_analytics.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_activity_analytics.go index 9824f4d63..ad24616be 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_activity_analytics.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_activity_analytics.go @@ -39,7 +39,7 @@ var _ GroupActivityAnalyticsServiceInterface = (*GroupActivityAnalyticsService)( // GitLab API docs: // https://docs.gitlab.com/api/group_activity_analytics/#get-count-of-recently-created-issues-for-group type IssuesCount struct { - IssuesCount int `url:"issues_count" json:"issues_count"` + IssuesCount int64 `url:"issues_count" json:"issues_count"` } // GetRecentlyCreatedIssuesCountOptions represents the available @@ -56,19 +56,12 @@ type GetRecentlyCreatedIssuesCountOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_activity_analytics/#get-count-of-recently-created-issues-for-group func (s *GroupActivityAnalyticsService) GetRecentlyCreatedIssuesCount(opt *GetRecentlyCreatedIssuesCountOptions, options ...RequestOptionFunc) (*IssuesCount, *Response, error) { - u := "analytics/group_activity/issues_count" - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - res := new(IssuesCount) - resp, err := s.client.Do(req, res) - if err != nil { - return nil, resp, err - } - - return res, resp, nil + return do[*IssuesCount](s.client, + withMethod(http.MethodGet), + withPath("analytics/group_activity/issues_count"), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // MergeRequestsCount represents the total count of recently created merge requests @@ -77,7 +70,7 @@ func (s *GroupActivityAnalyticsService) GetRecentlyCreatedIssuesCount(opt *GetRe // GitLab API docs: // https://docs.gitlab.com/api/group_activity_analytics/#get-count-of-recently-created-merge-requests-for-group type MergeRequestsCount struct { - MergeRequestsCount int `url:"merge_requests_count" json:"merge_requests_count"` + MergeRequestsCount int64 `url:"merge_requests_count" json:"merge_requests_count"` } // GetRecentlyCreatedMergeRequestsCountOptions represents the available @@ -95,19 +88,12 @@ type GetRecentlyCreatedMergeRequestsCountOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_activity_analytics/#get-count-of-recently-created-merge-requests-for-group func (s *GroupActivityAnalyticsService) GetRecentlyCreatedMergeRequestsCount(opt *GetRecentlyCreatedMergeRequestsCountOptions, options ...RequestOptionFunc) (*MergeRequestsCount, *Response, error) { - u := "analytics/group_activity/merge_requests_count" - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - res := new(MergeRequestsCount) - resp, err := s.client.Do(req, res) - if err != nil { - return nil, resp, err - } - - return res, resp, nil + return do[*MergeRequestsCount](s.client, + withMethod(http.MethodGet), + withPath("analytics/group_activity/merge_requests_count"), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // NewMembersCount represents the total count of recently added members to a group. @@ -115,7 +101,7 @@ func (s *GroupActivityAnalyticsService) GetRecentlyCreatedMergeRequestsCount(opt // GitLab API docs: // https://docs.gitlab.com/api/group_activity_analytics/#get-count-of-members-recently-added-to-group type NewMembersCount struct { - NewMembersCount int `url:"new_members_count" json:"new_members_count"` + NewMembersCount int64 `url:"new_members_count" json:"new_members_count"` } // GetRecentlyAddedMembersCountOptions represents the available @@ -132,17 +118,10 @@ type GetRecentlyAddedMembersCountOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_activity_analytics/#get-count-of-members-recently-added-to-group func (s *GroupActivityAnalyticsService) GetRecentlyAddedMembersCount(opt *GetRecentlyAddedMembersCountOptions, options ...RequestOptionFunc) (*NewMembersCount, *Response, error) { - u := "analytics/group_activity/new_members_count" - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - res := new(NewMembersCount) - resp, err := s.client.Do(req, res) - if err != nil { - return nil, resp, err - } - - return res, resp, nil + return do[*NewMembersCount](s.client, + withMethod(http.MethodGet), + withPath("analytics/group_activity/new_members_count"), + withAPIOpts(opt), + withRequestOpts(options...), + ) } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_badges.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_badges.go index b56c58264..39d639ce8 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_badges.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_badges.go @@ -25,10 +25,10 @@ type ( // GroupBadgesServiceInterface defines all the API methods for the GroupBadgesService GroupBadgesServiceInterface interface { ListGroupBadges(gid any, opt *ListGroupBadgesOptions, options ...RequestOptionFunc) ([]*GroupBadge, *Response, error) - GetGroupBadge(gid any, badge int, options ...RequestOptionFunc) (*GroupBadge, *Response, error) + GetGroupBadge(gid any, badge int64, options ...RequestOptionFunc) (*GroupBadge, *Response, error) AddGroupBadge(gid any, opt *AddGroupBadgeOptions, options ...RequestOptionFunc) (*GroupBadge, *Response, error) - EditGroupBadge(gid any, badge int, opt *EditGroupBadgeOptions, options ...RequestOptionFunc) (*GroupBadge, *Response, error) - DeleteGroupBadge(gid any, badge int, options ...RequestOptionFunc) (*Response, error) + EditGroupBadge(gid any, badge int64, opt *EditGroupBadgeOptions, options ...RequestOptionFunc) (*GroupBadge, *Response, error) + DeleteGroupBadge(gid any, badge int64, options ...RequestOptionFunc) (*Response, error) PreviewGroupBadge(gid any, opt *GroupBadgePreviewOptions, options ...RequestOptionFunc) (*GroupBadge, *Response, error) } @@ -57,7 +57,7 @@ const ( // GitLab API docs: // https://docs.gitlab.com/api/group_badges/ type GroupBadge struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` LinkURL string `json:"link_url"` ImageURL string `json:"image_url"` @@ -104,7 +104,7 @@ func (s *GroupBadgesService) ListGroupBadges(gid any, opt *ListGroupBadgesOption // // GitLab API docs: // https://docs.gitlab.com/api/group_badges/#get-a-badge-of-a-group -func (s *GroupBadgesService) GetGroupBadge(gid any, badge int, options ...RequestOptionFunc) (*GroupBadge, *Response, error) { +func (s *GroupBadgesService) GetGroupBadge(gid any, badge int64, options ...RequestOptionFunc) (*GroupBadge, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -174,7 +174,7 @@ type EditGroupBadgeOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_badges/#edit-a-badge-of-a-group -func (s *GroupBadgesService) EditGroupBadge(gid any, badge int, opt *EditGroupBadgeOptions, options ...RequestOptionFunc) (*GroupBadge, *Response, error) { +func (s *GroupBadgesService) EditGroupBadge(gid any, badge int64, opt *EditGroupBadgeOptions, options ...RequestOptionFunc) (*GroupBadge, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -199,7 +199,7 @@ func (s *GroupBadgesService) EditGroupBadge(gid any, badge int, opt *EditGroupBa // // GitLab API docs: // https://docs.gitlab.com/api/group_badges/#remove-a-badge-from-a-group -func (s *GroupBadgesService) DeleteGroupBadge(gid any, badge int, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupBadgesService) DeleteGroupBadge(gid any, badge int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_boards.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_boards.go index c5d7e77d2..efa293503 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_boards.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_boards.go @@ -17,7 +17,6 @@ package gitlab import ( - "fmt" "net/http" ) @@ -25,14 +24,14 @@ type ( GroupIssueBoardsServiceInterface interface { ListGroupIssueBoards(gid any, opt *ListGroupIssueBoardsOptions, options ...RequestOptionFunc) ([]*GroupIssueBoard, *Response, error) CreateGroupIssueBoard(gid any, opt *CreateGroupIssueBoardOptions, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) - GetGroupIssueBoard(gid any, board int, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) - UpdateIssueBoard(gid any, board int, opt *UpdateGroupIssueBoardOptions, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) - DeleteIssueBoard(gid any, board int, options ...RequestOptionFunc) (*Response, error) - ListGroupIssueBoardLists(gid any, board int, opt *ListGroupIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) - GetGroupIssueBoardList(gid any, board, list int, options ...RequestOptionFunc) (*BoardList, *Response, error) - CreateGroupIssueBoardList(gid any, board int, opt *CreateGroupIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) - UpdateIssueBoardList(gid any, board, list int, opt *UpdateGroupIssueBoardListOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) - DeleteGroupIssueBoardList(gid any, board, list int, options ...RequestOptionFunc) (*Response, error) + GetGroupIssueBoard(gid any, board int64, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) + UpdateIssueBoard(gid any, board int64, opt *UpdateGroupIssueBoardOptions, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) + DeleteIssueBoard(gid any, board int64, options ...RequestOptionFunc) (*Response, error) + ListGroupIssueBoardLists(gid any, board int64, opt *ListGroupIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) + GetGroupIssueBoardList(gid any, board, list int64, options ...RequestOptionFunc) (*BoardList, *Response, error) + CreateGroupIssueBoardList(gid any, board int64, opt *CreateGroupIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) + UpdateIssueBoardList(gid any, board, list int64, opt *UpdateGroupIssueBoardListOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) + DeleteGroupIssueBoardList(gid any, board, list int64, options ...RequestOptionFunc) (*Response, error) } // GroupIssueBoardsService handles communication with the group issue board @@ -52,7 +51,7 @@ var _ GroupIssueBoardsServiceInterface = (*GroupIssueBoardsService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/group_boards/ type GroupIssueBoard struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Group *Group `json:"group"` Milestone *Milestone `json:"milestone"` @@ -69,31 +68,21 @@ func (b GroupIssueBoard) String() string { // // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#list-all-group-issue-boards-in-a-group -type ListGroupIssueBoardsOptions ListOptions +type ListGroupIssueBoardsOptions struct { + ListOptions +} // ListGroupIssueBoards gets a list of all issue boards in a group. // // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#list-all-group-issue-boards-in-a-group func (s *GroupIssueBoardsService) ListGroupIssueBoards(gid any, opt *ListGroupIssueBoardsOptions, options ...RequestOptionFunc) ([]*GroupIssueBoard, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/boards", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var gs []*GroupIssueBoard - resp, err := s.client.Do(req, &gs) - if err != nil { - return nil, resp, err - } - - return gs, resp, nil + return do[[]*GroupIssueBoard](s.client, + withMethod(http.MethodGet), + withPath("groups/%s/boards", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // CreateGroupIssueBoardOptions represents the available @@ -110,49 +99,24 @@ type CreateGroupIssueBoardOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#create-a-group-issue-board func (s *GroupIssueBoardsService) CreateGroupIssueBoard(gid any, opt *CreateGroupIssueBoardOptions, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/boards", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - gib := new(GroupIssueBoard) - resp, err := s.client.Do(req, gib) - if err != nil { - return nil, resp, err - } - - return gib, resp, nil + return do[*GroupIssueBoard](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/boards", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // GetGroupIssueBoard gets a single issue board of a group. // // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#single-group-issue-board -func (s *GroupIssueBoardsService) GetGroupIssueBoard(gid any, board int, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/boards/%d", PathEscape(group), board) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - gib := new(GroupIssueBoard) - resp, err := s.client.Do(req, gib) - if err != nil { - return nil, resp, err - } - - return gib, resp, nil +func (s *GroupIssueBoardsService) GetGroupIssueBoard(gid any, board int64, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) { + return do[*GroupIssueBoard](s.client, + withMethod(http.MethodGet), + withPath("groups/%s/boards/%d", GroupID{gid}, board), + withRequestOpts(options...), + ) } // UpdateGroupIssueBoardOptions represents a group issue board. @@ -161,54 +125,36 @@ func (s *GroupIssueBoardsService) GetGroupIssueBoard(gid any, board int, options // https://docs.gitlab.com/api/group_boards/#update-a-group-issue-board type UpdateGroupIssueBoardOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` + AssigneeID *int64 `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + MilestoneID *int64 `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` Labels *LabelOptions `url:"labels,omitempty" json:"labels,omitempty"` - Weight *int `url:"weight,omitempty" json:"weight,omitempty"` + Weight *int64 `url:"weight,omitempty" json:"weight,omitempty"` } // UpdateIssueBoard updates a single issue board of a group. // // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#update-a-group-issue-board -func (s *GroupIssueBoardsService) UpdateIssueBoard(gid any, board int, opt *UpdateGroupIssueBoardOptions, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/boards/%d", PathEscape(group), board) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, nil, err - } - - gib := new(GroupIssueBoard) - resp, err := s.client.Do(req, gib) - if err != nil { - return nil, resp, err - } - - return gib, resp, nil +func (s *GroupIssueBoardsService) UpdateIssueBoard(gid any, board int64, opt *UpdateGroupIssueBoardOptions, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) { + return do[*GroupIssueBoard](s.client, + withMethod(http.MethodPut), + withPath("groups/%s/boards/%d", GroupID{gid}, board), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // DeleteIssueBoard delete a single issue board of a group. // // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#delete-a-group-issue-board -func (s *GroupIssueBoardsService) DeleteIssueBoard(gid any, board int, options ...RequestOptionFunc) (*Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/boards/%d", PathEscape(group), board) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *GroupIssueBoardsService) DeleteIssueBoard(gid any, board int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("groups/%s/boards/%d", GroupID{gid}, board), + withRequestOpts(options...), + ) + return resp, err } // ListGroupIssueBoardListsOptions represents the available @@ -216,60 +162,33 @@ func (s *GroupIssueBoardsService) DeleteIssueBoard(gid any, board int, options . // // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#list-group-issue-board-lists -type ListGroupIssueBoardListsOptions ListOptions +type ListGroupIssueBoardListsOptions struct { + ListOptions +} // ListGroupIssueBoardLists gets a list of the issue board's lists. Does not include // backlog and closed lists. // // GitLab API docs: https://docs.gitlab.com/api/group_boards/#list-group-issue-board-lists -func (s *GroupIssueBoardsService) ListGroupIssueBoardLists(gid any, board int, opt *ListGroupIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/boards/%d/lists", PathEscape(group), board) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var gbl []*BoardList - resp, err := s.client.Do(req, &gbl) - if err != nil { - return nil, resp, err - } - - return gbl, resp, nil +func (s *GroupIssueBoardsService) ListGroupIssueBoardLists(gid any, board int64, opt *ListGroupIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { + return do[[]*BoardList](s.client, + withMethod(http.MethodGet), + withPath("groups/%s/boards/%d/lists", GroupID{gid}, board), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // GetGroupIssueBoardList gets a single issue board list. // // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#single-group-issue-board-list -func (s *GroupIssueBoardsService) GetGroupIssueBoardList(gid any, board, list int, options ...RequestOptionFunc) (*BoardList, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/boards/%d/lists/%d", - PathEscape(group), - board, - list, +func (s *GroupIssueBoardsService) GetGroupIssueBoardList(gid any, board, list int64, options ...RequestOptionFunc) (*BoardList, *Response, error) { + return do[*BoardList](s.client, + withMethod(http.MethodGet), + withPath("groups/%s/boards/%d/lists/%d", GroupID{gid}, board, list), + withRequestOpts(options...), ) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - gbl := new(BoardList) - resp, err := s.client.Do(req, gbl) - if err != nil { - return nil, resp, err - } - - return gbl, resp, nil } // CreateGroupIssueBoardListOptions represents the available @@ -278,32 +197,20 @@ func (s *GroupIssueBoardsService) GetGroupIssueBoardList(gid any, board, list in // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#new-group-issue-board-list type CreateGroupIssueBoardListOptions struct { - LabelID *int `url:"label_id" json:"label_id"` + LabelID *int64 `url:"label_id" json:"label_id"` } // CreateGroupIssueBoardList creates a new issue board list. // // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#new-group-issue-board-list -func (s *GroupIssueBoardsService) CreateGroupIssueBoardList(gid any, board int, opt *CreateGroupIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/boards/%d/lists", PathEscape(group), board) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - gbl := new(BoardList) - resp, err := s.client.Do(req, gbl) - if err != nil { - return nil, resp, err - } - - return gbl, resp, nil +func (s *GroupIssueBoardsService) CreateGroupIssueBoardList(gid any, board int64, opt *CreateGroupIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) { + return do[*BoardList](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/boards/%d/lists", GroupID{gid}, board), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // UpdateGroupIssueBoardListOptions represents the available @@ -312,7 +219,7 @@ func (s *GroupIssueBoardsService) CreateGroupIssueBoardList(gid any, board int, // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#edit-group-issue-board-list type UpdateGroupIssueBoardListOptions struct { - Position *int `url:"position" json:"position"` + Position *int64 `url:"position" json:"position"` } // UpdateIssueBoardList updates the position of an existing @@ -320,51 +227,20 @@ type UpdateGroupIssueBoardListOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_boards/#edit-group-issue-board-list -func (s *GroupIssueBoardsService) UpdateIssueBoardList(gid any, board, list int, opt *UpdateGroupIssueBoardListOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/boards/%d/lists/%d", - PathEscape(group), - board, - list, +func (s *GroupIssueBoardsService) UpdateIssueBoardList(gid any, board, list int64, opt *UpdateGroupIssueBoardListOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { + return do[[]*BoardList](s.client, + withMethod(http.MethodPut), + withPath("groups/%s/boards/%d/lists/%d", GroupID{gid}, board, list), + withAPIOpts(opt), + withRequestOpts(options...), ) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, nil, err - } - - var gbl []*BoardList - resp, err := s.client.Do(req, &gbl) - if err != nil { - return nil, resp, err - } - - return gbl, resp, nil } -// DeleteGroupIssueBoardList soft deletes a group issue board list. -// Only for admins and group owners. -// -// GitLab API docs: -// https://docs.gitlab.com/api/group_boards/#delete-a-group-issue-board-list -func (s *GroupIssueBoardsService) DeleteGroupIssueBoardList(gid any, board, list int, options ...RequestOptionFunc) (*Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/boards/%d/lists/%d", - PathEscape(group), - board, - list, +func (s *GroupIssueBoardsService) DeleteGroupIssueBoardList(gid any, board, list int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("groups/%s/boards/%d/lists/%d", GroupID{gid}, board, list), + withRequestOpts(options...), ) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) + return resp, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_clusters.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_clusters.go index 145f56ea4..5ec299147 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_clusters.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_clusters.go @@ -28,13 +28,13 @@ type ( // Deprecated: in GitLab 14.5, to be removed in 19.0 ListClusters(pid any, options ...RequestOptionFunc) ([]*GroupCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 - GetCluster(pid any, cluster int, options ...RequestOptionFunc) (*GroupCluster, *Response, error) + GetCluster(pid any, cluster int64, options ...RequestOptionFunc) (*GroupCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 AddCluster(pid any, opt *AddGroupClusterOptions, options ...RequestOptionFunc) (*GroupCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 - EditCluster(pid any, cluster int, opt *EditGroupClusterOptions, options ...RequestOptionFunc) (*GroupCluster, *Response, error) + EditCluster(pid any, cluster int64, opt *EditGroupClusterOptions, options ...RequestOptionFunc) (*GroupCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 - DeleteCluster(pid any, cluster int, options ...RequestOptionFunc) (*Response, error) + DeleteCluster(pid any, cluster int64, options ...RequestOptionFunc) (*Response, error) } // GroupClustersService handles communication with the @@ -56,7 +56,7 @@ var _ GroupClustersServiceInterface = (*GroupClustersService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/group_clusters/ type GroupCluster struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Domain string `json:"domain"` CreatedAt *time.Time `json:"created_at"` @@ -108,7 +108,7 @@ func (s *GroupClustersService) ListClusters(pid any, options ...RequestOptionFun // // GitLab API docs: // https://docs.gitlab.com/api/group_clusters/#get-a-single-group-cluster -func (s *GroupClustersService) GetCluster(pid any, cluster int, options ...RequestOptionFunc) (*GroupCluster, *Response, error) { +func (s *GroupClustersService) GetCluster(pid any, cluster int64, options ...RequestOptionFunc) (*GroupCluster, *Response, error) { group, err := parseID(pid) if err != nil { return nil, nil, err @@ -206,7 +206,7 @@ type EditGroupPlatformKubernetesOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_clusters/#edit-group-cluster -func (s *GroupClustersService) EditCluster(pid any, cluster int, opt *EditGroupClusterOptions, options ...RequestOptionFunc) (*GroupCluster, *Response, error) { +func (s *GroupClustersService) EditCluster(pid any, cluster int64, opt *EditGroupClusterOptions, options ...RequestOptionFunc) (*GroupCluster, *Response, error) { group, err := parseID(pid) if err != nil { return nil, nil, err @@ -232,7 +232,7 @@ func (s *GroupClustersService) EditCluster(pid any, cluster int, opt *EditGroupC // // GitLab API docs: // https://docs.gitlab.com/api/group_clusters/#delete-group-cluster -func (s *GroupClustersService) DeleteCluster(pid any, cluster int, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupClustersService) DeleteCluster(pid any, cluster int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_credentials.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_credentials.go new file mode 100644 index 000000000..bea0fff68 --- /dev/null +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_credentials.go @@ -0,0 +1,140 @@ +package gitlab + +import ( + "net/http" + "time" +) + +type ( + GroupCredentialsServiceInterface interface { + // ListGroupPersonalAccessTokens lists all personal access tokens + // associated with enterprise users in a top-level group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/groups/#list-all-personal-access-tokens-for-a-group + ListGroupPersonalAccessTokens(gid any, opt *ListGroupPersonalAccessTokensOptions, options ...RequestOptionFunc) ([]*GroupPersonalAccessToken, *Response, error) + // ListGroupSSHKeys lists all SSH public keys associated with + // enterprise users in a top-level group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/groups/#list-all-ssh-keys-for-a-group + ListGroupSSHKeys(gid any, opt *ListGroupSSHKeysOptions, options ...RequestOptionFunc) ([]*GroupSSHKey, *Response, error) + // RevokeGroupPersonalAccessToken revokes a specified personal access token + // for an enterprise user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/groups/#revoke-a-personal-access-token-for-an-enterprise-user + RevokeGroupPersonalAccessToken(gid any, tokenID int64, options ...RequestOptionFunc) (*Response, error) + // DeleteGroupSSHKey deletes a specified SSH public key for an + // enterprise user associated with the top-level group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/groups/#delete-an-ssh-key-for-an-enterprise-user + DeleteGroupSSHKey(gid any, keyID int64, options ...RequestOptionFunc) (*Response, error) + } + + // GroupCredentialsService handles communication with the top-level group + // credentials inventory management endpoints of the GitLab API. + // + // GitLab API docs: + // https://docs.gitlab.com/api/groups/#credentials-inventory-management + GroupCredentialsService struct { + client *Client + } +) + +// GroupPersonalAccessToken represents a group enterprise users personal access token. +// +// GitLab API docs: +// https://docs.gitlab.com/api/groups/#list-all-personal-access-tokens-for-a-group +type GroupPersonalAccessToken struct { + ID int64 `json:"id"` + Name string `json:"name"` + Revoked bool `json:"revoked"` + CreatedAt *time.Time `json:"created_at"` + Description string `json:"description"` + Scopes []string `json:"scopes"` + UserID int64 `json:"user_id"` + LastUsedAt *time.Time `json:"last_used_at,omitempty"` + Active bool `json:"active"` + ExpiresAt *ISOTime `json:"expires_at"` +} + +// ListGroupPersonalAccessTokensOptions represents the available +// ListGroupPersonalAccessTokens() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/groups/#list-all-personal-access-tokens-for-a-group +type ListGroupPersonalAccessTokensOptions struct { + ListOptions + CreatedAfter *ISOTime `url:"created_after,omitempty" json:"created_after,omitempty"` + CreatedBefore *ISOTime `url:"created_before,omitempty" json:"created_before,omitempty"` + LastUsedAfter *ISOTime `url:"last_used_after,omitempty" json:"last_used_after,omitempty"` + LastUsedBefore *ISOTime `url:"last_used_before,omitempty" json:"last_used_before,omitempty"` + Revoked *bool `url:"revoked,omitempty" json:"revoked,omitempty"` + Search *string `url:"search,omitempty" json:"search,omitempty"` + State *string `url:"state,omitempty" json:"state,omitempty"` +} + +func (g *GroupCredentialsService) ListGroupPersonalAccessTokens(gid any, opt *ListGroupPersonalAccessTokensOptions, options ...RequestOptionFunc) ([]*GroupPersonalAccessToken, *Response, error) { + return do[[]*GroupPersonalAccessToken](g.client, + withMethod(http.MethodGet), + withPath("groups/%s/manage/personal_access_tokens", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) +} + +// GroupSSHKey represents a group enterprise users public SSH key. +// +// GitLab API docs: +// https://docs.gitlab.com/api/groups/#list-all-ssh-keys-for-a-group +type GroupSSHKey struct { + ID int64 `json:"id"` + Title string `json:"title"` + CreatedAt *time.Time `json:"created_at"` + ExpiresAt *time.Time `json:"expires_at"` + LastUsedAt *time.Time `json:"last_used_at"` + UsageType string `json:"usage_type"` + UserID int64 `json:"user_id"` +} + +// ListGroupSSHKeysOptions represents the available +// ListGroupSSHKeys() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/groups/#list-all-ssh-keys-for-a-group +type ListGroupSSHKeysOptions struct { + ListOptions + CreatedAfter *ISOTime `url:"created_after,omitempty" json:"created_after,omitempty"` + CreatedBefore *ISOTime `url:"created_before,omitempty" json:"created_before,omitempty"` + ExpiresBefore *ISOTime `url:"expires_before,omitempty" json:"expires_before,omitempty"` + ExpiresAfter *ISOTime `url:"expires_after,omitempty" json:"expires_after,omitempty"` +} + +func (g *GroupCredentialsService) ListGroupSSHKeys(gid any, opt *ListGroupSSHKeysOptions, options ...RequestOptionFunc) ([]*GroupSSHKey, *Response, error) { + return do[[]*GroupSSHKey](g.client, + withMethod(http.MethodGet), + withPath("groups/%s/manage/ssh_keys", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) +} + +func (g *GroupCredentialsService) RevokeGroupPersonalAccessToken(gid any, tokenID int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](g.client, + withMethod(http.MethodDelete), + withPath("groups/%s/manage/personal_access_tokens/%d", GroupID{gid}, tokenID), + withRequestOpts(options...), + ) + return resp, err +} + +func (g *GroupCredentialsService) DeleteGroupSSHKey(gid any, keyID int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](g.client, + withMethod(http.MethodDelete), + withPath("groups/%s/manage/ssh_keys/%d", GroupID{gid}, keyID), + withRequestOpts(options...), + ) + return resp, err +} diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_epic_boards.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_epic_boards.go index 23097312e..d3dacf7df 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_epic_boards.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_epic_boards.go @@ -16,15 +16,10 @@ package gitlab -import ( - "fmt" - "net/http" -) - type ( GroupEpicBoardsServiceInterface interface { ListGroupEpicBoards(gid any, opt *ListGroupEpicBoardsOptions, options ...RequestOptionFunc) ([]*GroupEpicBoard, *Response, error) - GetGroupEpicBoard(gid any, board int, options ...RequestOptionFunc) (*GroupEpicBoard, *Response, error) + GetGroupEpicBoard(gid any, board int64, options ...RequestOptionFunc) (*GroupEpicBoard, *Response, error) } // GroupEpicBoardsService handles communication with the group epic board @@ -44,7 +39,7 @@ var _ GroupEpicBoardsServiceInterface = (*GroupEpicBoardsService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/group_epic_boards/ type GroupEpicBoard struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Group *Group `json:"group"` Labels []*LabelDetails `json:"labels"` @@ -60,54 +55,29 @@ func (b GroupEpicBoard) String() string { // // GitLab API docs: // https://docs.gitlab.com/api/group_epic_boards/#list-all-epic-boards-in-a-group -type ListGroupEpicBoardsOptions ListOptions +type ListGroupEpicBoardsOptions struct { + ListOptions +} // ListGroupEpicBoards gets a list of all epic boards in a group. // // GitLab API docs: // https://docs.gitlab.com/api/group_epic_boards/#list-all-epic-boards-in-a-group func (s *GroupEpicBoardsService) ListGroupEpicBoards(gid any, opt *ListGroupEpicBoardsOptions, options ...RequestOptionFunc) ([]*GroupEpicBoard, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/epic_boards", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var gs []*GroupEpicBoard - resp, err := s.client.Do(req, &gs) - if err != nil { - return nil, resp, err - } - - return gs, resp, nil + return do[[]*GroupEpicBoard](s.client, + withPath("groups/%s/epic_boards", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // GetGroupEpicBoard gets a single epic board of a group. // // GitLab API docs: // https://docs.gitlab.com/api/group_epic_boards/#single-group-epic-board -func (s *GroupEpicBoardsService) GetGroupEpicBoard(gid any, board int, options ...RequestOptionFunc) (*GroupEpicBoard, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/epic_boards/%d", PathEscape(group), board) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - gib := new(GroupEpicBoard) - resp, err := s.client.Do(req, gib) - if err != nil { - return nil, resp, err - } - - return gib, resp, nil +func (s *GroupEpicBoardsService) GetGroupEpicBoard(gid any, board int64, options ...RequestOptionFunc) (*GroupEpicBoard, *Response, error) { + return do[*GroupEpicBoard](s.client, + withPath("groups/%s/epic_boards/%d", GroupID{gid}, board), + withRequestOpts(options...), + ) } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_hooks.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_hooks.go index 096e5ca0d..30c8818ef 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_hooks.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_hooks.go @@ -27,7 +27,7 @@ import ( // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/ type GroupHook struct { - ID int `json:"id"` + ID int64 `json:"id"` URL string `json:"url"` Name string `json:"name"` Description string `json:"description"` @@ -42,7 +42,7 @@ type GroupHook struct { BranchFilterStrategy string `json:"branch_filter_strategy"` CustomWebhookTemplate string `json:"custom_webhook_template"` CustomHeaders []*HookCustomHeader `url:"custom_headers,omitempty" json:"custom_headers,omitempty"` - GroupID int `json:"group_id"` + GroupID int64 `json:"group_id"` IssuesEvents bool `json:"issues_events"` ConfidentialIssuesEvents bool `json:"confidential_issues_events"` NoteEvents bool `json:"note_events"` @@ -57,13 +57,18 @@ type GroupHook struct { EmojiEvents bool `json:"emoji_events"` ResourceAccessTokenEvents bool `json:"resource_access_token_events"` MemberEvents bool `json:"member_events"` + ProjectEvents bool `json:"project_events"` + MilestoneEvents bool `json:"milestone_events"` + VulnerabilityEvents bool `json:"vulnerability_events"` } // ListGroupHooksOptions represents the available ListGroupHooks() options. // // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/#list-group-hooks -type ListGroupHooksOptions ListOptions +type ListGroupHooksOptions struct { + ListOptions +} // ListGroupHooks gets a list of group hooks. // @@ -93,7 +98,7 @@ func (s *GroupsService) ListGroupHooks(gid any, opt *ListGroupHooksOptions, opti // // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/#get-a-group-hook -func (s *GroupsService) GetGroupHook(gid any, hook int, options ...RequestOptionFunc) (*GroupHook, *Response, error) { +func (s *GroupsService) GetGroupHook(gid any, hook int64, options ...RequestOptionFunc) (*GroupHook, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -118,7 +123,7 @@ func (s *GroupsService) GetGroupHook(gid any, hook int, options ...RequestOption // // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/#resend-group-hook-event -func (s *GroupsService) ResendGroupHookEvent(gid any, hook int, hookEventID int, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupsService) ResendGroupHookEvent(gid any, hook int64, hookEventID int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -152,13 +157,16 @@ type AddGroupHookOptions struct { ConfidentialNoteEvents *bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"` JobEvents *bool `url:"job_events,omitempty" json:"job_events,omitempty"` PipelineEvents *bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"` + ProjectEvents *bool `url:"project_events,omitempty" json:"project_events,omitempty"` WikiPageEvents *bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"` DeploymentEvents *bool `url:"deployment_events,omitempty" json:"deployment_events,omitempty"` FeatureFlagEvents *bool `url:"feature_flag_events,omitempty" json:"feature_flag_events,omitempty"` ReleasesEvents *bool `url:"releases_events,omitempty" json:"releases_events,omitempty"` + MilestoneEvents *bool `url:"milestone_events,omitempty" json:"milestone_events,omitempty"` SubGroupEvents *bool `url:"subgroup_events,omitempty" json:"subgroup_events,omitempty"` EmojiEvents *bool `url:"emoji_events,omitempty" json:"emoji_events,omitempty"` MemberEvents *bool `url:"member_events,omitempty" json:"member_events,omitempty"` + VulnerabilityEvents *bool `url:"vulnerability_events,omitempty" json:"vulnerability_events,omitempty"` EnableSSLVerification *bool `url:"enable_ssl_verification,omitempty" json:"enable_ssl_verification,omitempty"` Token *string `url:"token,omitempty" json:"token,omitempty"` ResourceAccessTokenEvents *bool `url:"resource_access_token_events,omitempty" json:"resource_access_token_events,omitempty"` @@ -210,13 +218,16 @@ type EditGroupHookOptions struct { ConfidentialNoteEvents *bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"` JobEvents *bool `url:"job_events,omitempty" json:"job_events,omitempty"` PipelineEvents *bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"` + ProjectEvents *bool `url:"project_events,omitempty" json:"project_events,omitempty"` WikiPageEvents *bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"` DeploymentEvents *bool `url:"deployment_events,omitempty" json:"deployment_events,omitempty"` FeatureFlagEvents *bool `url:"feature_flag_events,omitempty" json:"feature_flag_events,omitempty"` ReleasesEvents *bool `url:"releases_events,omitempty" json:"releases_events,omitempty"` + MilestoneEvents *bool `url:"milestone_events,omitempty" json:"milestone_events,omitempty"` SubGroupEvents *bool `url:"subgroup_events,omitempty" json:"subgroup_events,omitempty"` EmojiEvents *bool `url:"emoji_events,omitempty" json:"emoji_events,omitempty"` MemberEvents *bool `url:"member_events,omitempty" json:"member_events,omitempty"` + VulnerabilityEvents *bool `url:"vulnerability_events,omitempty" json:"vulnerability_events,omitempty"` EnableSSLVerification *bool `url:"enable_ssl_verification,omitempty" json:"enable_ssl_verification,omitempty"` ServiceAccessTokensExpirationEnforced *bool `url:"service_access_tokens_expiration_enforced,omitempty" json:"service_access_tokens_expiration_enforced,omitempty"` Token *string `url:"token,omitempty" json:"token,omitempty"` @@ -229,7 +240,7 @@ type EditGroupHookOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/#edit-group-hook -func (s *GroupsService) EditGroupHook(gid any, hook int, opt *EditGroupHookOptions, options ...RequestOptionFunc) (*GroupHook, *Response, error) { +func (s *GroupsService) EditGroupHook(gid any, hook int64, opt *EditGroupHookOptions, options ...RequestOptionFunc) (*GroupHook, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -255,7 +266,7 @@ func (s *GroupsService) EditGroupHook(gid any, hook int, opt *EditGroupHookOptio // // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/#delete-a-group-hook -func (s *GroupsService) DeleteGroupHook(gid any, hook int, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupsService) DeleteGroupHook(gid any, hook int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -274,7 +285,7 @@ func (s *GroupsService) DeleteGroupHook(gid any, hook int, options ...RequestOpt // // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/#trigger-a-test-group-hook -func (s *GroupsService) TriggerTestGroupHook(pid any, hook int, trigger GroupHookTrigger, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupsService) TriggerTestGroupHook(pid any, hook int64, trigger GroupHookTrigger, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(pid) if err != nil { return nil, err @@ -293,7 +304,7 @@ func (s *GroupsService) TriggerTestGroupHook(pid any, hook int, trigger GroupHoo // // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/#set-a-custom-header -func (s *GroupsService) SetGroupCustomHeader(gid any, hook int, key string, opt *SetHookCustomHeaderOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupsService) SetGroupCustomHeader(gid any, hook int64, key string, opt *SetHookCustomHeaderOptions, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -312,7 +323,7 @@ func (s *GroupsService) SetGroupCustomHeader(gid any, hook int, key string, opt // // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/#delete-a-custom-header -func (s *GroupsService) DeleteGroupCustomHeader(gid any, hook int, key string, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupsService) DeleteGroupCustomHeader(gid any, hook int64, key string, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -340,7 +351,7 @@ type SetHookURLVariableOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/#set-a-url-variable -func (s *GroupsService) SetGroupHookURLVariable(gid any, hook int, key string, opt *SetHookURLVariableOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupsService) SetGroupHookURLVariable(gid any, hook int64, key string, opt *SetHookURLVariableOptions, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -359,7 +370,7 @@ func (s *GroupsService) SetGroupHookURLVariable(gid any, hook int, key string, o // // GitLab API docs: // https://docs.gitlab.com/api/group_webhooks/#delete-a-url-variable -func (s *GroupsService) DeleteGroupHookURLVariable(gid any, hook int, key string, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupsService) DeleteGroupHookURLVariable(gid any, hook int64, key string, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_import_export.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_import_export.go index 406480040..77b74f019 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_import_export.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_import_export.go @@ -50,18 +50,13 @@ var _ GroupImportExportServiceInterface = (*GroupImportExportService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/group_import_export/#schedule-new-export func (s *GroupImportExportService) ScheduleExport(gid any, options ...RequestOptionFunc) (*Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/export", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodPost, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) + _, resp, err := do[none](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/export", GroupID{gid}), + withAPIOpts(nil), + withRequestOpts(options...), + ) + return resp, err } // ExportDownload downloads the finished export. @@ -73,9 +68,8 @@ func (s *GroupImportExportService) ExportDownload(gid any, options ...RequestOpt if err != nil { return nil, nil, err } - u := fmt.Sprintf("groups/%s/export/download", PathEscape(group)) - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("groups/%s/export/download", group), nil, options) if err != nil { return nil, nil, err } @@ -97,7 +91,7 @@ type GroupImportFileOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` Path *string `url:"path,omitempty" json:"path,omitempty"` File *string `url:"file,omitempty" json:"file,omitempty"` - ParentID *int `url:"parent_id,omitempty" json:"parent_id,omitempty"` + ParentID *int64 `url:"parent_id,omitempty" json:"parent_id,omitempty"` } // ImportFile imports a file. @@ -163,7 +157,7 @@ func (s *GroupImportExportService) ImportFile(opt *GroupImportFileOptions, optio return nil, err } - _, err = fw.Write([]byte(strconv.Itoa(*opt.ParentID))) + _, err = fw.Write([]byte(strconv.FormatInt(*opt.ParentID, 10))) if err != nil { return nil, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_iterations.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_iterations.go index 0a5e235e1..7f7b84a23 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_iterations.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_iterations.go @@ -42,13 +42,13 @@ var _ GroupIterationsServiceInterface = (*GroupIterationsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/group_iterations/ type GroupIteration struct { - ID int `json:"id"` - IID int `json:"iid"` - Sequence int `json:"sequence"` - GroupID int `json:"group_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + Sequence int64 `json:"sequence"` + GroupID int64 `json:"group_id"` Title string `json:"title"` Description string `json:"description"` - State int `json:"state"` + State int64 `json:"state"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` DueDate *ISOTime `json:"due_date"` diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_labels.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_labels.go index 7bd4d1df8..44118489a 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_labels.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_labels.go @@ -57,11 +57,11 @@ func (l GroupLabel) String() string { // GitLab API docs: https://docs.gitlab.com/api/group_labels/#list-group-labels type ListGroupLabelsOptions struct { ListOptions - WithCounts *bool `url:"with_counts,omitempty" json:"with_counts,omitempty"` - IncludeAncestorGroups *bool `url:"include_ancestor_groups,omitempty" json:"include_ancestor_groups,omitempty"` - IncludeDescendantGrouops *bool `url:"include_descendant_groups,omitempty" json:"include_descendant_groups,omitempty"` - OnlyGroupLabels *bool `url:"only_group_labels,omitempty" json:"only_group_labels,omitempty"` - Search *string `url:"search,omitempty" json:"search,omitempty"` + WithCounts *bool `url:"with_counts,omitempty" json:"with_counts,omitempty"` + IncludeAncestorGroups *bool `url:"include_ancestor_groups,omitempty" json:"include_ancestor_groups,omitempty"` + IncludeDescendantGroups *bool `url:"include_descendant_groups,omitempty" json:"include_descendant_groups,omitempty"` + OnlyGroupLabels *bool `url:"only_group_labels,omitempty" json:"only_group_labels,omitempty"` + Search *string `url:"search,omitempty" json:"search,omitempty"` } // ListGroupLabels gets all labels for given group. @@ -126,7 +126,7 @@ type CreateGroupLabelOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` Color *string `url:"color,omitempty" json:"color,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"` - Priority *int `url:"priority,omitempty" json:"priority,omitempty"` + Priority *int64 `url:"priority,omitempty" json:"priority,omitempty"` } // CreateGroupLabel creates a new label for given group with given name and @@ -199,7 +199,7 @@ type UpdateGroupLabelOptions struct { NewName *string `url:"new_name,omitempty" json:"new_name,omitempty"` Color *string `url:"color,omitempty" json:"color,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"` - Priority *int `url:"priority,omitempty" json:"priority,omitempty"` + Priority *int64 `url:"priority,omitempty" json:"priority,omitempty"` } // UpdateGroupLabel updates an existing label with new name or now color. At least diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_markdown_uploads.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_markdown_uploads.go index 5c0afc849..c15434c15 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_markdown_uploads.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_markdown_uploads.go @@ -23,9 +23,9 @@ import ( type ( GroupMarkdownUploadsServiceInterface interface { ListGroupMarkdownUploads(gid any, opt *ListMarkdownUploadsOptions, options ...RequestOptionFunc) ([]*GroupMarkdownUpload, *Response, error) - DownloadGroupMarkdownUploadByID(gid any, uploadID int, options ...RequestOptionFunc) (io.Reader, *Response, error) + DownloadGroupMarkdownUploadByID(gid any, uploadID int64, options ...RequestOptionFunc) (io.Reader, *Response, error) DownloadGroupMarkdownUploadBySecretAndFilename(gid any, secret string, filename string, options ...RequestOptionFunc) (io.Reader, *Response, error) - DeleteGroupMarkdownUploadByID(gid any, uploadID int, options ...RequestOptionFunc) (*Response, error) + DeleteGroupMarkdownUploadByID(gid any, uploadID int64, options ...RequestOptionFunc) (*Response, error) DeleteGroupMarkdownUploadBySecretAndFilename(gid any, secret string, filename string, options ...RequestOptionFunc) (*Response, error) } @@ -51,15 +51,15 @@ type ( // GitLab API Docs: // https://docs.gitlab.com/api/group_markdown_uploads/#list-uploads func (s *GroupMarkdownUploadsService) ListGroupMarkdownUploads(gid any, opt *ListMarkdownUploadsOptions, options ...RequestOptionFunc) ([]*GroupMarkdownUpload, *Response, error) { - return listMarkdownUploads[GroupMarkdownUpload](s.client, GroupResource, gid, opt, options) + return listMarkdownUploads[GroupMarkdownUpload](s.client, GroupResource, GroupID{gid}, opt, options) } // DownloadGroupMarkdownUploadByID downloads a specific upload by ID. // // GitLab API Docs: // https://docs.gitlab.com/api/group_markdown_uploads/#download-an-uploaded-file-by-id -func (s *GroupMarkdownUploadsService) DownloadGroupMarkdownUploadByID(gid any, uploadID int, options ...RequestOptionFunc) (io.Reader, *Response, error) { - buffer, resp, err := downloadMarkdownUploadByID(s.client, GroupResource, gid, uploadID, options) +func (s *GroupMarkdownUploadsService) DownloadGroupMarkdownUploadByID(gid any, uploadID int64, options ...RequestOptionFunc) (io.Reader, *Response, error) { + buffer, resp, err := downloadMarkdownUploadByID(s.client, GroupResource, GroupID{gid}, uploadID, options) if err != nil { return nil, resp, err } @@ -72,7 +72,7 @@ func (s *GroupMarkdownUploadsService) DownloadGroupMarkdownUploadByID(gid any, u // GitLab API Docs: // https://docs.gitlab.com/api/group_markdown_uploads/#download-an-uploaded-file-by-secret-and-filename func (s *GroupMarkdownUploadsService) DownloadGroupMarkdownUploadBySecretAndFilename(gid any, secret string, filename string, options ...RequestOptionFunc) (io.Reader, *Response, error) { - buffer, resp, err := downloadMarkdownUploadBySecretAndFilename(s.client, GroupResource, gid, secret, filename, options) + buffer, resp, err := downloadMarkdownUploadBySecretAndFilename(s.client, GroupResource, GroupID{gid}, secret, filename, options) if err != nil { return nil, resp, err } @@ -83,8 +83,8 @@ func (s *GroupMarkdownUploadsService) DownloadGroupMarkdownUploadBySecretAndFile // // GitLab API Docs: // https://docs.gitlab.com/api/group_markdown_uploads/#delete-an-uploaded-file-by-id -func (s *GroupMarkdownUploadsService) DeleteGroupMarkdownUploadByID(gid any, uploadID int, options ...RequestOptionFunc) (*Response, error) { - return deleteMarkdownUploadByID(s.client, GroupResource, gid, uploadID, options) +func (s *GroupMarkdownUploadsService) DeleteGroupMarkdownUploadByID(gid any, uploadID int64, options ...RequestOptionFunc) (*Response, error) { + return deleteMarkdownUploadByID(s.client, GroupResource, GroupID{gid}, uploadID, options) } // DeleteGroupMarkdownUploadBySecretAndFilename deletes an upload @@ -93,5 +93,5 @@ func (s *GroupMarkdownUploadsService) DeleteGroupMarkdownUploadByID(gid any, upl // GitLab API Docs: // https://docs.gitlab.com/api/group_markdown_uploads/#delete-an-uploaded-file-by-secret-and-filename func (s *GroupMarkdownUploadsService) DeleteGroupMarkdownUploadBySecretAndFilename(gid any, secret string, filename string, options ...RequestOptionFunc) (*Response, error) { - return deleteMarkdownUploadBySecretAndFilename(s.client, GroupResource, gid, secret, filename, options) + return deleteMarkdownUploadBySecretAndFilename(s.client, GroupResource, GroupID{gid}, secret, filename, options) } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_members.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_members.go index afdab93d7..a6c7653fe 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_members.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_members.go @@ -17,20 +17,19 @@ package gitlab import ( - "fmt" "net/http" "time" ) type ( GroupMembersServiceInterface interface { - GetGroupMember(gid any, user int, options ...RequestOptionFunc) (*GroupMember, *Response, error) - GetInheritedGroupMember(gid any, user int, options ...RequestOptionFunc) (*GroupMember, *Response, error) + GetGroupMember(gid any, user int64, options ...RequestOptionFunc) (*GroupMember, *Response, error) + GetInheritedGroupMember(gid any, user int64, options ...RequestOptionFunc) (*GroupMember, *Response, error) AddGroupMember(gid any, opt *AddGroupMemberOptions, options ...RequestOptionFunc) (*GroupMember, *Response, error) ShareWithGroup(gid any, opt *ShareWithGroupOptions, options ...RequestOptionFunc) (*Group, *Response, error) - DeleteShareWithGroup(gid any, groupID int, options ...RequestOptionFunc) (*Response, error) - EditGroupMember(gid any, user int, opt *EditGroupMemberOptions, options ...RequestOptionFunc) (*GroupMember, *Response, error) - RemoveGroupMember(gid any, user int, opt *RemoveGroupMemberOptions, options ...RequestOptionFunc) (*Response, error) + DeleteShareWithGroup(gid any, groupID int64, options ...RequestOptionFunc) (*Response, error) + EditGroupMember(gid any, user int64, opt *EditGroupMemberOptions, options ...RequestOptionFunc) (*GroupMember, *Response, error) + RemoveGroupMember(gid any, user int64, opt *RemoveGroupMemberOptions, options ...RequestOptionFunc) (*Response, error) } // GroupMembersService handles communication with the group members @@ -48,7 +47,7 @@ var _ GroupMembersServiceInterface = (*GroupMembersService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/members/ type GroupMember struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Name string `json:"name"` State string `json:"state"` @@ -72,7 +71,7 @@ type GroupMember struct { type GroupMemberSAMLIdentity struct { ExternUID string `json:"extern_uid"` Provider string `json:"provider"` - SAMLProviderID int `json:"saml_provider_id"` + SAMLProviderID int64 `json:"saml_provider_id"` } // BillableGroupMember represents a GitLab billable group member. @@ -80,7 +79,7 @@ type GroupMemberSAMLIdentity struct { // GitLab API docs: // https://docs.gitlab.com/api/members/#list-all-billable-members-of-a-group type BillableGroupMember struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Name string `json:"name"` State string `json:"state"` @@ -100,8 +99,8 @@ type BillableGroupMember struct { // GitLab API docs: // https://docs.gitlab.com/api/members/#list-memberships-for-a-billable-member-of-a-group type BillableUserMembership struct { - ID int `json:"id"` - SourceID int `json:"source_id"` + ID int64 `json:"id"` + SourceID int64 `json:"source_id"` SourceFullName string `json:"source_full_name"` SourceMembersURL string `json:"source_members_url"` CreatedAt *time.Time `json:"created_at"` @@ -116,9 +115,9 @@ type BillableUserMembership struct { // https://docs.gitlab.com/api/members/#list-all-members-of-a-group-or-project type ListGroupMembersOptions struct { ListOptions - Query *string `url:"query,omitempty" json:"query,omitempty"` - UserIDs *[]int `url:"user_ids[],omitempty" json:"user_ids,omitempty"` - ShowSeatInfo *bool `url:"show_seat_info,omitempty" json:"show_seat_info,omitempty"` + Query *string `url:"query,omitempty" json:"query,omitempty"` + UserIDs *[]int64 `url:"user_ids[],omitempty" json:"user_ids,omitempty"` + ShowSeatInfo *bool `url:"show_seat_info,omitempty" json:"show_seat_info,omitempty"` } // ListGroupMembers get a list of group members viewable by the authenticated @@ -127,24 +126,11 @@ type ListGroupMembersOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/members/#list-all-members-of-a-group-or-project func (s *GroupsService) ListGroupMembers(gid any, opt *ListGroupMembersOptions, options ...RequestOptionFunc) ([]*GroupMember, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/members", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var gm []*GroupMember - resp, err := s.client.Do(req, &gm) - if err != nil { - return nil, resp, err - } - - return gm, resp, nil + return do[[]*GroupMember](s.client, + withPath("groups/%s/members", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // ListAllGroupMembers get a list of group members viewable by the authenticated @@ -153,24 +139,11 @@ func (s *GroupsService) ListGroupMembers(gid any, opt *ListGroupMembersOptions, // GitLab API docs: // https://docs.gitlab.com/api/members/#list-all-members-of-a-group-or-project-including-inherited-and-invited-members func (s *GroupsService) ListAllGroupMembers(gid any, opt *ListGroupMembersOptions, options ...RequestOptionFunc) ([]*GroupMember, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/members/all", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var gm []*GroupMember - resp, err := s.client.Do(req, &gm) - if err != nil { - return nil, resp, err - } - - return gm, resp, nil + return do[[]*GroupMember](s.client, + withPath("groups/%s/members/all", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // AddGroupMemberOptions represents the available AddGroupMember() options. @@ -178,36 +151,22 @@ func (s *GroupsService) ListAllGroupMembers(gid any, opt *ListGroupMembersOption // GitLab API docs: // https://docs.gitlab.com/api/members/#add-a-member-to-a-group-or-project type AddGroupMemberOptions struct { - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` Username *string `url:"username,omitempty" json:"username,omitempty"` AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at"` - MemberRoleID *int `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` + MemberRoleID *int64 `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` } // GetGroupMember gets a member of a group. // // GitLab API docs: // https://docs.gitlab.com/api/members/#get-a-member-of-a-group-or-project -func (s *GroupMembersService) GetGroupMember(gid any, user int, options ...RequestOptionFunc) (*GroupMember, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/members/%d", PathEscape(group), user) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - gm := new(GroupMember) - resp, err := s.client.Do(req, gm) - if err != nil { - return nil, resp, err - } - - return gm, resp, nil +func (s *GroupMembersService) GetGroupMember(gid any, user int64, options ...RequestOptionFunc) (*GroupMember, *Response, error) { + return do[*GroupMember](s.client, + withPath("groups/%s/members/%d", GroupID{gid}, user), + withRequestOpts(options...), + ) } // GetInheritedGroupMember get a member of a group or project, including @@ -215,25 +174,11 @@ func (s *GroupMembersService) GetGroupMember(gid any, user int, options ...Reque // // GitLab API docs: // https://docs.gitlab.com/api/members/#get-a-member-of-a-group-or-project-including-inherited-and-invited-members -func (s *GroupMembersService) GetInheritedGroupMember(gid any, user int, options ...RequestOptionFunc) (*GroupMember, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/members/all/%d", PathEscape(group), user) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - gm := new(GroupMember) - resp, err := s.client.Do(req, gm) - if err != nil { - return nil, resp, err - } - - return gm, resp, err +func (s *GroupMembersService) GetInheritedGroupMember(gid any, user int64, options ...RequestOptionFunc) (*GroupMember, *Response, error) { + return do[*GroupMember](s.client, + withPath("groups/%s/members/all/%d", GroupID{gid}, user), + withRequestOpts(options...), + ) } // ListBillableGroupMembersOptions represents the available @@ -253,24 +198,11 @@ type ListBillableGroupMembersOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/members/#list-all-billable-members-of-a-group func (s *GroupsService) ListBillableGroupMembers(gid any, opt *ListBillableGroupMembersOptions, options ...RequestOptionFunc) ([]*BillableGroupMember, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/billable_members", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var bgm []*BillableGroupMember - resp, err := s.client.Do(req, &bgm) - if err != nil { - return nil, resp, err - } - - return bgm, resp, nil + return do[[]*BillableGroupMember](s.client, + withPath("groups/%s/billable_members", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // ListMembershipsForBillableGroupMemberOptions represents the available @@ -278,51 +210,34 @@ func (s *GroupsService) ListBillableGroupMembers(gid any, opt *ListBillableGroup // // GitLab API docs: // https://docs.gitlab.com/api/members/#list-memberships-for-a-billable-member-of-a-group -type ListMembershipsForBillableGroupMemberOptions = ListOptions +type ListMembershipsForBillableGroupMemberOptions struct { + ListOptions +} // ListMembershipsForBillableGroupMember gets a list of memberships for a // billable member of a group. // // GitLab API docs: // https://docs.gitlab.com/api/members/#list-memberships-for-a-billable-member-of-a-group -func (s *GroupsService) ListMembershipsForBillableGroupMember(gid any, user int, opt *ListMembershipsForBillableGroupMemberOptions, options ...RequestOptionFunc) ([]*BillableUserMembership, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/billable_members/%d/memberships", PathEscape(group), user) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var bum []*BillableUserMembership - resp, err := s.client.Do(req, &bum) - if err != nil { - return nil, resp, err - } - - return bum, resp, nil +func (s *GroupsService) ListMembershipsForBillableGroupMember(gid any, user int64, opt *ListMembershipsForBillableGroupMemberOptions, options ...RequestOptionFunc) ([]*BillableUserMembership, *Response, error) { + return do[[]*BillableUserMembership](s.client, + withPath("groups/%s/billable_members/%d/memberships", GroupID{gid}, user), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // RemoveBillableGroupMember removes a given group members that count as billable. // // GitLab API docs: // https://docs.gitlab.com/api/members/#remove-a-billable-member-from-a-group -func (s *GroupsService) RemoveBillableGroupMember(gid any, user int, options ...RequestOptionFunc) (*Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/billable_members/%d", PathEscape(group), user) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *GroupsService) RemoveBillableGroupMember(gid any, user int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("groups/%s/billable_members/%d", GroupID{gid}, user), + withRequestOpts(options...), + ) + return resp, err } // AddGroupMember adds a user to the list of group members. @@ -330,24 +245,12 @@ func (s *GroupsService) RemoveBillableGroupMember(gid any, user int, options ... // GitLab API docs: // https://docs.gitlab.com/api/members/#add-a-member-to-a-group-or-project func (s *GroupMembersService) AddGroupMember(gid any, opt *AddGroupMemberOptions, options ...RequestOptionFunc) (*GroupMember, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/members", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - gm := new(GroupMember) - resp, err := s.client.Do(req, gm) - if err != nil { - return nil, resp, err - } - - return gm, resp, nil + return do[*GroupMember](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/members", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // ShareWithGroup shares a group with the group. @@ -355,43 +258,25 @@ func (s *GroupMembersService) AddGroupMember(gid any, opt *AddGroupMemberOptions // GitLab API docs: // https://docs.gitlab.com/api/groups/#create-a-link-to-share-a-group-with-another-group func (s *GroupMembersService) ShareWithGroup(gid any, opt *ShareWithGroupOptions, options ...RequestOptionFunc) (*Group, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/share", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - g := new(Group) - resp, err := s.client.Do(req, g) - if err != nil { - return nil, resp, err - } - - return g, resp, nil + return do[*Group](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/share", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // DeleteShareWithGroup allows to unshare a group from a group. // // GitLab API docs: // https://docs.gitlab.com/api/groups/#delete-the-link-that-shares-a-group-with-another-group -func (s *GroupMembersService) DeleteShareWithGroup(gid any, groupID int, options ...RequestOptionFunc) (*Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/share/%d", PathEscape(group), groupID) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *GroupMembersService) DeleteShareWithGroup(gid any, groupID int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("groups/%s/share/%d", GroupID{gid}, groupID), + withRequestOpts(options...), + ) + return resp, err } // EditGroupMemberOptions represents the available EditGroupMember() @@ -402,32 +287,20 @@ func (s *GroupMembersService) DeleteShareWithGroup(gid any, groupID int, options type EditGroupMemberOptions struct { AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at,omitempty"` - MemberRoleID *int `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` + MemberRoleID *int64 `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` } // EditGroupMember updates a member of a group. // // GitLab API docs: // https://docs.gitlab.com/api/members/#edit-a-member-of-a-group-or-project -func (s *GroupMembersService) EditGroupMember(gid any, user int, opt *EditGroupMemberOptions, options ...RequestOptionFunc) (*GroupMember, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/members/%d", PathEscape(group), user) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, nil, err - } - - gm := new(GroupMember) - resp, err := s.client.Do(req, gm) - if err != nil { - return nil, resp, err - } - - return gm, resp, nil +func (s *GroupMembersService) EditGroupMember(gid any, user int64, opt *EditGroupMemberOptions, options ...RequestOptionFunc) (*GroupMember, *Response, error) { + return do[*GroupMember](s.client, + withMethod(http.MethodPut), + withPath("groups/%s/members/%d", GroupID{gid}, user), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // RemoveGroupMemberOptions represents the available options to remove a group member. @@ -443,17 +316,12 @@ type RemoveGroupMemberOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/members/#remove-a-member-from-a-group-or-project -func (s *GroupMembersService) RemoveGroupMember(gid any, user int, opt *RemoveGroupMemberOptions, options ...RequestOptionFunc) (*Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/members/%d", PathEscape(group), user) - - req, err := s.client.NewRequest(http.MethodDelete, u, opt, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *GroupMembersService) RemoveGroupMember(gid any, user int64, opt *RemoveGroupMemberOptions, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("groups/%s/members/%d", GroupID{gid}, user), + withAPIOpts(opt), + withRequestOpts(options...), + ) + return resp, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_milestones.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_milestones.go index 8ae487a12..2a687ab1b 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_milestones.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_milestones.go @@ -25,13 +25,13 @@ import ( type ( GroupMilestonesServiceInterface interface { ListGroupMilestones(gid any, opt *ListGroupMilestonesOptions, options ...RequestOptionFunc) ([]*GroupMilestone, *Response, error) - GetGroupMilestone(gid any, milestone int, options ...RequestOptionFunc) (*GroupMilestone, *Response, error) + GetGroupMilestone(gid any, milestone int64, options ...RequestOptionFunc) (*GroupMilestone, *Response, error) CreateGroupMilestone(gid any, opt *CreateGroupMilestoneOptions, options ...RequestOptionFunc) (*GroupMilestone, *Response, error) - UpdateGroupMilestone(gid any, milestone int, opt *UpdateGroupMilestoneOptions, options ...RequestOptionFunc) (*GroupMilestone, *Response, error) - DeleteGroupMilestone(pid any, milestone int, options ...RequestOptionFunc) (*Response, error) - GetGroupMilestoneIssues(gid any, milestone int, opt *GetGroupMilestoneIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) - GetGroupMilestoneMergeRequests(gid any, milestone int, opt *GetGroupMilestoneMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) - GetGroupMilestoneBurndownChartEvents(gid any, milestone int, opt *GetGroupMilestoneBurndownChartEventsOptions, options ...RequestOptionFunc) ([]*BurndownChartEvent, *Response, error) + UpdateGroupMilestone(gid any, milestone int64, opt *UpdateGroupMilestoneOptions, options ...RequestOptionFunc) (*GroupMilestone, *Response, error) + DeleteGroupMilestone(pid any, milestone int64, options ...RequestOptionFunc) (*Response, error) + GetGroupMilestoneIssues(gid any, milestone int64, opt *GetGroupMilestoneIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) + GetGroupMilestoneMergeRequests(gid any, milestone int64, opt *GetGroupMilestoneMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) + GetGroupMilestoneBurndownChartEvents(gid any, milestone int64, opt *GetGroupMilestoneBurndownChartEventsOptions, options ...RequestOptionFunc) ([]*BurndownChartEvent, *Response, error) } // GroupMilestonesService handles communication with the milestone related @@ -49,9 +49,9 @@ var _ GroupMilestonesServiceInterface = (*GroupMilestonesService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/group_milestones/ type GroupMilestone struct { - ID int `json:"id"` - IID int `json:"iid"` - GroupID int `json:"group_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + GroupID int64 `json:"group_id"` Title string `json:"title"` Description string `json:"description"` StartDate *ISOTime `json:"start_date"` @@ -73,7 +73,7 @@ func (m GroupMilestone) String() string { // https://docs.gitlab.com/api/group_milestones/#list-group-milestones type ListGroupMilestonesOptions struct { ListOptions - IIDs *[]int `url:"iids[],omitempty" json:"iids,omitempty"` + IIDs *[]int64 `url:"iids[],omitempty" json:"iids,omitempty"` State *string `url:"state,omitempty" json:"state,omitempty"` Title *string `url:"title,omitempty" json:"title,omitempty"` Search *string `url:"search,omitempty" json:"search,omitempty"` @@ -119,7 +119,7 @@ func (s *GroupMilestonesService) ListGroupMilestones(gid any, opt *ListGroupMile // // GitLab API docs: // https://docs.gitlab.com/api/group_milestones/#get-single-milestone -func (s *GroupMilestonesService) GetGroupMilestone(gid any, milestone int, options ...RequestOptionFunc) (*GroupMilestone, *Response, error) { +func (s *GroupMilestonesService) GetGroupMilestone(gid any, milestone int64, options ...RequestOptionFunc) (*GroupMilestone, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -192,7 +192,7 @@ type UpdateGroupMilestoneOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_milestones/#edit-milestone -func (s *GroupMilestonesService) UpdateGroupMilestone(gid any, milestone int, opt *UpdateGroupMilestoneOptions, options ...RequestOptionFunc) (*GroupMilestone, *Response, error) { +func (s *GroupMilestonesService) UpdateGroupMilestone(gid any, milestone int64, opt *UpdateGroupMilestoneOptions, options ...RequestOptionFunc) (*GroupMilestone, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -217,7 +217,7 @@ func (s *GroupMilestonesService) UpdateGroupMilestone(gid any, milestone int, op // // GitLab API docs: // https://docs.gitlab.com/api/group_milestones/#delete-group-milestone -func (s *GroupMilestonesService) DeleteGroupMilestone(pid any, milestone int, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupMilestonesService) DeleteGroupMilestone(pid any, milestone int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -235,13 +235,15 @@ func (s *GroupMilestonesService) DeleteGroupMilestone(pid any, milestone int, op // // GitLab API docs: // https://docs.gitlab.com/api/group_milestones/#get-all-issues-assigned-to-a-single-milestone -type GetGroupMilestoneIssuesOptions ListOptions +type GetGroupMilestoneIssuesOptions struct { + ListOptions +} // GetGroupMilestoneIssues gets all issues assigned to a single group milestone. // // GitLab API docs: // https://docs.gitlab.com/api/group_milestones/#get-all-issues-assigned-to-a-single-milestone -func (s *GroupMilestonesService) GetGroupMilestoneIssues(gid any, milestone int, opt *GetGroupMilestoneIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { +func (s *GroupMilestonesService) GetGroupMilestoneIssues(gid any, milestone int64, opt *GetGroupMilestoneIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -267,14 +269,16 @@ func (s *GroupMilestonesService) GetGroupMilestoneIssues(gid any, milestone int, // // GitLab API docs: // https://docs.gitlab.com/api/group_milestones/#get-all-merge-requests-assigned-to-a-single-milestone -type GetGroupMilestoneMergeRequestsOptions ListOptions +type GetGroupMilestoneMergeRequestsOptions struct { + ListOptions +} // GetGroupMilestoneMergeRequests gets all merge requests assigned to a // single group milestone. // // GitLab API docs: // https://docs.gitlab.com/api/group_milestones/#get-all-merge-requests-assigned-to-a-single-milestone -func (s *GroupMilestonesService) GetGroupMilestoneMergeRequests(gid any, milestone int, opt *GetGroupMilestoneMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { +func (s *GroupMilestonesService) GetGroupMilestoneMergeRequests(gid any, milestone int64, opt *GetGroupMilestoneMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -301,7 +305,7 @@ func (s *GroupMilestonesService) GetGroupMilestoneMergeRequests(gid any, milesto // https://docs.gitlab.com/api/group_milestones/#get-all-burndown-chart-events-for-a-single-milestone type BurndownChartEvent struct { CreatedAt *time.Time `json:"created_at"` - Weight *int `json:"weight"` + Weight *int64 `json:"weight"` Action *string `json:"action"` } @@ -310,14 +314,16 @@ type BurndownChartEvent struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_milestones/#get-all-burndown-chart-events-for-a-single-milestone -type GetGroupMilestoneBurndownChartEventsOptions ListOptions +type GetGroupMilestoneBurndownChartEventsOptions struct { + ListOptions +} // GetGroupMilestoneBurndownChartEvents gets all merge requests assigned to a // single group milestone. // // GitLab API docs: // https://docs.gitlab.com/api/group_milestones/#get-all-burndown-chart-events-for-a-single-milestone -func (s *GroupMilestonesService) GetGroupMilestoneBurndownChartEvents(gid any, milestone int, opt *GetGroupMilestoneBurndownChartEventsOptions, options ...RequestOptionFunc) ([]*BurndownChartEvent, *Response, error) { +func (s *GroupMilestonesService) GetGroupMilestoneBurndownChartEvents(gid any, milestone int64, opt *GetGroupMilestoneBurndownChartEventsOptions, options ...RequestOptionFunc) ([]*BurndownChartEvent, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_protected_environments.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_protected_environments.go index 211201164..681d9c9bc 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_protected_environments.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_protected_environments.go @@ -17,7 +17,6 @@ package gitlab import ( - "fmt" "net/http" ) @@ -49,7 +48,7 @@ var _ GroupProtectedEnvironmentsServiceInterface = (*GroupProtectedEnvironmentsS type GroupProtectedEnvironment struct { Name string `json:"name"` DeployAccessLevels []*GroupEnvironmentAccessDescription `json:"deploy_access_levels"` - RequiredApprovalCount int `json:"required_approval_count"` + RequiredApprovalCount int64 `json:"required_approval_count"` ApprovalRules []*GroupEnvironmentApprovalRule `json:"approval_rules"` } @@ -59,12 +58,12 @@ type GroupProtectedEnvironment struct { // GitLab API docs: // https://docs.gitlab.com/api/group_protected_environments/ type GroupEnvironmentAccessDescription struct { - ID int `json:"id"` + ID int64 `json:"id"` AccessLevel AccessLevelValue `json:"access_level"` AccessLevelDescription string `json:"access_level_description"` - UserID int `json:"user_id"` - GroupID int `json:"group_id"` - GroupInheritanceType int `json:"group_inheritance_type"` + UserID int64 `json:"user_id"` + GroupID int64 `json:"group_id"` + GroupInheritanceType int64 `json:"group_inheritance_type"` } // GroupEnvironmentApprovalRule represents the approval rules for a group-level @@ -73,13 +72,13 @@ type GroupEnvironmentAccessDescription struct { // GitLab API docs: // https://docs.gitlab.com/api/group_protected_environments/#protect-a-single-environment type GroupEnvironmentApprovalRule struct { - ID int `json:"id"` - UserID int `json:"user_id"` - GroupID int `json:"group_id"` + ID int64 `json:"id"` + UserID int64 `json:"user_id"` + GroupID int64 `json:"group_id"` AccessLevel AccessLevelValue `json:"access_level"` AccessLevelDescription string `json:"access_level_description"` - RequiredApprovalCount int `json:"required_approvals"` - GroupInheritanceType int `json:"group_inheritance_type"` + RequiredApprovalCount int64 `json:"required_approvals"` + GroupInheritanceType int64 `json:"group_inheritance_type"` } // ListGroupProtectedEnvironmentsOptions represents the available @@ -87,7 +86,9 @@ type GroupEnvironmentApprovalRule struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_protected_environments/#list-group-level-protected-environments -type ListGroupProtectedEnvironmentsOptions ListOptions +type ListGroupProtectedEnvironmentsOptions struct { + ListOptions +} // ListGroupProtectedEnvironments returns a list of protected environments from // a group. @@ -95,24 +96,11 @@ type ListGroupProtectedEnvironmentsOptions ListOptions // GitLab API docs: // https://docs.gitlab.com/api/group_protected_environments/#list-group-level-protected-environments func (s *GroupProtectedEnvironmentsService) ListGroupProtectedEnvironments(gid any, opt *ListGroupProtectedEnvironmentsOptions, options ...RequestOptionFunc) ([]*GroupProtectedEnvironment, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/protected_environments", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var pes []*GroupProtectedEnvironment - resp, err := s.client.Do(req, &pes) - if err != nil { - return nil, resp, err - } - - return pes, resp, nil + return do[[]*GroupProtectedEnvironment](s.client, + withPath("groups/%s/protected_environments", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // GetGroupProtectedEnvironment returns a single group-level protected @@ -121,24 +109,10 @@ func (s *GroupProtectedEnvironmentsService) ListGroupProtectedEnvironments(gid a // GitLab API docs: // https://docs.gitlab.com/api/group_protected_environments/#get-a-single-protected-environment func (s *GroupProtectedEnvironmentsService) GetGroupProtectedEnvironment(gid any, environment string, options ...RequestOptionFunc) (*GroupProtectedEnvironment, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/protected_environments/%s", PathEscape(group), environment) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - pe := new(GroupProtectedEnvironment) - resp, err := s.client.Do(req, pe) - if err != nil { - return nil, resp, err - } - - return pe, resp, nil + return do[*GroupProtectedEnvironment](s.client, + withPath("groups/%s/protected_environments/%s", GroupID{gid}, environment), + withRequestOpts(options...), + ) } // ProtectGroupEnvironmentOptions represents the available @@ -149,7 +123,7 @@ func (s *GroupProtectedEnvironmentsService) GetGroupProtectedEnvironment(gid any type ProtectGroupEnvironmentOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` DeployAccessLevels *[]*GroupEnvironmentAccessOptions `url:"deploy_access_levels,omitempty" json:"deploy_access_levels,omitempty"` - RequiredApprovalCount *int `url:"required_approval_count,omitempty" json:"required_approval_count,omitempty"` + RequiredApprovalCount *int64 `url:"required_approval_count,omitempty" json:"required_approval_count,omitempty"` ApprovalRules *[]*GroupEnvironmentApprovalRuleOptions `url:"approval_rules,omitempty" json:"approval_rules,omitempty"` } @@ -160,9 +134,9 @@ type ProtectGroupEnvironmentOptions struct { // https://docs.gitlab.com/api/group_protected_environments/#protect-a-single-environment type GroupEnvironmentAccessOptions struct { AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` - GroupInheritanceType *int `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` + GroupInheritanceType *int64 `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` } // GroupEnvironmentApprovalRuleOptions represents the approval rules for a @@ -171,12 +145,12 @@ type GroupEnvironmentAccessOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_protected_environments/#protect-a-single-environment type GroupEnvironmentApprovalRuleOptions struct { - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` AccessLevelDescription *string `url:"access_level_description,omitempty" json:"access_level_description,omitempty"` - RequiredApprovalCount *int `url:"required_approvals,omitempty" json:"required_approvals,omitempty"` - GroupInheritanceType *int `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` + RequiredApprovalCount *int64 `url:"required_approvals,omitempty" json:"required_approvals,omitempty"` + GroupInheritanceType *int64 `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` } // ProtectGroupEnvironment protects a single group-level environment. @@ -184,24 +158,12 @@ type GroupEnvironmentApprovalRuleOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_protected_environments/#protect-a-single-environment func (s *GroupProtectedEnvironmentsService) ProtectGroupEnvironment(gid any, opt *ProtectGroupEnvironmentOptions, options ...RequestOptionFunc) (*GroupProtectedEnvironment, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/protected_environments", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - pe := new(GroupProtectedEnvironment) - resp, err := s.client.Do(req, pe) - if err != nil { - return nil, resp, err - } - - return pe, resp, nil + return do[*GroupProtectedEnvironment](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/protected_environments", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // UpdateGroupProtectedEnvironmentOptions represents the available @@ -212,7 +174,7 @@ func (s *GroupProtectedEnvironmentsService) ProtectGroupEnvironment(gid any, opt type UpdateGroupProtectedEnvironmentOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` DeployAccessLevels *[]*UpdateGroupEnvironmentAccessOptions `url:"deploy_access_levels,omitempty" json:"deploy_access_levels,omitempty"` - RequiredApprovalCount *int `url:"required_approval_count,omitempty" json:"required_approval_count,omitempty"` + RequiredApprovalCount *int64 `url:"required_approval_count,omitempty" json:"required_approval_count,omitempty"` ApprovalRules *[]*UpdateGroupEnvironmentApprovalRuleOptions `url:"approval_rules,omitempty" json:"approval_rules,omitempty"` } @@ -223,10 +185,10 @@ type UpdateGroupProtectedEnvironmentOptions struct { // https://docs.gitlab.com/api/group_protected_environments/#update-a-protected-environment type UpdateGroupEnvironmentAccessOptions struct { AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` - ID *int `url:"id,omitempty" json:"id,omitempty"` - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` - GroupInheritanceType *int `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` + ID *int64 `url:"id,omitempty" json:"id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` + GroupInheritanceType *int64 `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` Destroy *bool `url:"_destroy,omitempty" json:"_destroy,omitempty"` } @@ -236,13 +198,13 @@ type UpdateGroupEnvironmentAccessOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_protected_environments/#update-a-protected-environment type UpdateGroupEnvironmentApprovalRuleOptions struct { - ID *int `url:"id,omitempty" json:"id,omitempty"` - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` + ID *int64 `url:"id,omitempty" json:"id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` AccessLevelDescription *string `url:"access_level_description,omitempty" json:"access_level_description,omitempty"` - RequiredApprovalCount *int `url:"required_approvals,omitempty" json:"required_approvals,omitempty"` - GroupInheritanceType *int `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` + RequiredApprovalCount *int64 `url:"required_approvals,omitempty" json:"required_approvals,omitempty"` + GroupInheritanceType *int64 `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` Destroy *bool `url:"_destroy,omitempty" json:"_destroy,omitempty"` } @@ -252,24 +214,12 @@ type UpdateGroupEnvironmentApprovalRuleOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_protected_environments/#update-a-protected-environment func (s *GroupProtectedEnvironmentsService) UpdateGroupProtectedEnvironment(gid any, environment string, opt *UpdateGroupProtectedEnvironmentOptions, options ...RequestOptionFunc) (*GroupProtectedEnvironment, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/protected_environments/%s", PathEscape(group), environment) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, nil, err - } - - pe := new(GroupProtectedEnvironment) - resp, err := s.client.Do(req, pe) - if err != nil { - return nil, resp, err - } - - return pe, resp, nil + return do[*GroupProtectedEnvironment](s.client, + withMethod(http.MethodPut), + withPath("groups/%s/protected_environments/%s", GroupID{gid}, environment), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // UnprotectGroupEnvironment unprotects the given protected group-level @@ -278,16 +228,10 @@ func (s *GroupProtectedEnvironmentsService) UpdateGroupProtectedEnvironment(gid // GitLab API docs: // https://docs.gitlab.com/api/group_protected_environments/#unprotect-a-single-environment func (s *GroupProtectedEnvironmentsService) UnprotectGroupEnvironment(gid any, environment string, options ...RequestOptionFunc) (*Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/protected_environments/%s", PathEscape(group), environment) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("groups/%s/protected_environments/%s", GroupID{gid}, environment), + withRequestOpts(options...), + ) + return resp, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_repository_storage_move.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_repository_storage_move.go index 01996cd09..fc5bb52ad 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_repository_storage_move.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_repository_storage_move.go @@ -17,7 +17,6 @@ package gitlab import ( - "fmt" "net/http" "time" ) @@ -25,10 +24,10 @@ import ( type ( GroupRepositoryStorageMoveServiceInterface interface { RetrieveAllStorageMoves(opts RetrieveAllGroupStorageMovesOptions, options ...RequestOptionFunc) ([]*GroupRepositoryStorageMove, *Response, error) - RetrieveAllStorageMovesForGroup(group int, opts RetrieveAllGroupStorageMovesOptions, options ...RequestOptionFunc) ([]*GroupRepositoryStorageMove, *Response, error) - GetStorageMove(repositoryStorage int, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) - GetStorageMoveForGroup(group int, repositoryStorage int, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) - ScheduleStorageMoveForGroup(group int, opts ScheduleStorageMoveForGroupOptions, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) + RetrieveAllStorageMovesForGroup(group int64, opts RetrieveAllGroupStorageMovesOptions, options ...RequestOptionFunc) ([]*GroupRepositoryStorageMove, *Response, error) + GetStorageMove(repositoryStorage int64, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) + GetStorageMoveForGroup(group int64, repositoryStorage int64, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) + ScheduleStorageMoveForGroup(group int64, opts ScheduleStorageMoveForGroupOptions, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) ScheduleAllStorageMoves(opts ScheduleAllGroupStorageMovesOptions, options ...RequestOptionFunc) (*Response, error) } @@ -47,7 +46,7 @@ type ( // GitLab API docs: // https://docs.gitlab.com/api/group_repository_storage_moves/ type GroupRepositoryStorageMove struct { - ID int `json:"id"` + ID int64 `json:"id"` CreatedAt *time.Time `json:"created_at"` State string `json:"state"` SourceStorageName string `json:"source_storage_name"` @@ -56,7 +55,7 @@ type GroupRepositoryStorageMove struct { } type RepositoryGroup struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` WebURL string `json:"web_url"` } @@ -66,7 +65,9 @@ type RepositoryGroup struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_repository_storage_moves/#retrieve-all-group-repository-storage-moves -type RetrieveAllGroupStorageMovesOptions ListOptions +type RetrieveAllGroupStorageMovesOptions struct { + ListOptions +} // RetrieveAllStorageMoves retrieves all group repository storage moves // accessible by the authenticated user. @@ -74,18 +75,11 @@ type RetrieveAllGroupStorageMovesOptions ListOptions // GitLab API docs: // https://docs.gitlab.com/api/group_repository_storage_moves/#retrieve-all-group-repository-storage-moves func (g GroupRepositoryStorageMoveService) RetrieveAllStorageMoves(opts RetrieveAllGroupStorageMovesOptions, options ...RequestOptionFunc) ([]*GroupRepositoryStorageMove, *Response, error) { - req, err := g.client.NewRequest(http.MethodGet, "group_repository_storage_moves", opts, options) - if err != nil { - return nil, nil, err - } - - var gsms []*GroupRepositoryStorageMove - resp, err := g.client.Do(req, &gsms) - if err != nil { - return nil, resp, err - } - - return gsms, resp, err + return do[[]*GroupRepositoryStorageMove](g.client, + withPath("group_repository_storage_moves"), + withAPIOpts(opts), + withRequestOpts(options...), + ) } // RetrieveAllStorageMovesForGroup retrieves all repository storage moves for @@ -93,63 +87,34 @@ func (g GroupRepositoryStorageMoveService) RetrieveAllStorageMoves(opts Retrieve // // GitLab API docs: // https://docs.gitlab.com/api/group_repository_storage_moves/#retrieve-all-repository-storage-moves-for-a-single-group -func (g GroupRepositoryStorageMoveService) RetrieveAllStorageMovesForGroup(group int, opts RetrieveAllGroupStorageMovesOptions, options ...RequestOptionFunc) ([]*GroupRepositoryStorageMove, *Response, error) { - u := fmt.Sprintf("groups/%d/repository_storage_moves", group) - - req, err := g.client.NewRequest(http.MethodGet, u, opts, options) - if err != nil { - return nil, nil, err - } - - var gsms []*GroupRepositoryStorageMove - resp, err := g.client.Do(req, &gsms) - if err != nil { - return nil, resp, err - } - - return gsms, resp, err +func (g GroupRepositoryStorageMoveService) RetrieveAllStorageMovesForGroup(group int64, opts RetrieveAllGroupStorageMovesOptions, options ...RequestOptionFunc) ([]*GroupRepositoryStorageMove, *Response, error) { + return do[[]*GroupRepositoryStorageMove](g.client, + withPath("groups/%d/repository_storage_moves", group), + withAPIOpts(opts), + withRequestOpts(options...), + ) } // GetStorageMove gets a single group repository storage move. // // GitLab API docs: // https://docs.gitlab.com/api/group_repository_storage_moves/#get-a-single-group-repository-storage-move -func (g GroupRepositoryStorageMoveService) GetStorageMove(repositoryStorage int, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) { - u := fmt.Sprintf("group_repository_storage_moves/%d", repositoryStorage) - - req, err := g.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - gsm := new(GroupRepositoryStorageMove) - resp, err := g.client.Do(req, gsm) - if err != nil { - return nil, resp, err - } - - return gsm, resp, err +func (g GroupRepositoryStorageMoveService) GetStorageMove(repositoryStorage int64, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) { + return do[*GroupRepositoryStorageMove](g.client, + withPath("group_repository_storage_moves/%d", repositoryStorage), + withRequestOpts(options...), + ) } // GetStorageMoveForGroup gets a single repository storage move for a group. // // GitLab API docs: // https://docs.gitlab.com/api/group_repository_storage_moves/#get-a-single-repository-storage-move-for-a-group -func (g GroupRepositoryStorageMoveService) GetStorageMoveForGroup(group int, repositoryStorage int, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) { - u := fmt.Sprintf("groups/%d/repository_storage_moves/%d", group, repositoryStorage) - - req, err := g.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - gsm := new(GroupRepositoryStorageMove) - resp, err := g.client.Do(req, gsm) - if err != nil { - return nil, resp, err - } - - return gsm, resp, err +func (g GroupRepositoryStorageMoveService) GetStorageMoveForGroup(group int64, repositoryStorage int64, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) { + return do[*GroupRepositoryStorageMove](g.client, + withPath("groups/%d/repository_storage_moves/%d", group, repositoryStorage), + withRequestOpts(options...), + ) } // ScheduleStorageMoveForGroupOptions represents the available @@ -165,21 +130,13 @@ type ScheduleStorageMoveForGroupOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_repository_storage_moves/#schedule-a-repository-storage-move-for-a-group -func (g GroupRepositoryStorageMoveService) ScheduleStorageMoveForGroup(group int, opts ScheduleStorageMoveForGroupOptions, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) { - u := fmt.Sprintf("groups/%d/repository_storage_moves", group) - - req, err := g.client.NewRequest(http.MethodPost, u, opts, options) - if err != nil { - return nil, nil, err - } - - gsm := new(GroupRepositoryStorageMove) - resp, err := g.client.Do(req, gsm) - if err != nil { - return nil, resp, err - } - - return gsm, resp, err +func (g GroupRepositoryStorageMoveService) ScheduleStorageMoveForGroup(group int64, opts ScheduleStorageMoveForGroupOptions, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) { + return do[*GroupRepositoryStorageMove](g.client, + withMethod(http.MethodPost), + withPath("groups/%d/repository_storage_moves", group), + withAPIOpts(opts), + withRequestOpts(options...), + ) } // ScheduleAllGroupStorageMovesOptions represents the available @@ -197,10 +154,11 @@ type ScheduleAllGroupStorageMovesOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_repository_storage_moves/#schedule-repository-storage-moves-for-all-groups-on-a-storage-shard func (g GroupRepositoryStorageMoveService) ScheduleAllStorageMoves(opts ScheduleAllGroupStorageMovesOptions, options ...RequestOptionFunc) (*Response, error) { - req, err := g.client.NewRequest(http.MethodPost, "group_repository_storage_moves", opts, options) - if err != nil { - return nil, err - } - - return g.client.Do(req, nil) + _, resp, err := do[none](g.client, + withMethod(http.MethodPost), + withPath("group_repository_storage_moves"), + withAPIOpts(opts), + withRequestOpts(options...), + ) + return resp, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_security_settings.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_security_settings.go index 58de5ec27..8f5e0eaf9 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_security_settings.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_security_settings.go @@ -60,8 +60,8 @@ func (s GroupSecuritySettings) String() string { // GitLab API docs: // https://docs.gitlab.com/api/group_security_settings/#update-secret_push_protection_enabled-setting type UpdateGroupSecuritySettingsOptions struct { - SecretPushProtectionEnabled *bool `url:"secret_push_protection_enabled,omitempty" json:"secret_push_protection_enabled,omitempty"` - ProjectsToExclude *[]int `url:"projects_to_exclude,omitempty" json:"projects_to_exclude,omitempty"` + SecretPushProtectionEnabled *bool `url:"secret_push_protection_enabled,omitempty" json:"secret_push_protection_enabled,omitempty"` + ProjectsToExclude *[]int64 `url:"projects_to_exclude,omitempty" json:"projects_to_exclude,omitempty"` } // UpdateSecretPushProtectionEnabledSetting updates the secret_push_protection_enabled diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_serviceaccounts.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_serviceaccounts.go index 8021b56de..b4e31343f 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_serviceaccounts.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_serviceaccounts.go @@ -25,9 +25,9 @@ import ( // GroupServiceAccount represents a GitLab service account user. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#create-a-service-account-user +// https://docs.gitlab.com/api/service_accounts/#create-a-group-service-account type GroupServiceAccount struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` UserName string `json:"username"` Email string `json:"email"` @@ -36,7 +36,7 @@ type GroupServiceAccount struct { // ListServiceAccountsOptions represents the available ListServiceAccounts() options. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#list-all-service-account-users +// https://docs.gitlab.com/api/service_accounts/#list-all-group-service-accounts type ListServiceAccountsOptions struct { ListOptions OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"` @@ -46,7 +46,7 @@ type ListServiceAccountsOptions struct { // ListServiceAccounts gets a list of service accounts. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#list-all-service-account-users +// https://docs.gitlab.com/api/service_accounts/#list-all-group-service-accounts func (s *GroupsService) ListServiceAccounts(gid any, opt *ListServiceAccountsOptions, options ...RequestOptionFunc) ([]*GroupServiceAccount, *Response, error) { group, err := parseID(gid) if err != nil { @@ -71,7 +71,7 @@ func (s *GroupsService) ListServiceAccounts(gid any, opt *ListServiceAccountsOpt // CreateServiceAccountOptions represents the available CreateServiceAccount() options. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#create-a-service-account-user +// https://docs.gitlab.com/api/service_accounts/#create-a-group-service-account type CreateServiceAccountOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` Username *string `url:"username,omitempty" json:"username,omitempty"` @@ -83,7 +83,7 @@ type CreateServiceAccountOptions struct { // This API endpoint works on top-level groups only. It does not work on subgroups. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#create-a-service-account-user +// https://docs.gitlab.com/api/service_accounts/#create-a-group-service-account func (s *GroupsService) CreateServiceAccount(gid any, opt *CreateServiceAccountOptions, options ...RequestOptionFunc) (*GroupServiceAccount, *Response, error) { group, err := parseID(gid) if err != nil { @@ -108,10 +108,11 @@ func (s *GroupsService) CreateServiceAccount(gid any, opt *CreateServiceAccountO // UpdateServiceAccountOptions represents the available UpdateServiceAccount() options. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#update-a-service-account-user +// https://docs.gitlab.com/api/service_accounts/#update-a-group-service-account type UpdateServiceAccountOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` Username *string `url:"username,omitempty" json:"username,omitempty"` + Email *string `url:"email,omitempty" json:"email,omitempty"` } // UpdateServiceAccount updates a service account user. @@ -119,8 +120,8 @@ type UpdateServiceAccountOptions struct { // This API endpoint works on top-level groups only. It does not work on subgroups. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#update-a-service-account-user -func (s *GroupsService) UpdateServiceAccount(gid any, serviceAccount int, opt *UpdateServiceAccountOptions, options ...RequestOptionFunc) (*GroupServiceAccount, *Response, error) { +// https://docs.gitlab.com/api/service_accounts/#update-a-group-service-account +func (s *GroupsService) UpdateServiceAccount(gid any, serviceAccount int64, opt *UpdateServiceAccountOptions, options ...RequestOptionFunc) (*GroupServiceAccount, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -144,7 +145,7 @@ func (s *GroupsService) UpdateServiceAccount(gid any, serviceAccount int, opt *U // DeleteServiceAccountOptions represents the available DeleteServiceAccount() options. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#delete-a-service-account-user +// https://docs.gitlab.com/api/service_accounts/#delete-a-group-service-account type DeleteServiceAccountOptions struct { HardDelete *bool `url:"hard_delete,omitempty" json:"hard_delete,omitempty"` } @@ -154,8 +155,8 @@ type DeleteServiceAccountOptions struct { // This API endpoint works on top-level groups only. It does not work on subgroups. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#delete-a-service-account-user -func (s *GroupsService) DeleteServiceAccount(gid any, serviceAccount int, opt *DeleteServiceAccountOptions, options ...RequestOptionFunc) (*Response, error) { +// https://docs.gitlab.com/api/service_accounts/#delete-a-group-service-account +func (s *GroupsService) DeleteServiceAccount(gid any, serviceAccount int64, opt *DeleteServiceAccountOptions, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -174,7 +175,7 @@ func (s *GroupsService) DeleteServiceAccount(gid any, serviceAccount int, opt *D // ListServiceAccountPersonalAccessTokens() options. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#list-all-personal-access-tokens-for-a-service-account-user +// https://docs.gitlab.com/api/service_accounts/#list-all-personal-access-tokens-for-a-group-service-account type ListServiceAccountPersonalAccessTokensOptions struct { ListOptions CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"` @@ -184,7 +185,7 @@ type ListServiceAccountPersonalAccessTokensOptions struct { LastUsedAfter *time.Time `url:"last_used_after,omitempty" json:"last_used_after,omitempty"` LastUsedBefore *time.Time `url:"last_used_before,omitempty" json:"last_used_before,omitempty"` Revoked *bool `url:"revoked,omitempty" json:"revoked,omitempty"` - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` Search *string `url:"search,omitempty" json:"search,omitempty"` Sort *string `url:"sort,omitempty" json:"sort,omitempty"` State *string `url:"state,omitempty" json:"state,omitempty"` @@ -194,8 +195,8 @@ type ListServiceAccountPersonalAccessTokensOptions struct { // service account user for a group. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#list-all-personal-access-tokens-for-a-service-account-user -func (s *GroupsService) ListServiceAccountPersonalAccessTokens(gid any, serviceAccount int, opt *ListServiceAccountPersonalAccessTokensOptions, options ...RequestOptionFunc) ([]*PersonalAccessToken, *Response, error) { +// https://docs.gitlab.com/api/service_accounts/#list-all-personal-access-tokens-for-a-group-service-account +func (s *GroupsService) ListServiceAccountPersonalAccessTokens(gid any, serviceAccount int64, opt *ListServiceAccountPersonalAccessTokensOptions, options ...RequestOptionFunc) ([]*PersonalAccessToken, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -220,7 +221,7 @@ func (s *GroupsService) ListServiceAccountPersonalAccessTokens(gid any, serviceA // CreateServiceAccountPersonalAccessToken() options. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#create-a-personal-access-token-for-a-service-account-user +// https://docs.gitlab.com/api/service_accounts/#create-a-personal-access-token-for-a-group-service-account type CreateServiceAccountPersonalAccessTokenOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"` @@ -232,8 +233,8 @@ type CreateServiceAccountPersonalAccessTokenOptions struct { // service account user for a group. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#create-a-personal-access-token-for-a-service-account-user -func (s *GroupsService) CreateServiceAccountPersonalAccessToken(gid any, serviceAccount int, opt *CreateServiceAccountPersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { +// https://docs.gitlab.com/api/service_accounts/#create-a-personal-access-token-for-a-group-service-account +func (s *GroupsService) CreateServiceAccountPersonalAccessToken(gid any, serviceAccount int64, opt *CreateServiceAccountPersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -258,8 +259,8 @@ func (s *GroupsService) CreateServiceAccountPersonalAccessToken(gid any, service // existing service account user in a given top-level group. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#revoke-a-personal-access-token-for-a-service-account-user -func (s *GroupsService) RevokeServiceAccountPersonalAccessToken(gid any, serviceAccount, token int, options ...RequestOptionFunc) (*Response, error) { +// https://docs.gitlab.com/api/service_accounts/#revoke-a-personal-access-token-for-a-group-service-account +func (s *GroupsService) RevokeServiceAccountPersonalAccessToken(gid any, serviceAccount, token int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -278,7 +279,7 @@ func (s *GroupsService) RevokeServiceAccountPersonalAccessToken(gid any, service // options. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#rotate-a-personal-access-token-for-a-service-account-user +// https://docs.gitlab.com/api/service_accounts/#rotate-a-personal-access-token-for-a-group-service-account type RotateServiceAccountPersonalAccessTokenOptions struct { ExpiresAt *ISOTime `url:"expires_at,omitempty" json:"expires_at,omitempty"` } @@ -287,8 +288,8 @@ type RotateServiceAccountPersonalAccessTokenOptions struct { // service account user for a group. // // GitLab API docs: -// https://docs.gitlab.com/api/group_service_accounts/#rotate-a-personal-access-token-for-a-service-account-user -func (s *GroupsService) RotateServiceAccountPersonalAccessToken(gid any, serviceAccount, token int, opt *RotateServiceAccountPersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { +// https://docs.gitlab.com/api/service_accounts/#rotate-a-personal-access-token-for-a-group-service-account +func (s *GroupsService) RotateServiceAccountPersonalAccessToken(gid any, serviceAccount, token int64, opt *RotateServiceAccountPersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_ssh_certificates.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_ssh_certificates.go index 62408d1c8..67a190ab9 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_ssh_certificates.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_ssh_certificates.go @@ -11,7 +11,7 @@ type ( GroupSSHCertificatesServiceInterface interface { ListGroupSSHCertificates(gid any, options ...RequestOptionFunc) ([]*GroupSSHCertificate, *Response, error) CreateGroupSSHCertificate(gid any, opt *CreateGroupSSHCertificateOptions, options ...RequestOptionFunc) (*GroupSSHCertificate, *Response, error) - DeleteGroupSSHCertificate(gid any, cert int, options ...RequestOptionFunc) (*Response, error) + DeleteGroupSSHCertificate(gid any, cert int64, options ...RequestOptionFunc) (*Response, error) } // GroupSSHCertificatesService handles communication with the group @@ -29,7 +29,7 @@ var _ GroupSSHCertificatesServiceInterface = (*GroupSSHCertificatesService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/group_ssh_certificates/ type GroupSSHCertificate struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` Key string `json:"key"` CreatedAt *time.Time `json:"created_at"` @@ -100,7 +100,7 @@ func (s *GroupSSHCertificatesService) CreateGroupSSHCertificate(gid any, opt *Cr // // GitLab API docs: // https://docs.gitlab.com/api/group_ssh_certificates/#delete-group-ssh-certificate -func (s *GroupSSHCertificatesService) DeleteGroupSSHCertificate(gid any, cert int, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupSSHCertificatesService) DeleteGroupSSHCertificate(gid any, cert int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_variables.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_variables.go index ae643a264..9da67d8b5 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_variables.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_variables.go @@ -17,7 +17,6 @@ package gitlab import ( - "fmt" "net/http" "net/url" ) @@ -69,31 +68,20 @@ func (v GroupVariable) String() string { // // GitLab API docs: // https://docs.gitlab.com/api/group_level_variables/#list-group-variables -type ListGroupVariablesOptions ListOptions +type ListGroupVariablesOptions struct { + ListOptions +} // ListVariables gets a list of all variables for a group. // // GitLab API docs: // https://docs.gitlab.com/api/group_level_variables/#list-group-variables func (s *GroupVariablesService) ListVariables(gid any, opt *ListGroupVariablesOptions, options ...RequestOptionFunc) ([]*GroupVariable, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/variables", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var vs []*GroupVariable - resp, err := s.client.Do(req, &vs) - if err != nil { - return nil, resp, err - } - - return vs, resp, nil + return do[[]*GroupVariable](s.client, + withPath("groups/%s/variables", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // GetGroupVariableOptions represents the available GetVariable() @@ -110,24 +98,11 @@ type GetGroupVariableOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_level_variables/#show-variable-details func (s *GroupVariablesService) GetVariable(gid any, key string, opt *GetGroupVariableOptions, options ...RequestOptionFunc) (*GroupVariable, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/variables/%s", PathEscape(group), url.PathEscape(key)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - v := new(GroupVariable) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, nil + return do[*GroupVariable](s.client, + withPath("groups/%s/variables/%s", GroupID{gid}, url.PathEscape(key)), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // CreateGroupVariableOptions represents the available CreateVariable() @@ -152,24 +127,12 @@ type CreateGroupVariableOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_level_variables/#create-variable func (s *GroupVariablesService) CreateVariable(gid any, opt *CreateGroupVariableOptions, options ...RequestOptionFunc) (*GroupVariable, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/variables", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - v := new(GroupVariable) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, nil + return do[*GroupVariable](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/variables", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // UpdateGroupVariableOptions represents the available UpdateVariable() @@ -194,24 +157,12 @@ type UpdateGroupVariableOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_level_variables/#update-variable func (s *GroupVariablesService) UpdateVariable(gid any, key string, opt *UpdateGroupVariableOptions, options ...RequestOptionFunc) (*GroupVariable, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/variables/%s", PathEscape(group), url.PathEscape(key)) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, nil, err - } - - v := new(GroupVariable) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, nil + return do[*GroupVariable](s.client, + withMethod(http.MethodPut), + withPath("groups/%s/variables/%s", GroupID{gid}, url.PathEscape(key)), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // RemoveGroupVariableOptions represents the available RemoveVariable() @@ -228,16 +179,11 @@ type RemoveGroupVariableOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_level_variables/#remove-variable func (s *GroupVariablesService) RemoveVariable(gid any, key string, opt *RemoveGroupVariableOptions, options ...RequestOptionFunc) (*Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/variables/%s", PathEscape(group), url.PathEscape(key)) - - req, err := s.client.NewRequest(http.MethodDelete, u, opt, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("groups/%s/variables/%s", GroupID{gid}, url.PathEscape(key)), + withAPIOpts(opt), + withRequestOpts(options...), + ) + return resp, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/group_wikis.go b/vendor/gitlab.com/gitlab-org/api/client-go/group_wikis.go index 3ed22e498..c78eedbc1 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/group_wikis.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/group_wikis.go @@ -16,9 +16,7 @@ package gitlab import ( - "fmt" "net/http" - "net/url" ) type ( @@ -71,24 +69,11 @@ type ListGroupWikisOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_wikis/#list-wiki-pages func (s *GroupWikisService) ListGroupWikis(gid any, opt *ListGroupWikisOptions, options ...RequestOptionFunc) ([]*GroupWiki, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/wikis", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var gws []*GroupWiki - resp, err := s.client.Do(req, &gws) - if err != nil { - return nil, resp, err - } - - return gws, resp, nil + return do[[]*GroupWiki](s.client, + withPath("groups/%s/wikis", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // GetGroupWikiPageOptions represents options to GetGroupWikiPage @@ -105,24 +90,11 @@ type GetGroupWikiPageOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_wikis/#get-a-wiki-page func (s *GroupWikisService) GetGroupWikiPage(gid any, slug string, opt *GetGroupWikiPageOptions, options ...RequestOptionFunc) (*GroupWiki, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/wikis/%s", PathEscape(group), url.PathEscape(slug)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - gw := new(GroupWiki) - resp, err := s.client.Do(req, gw) - if err != nil { - return nil, resp, err - } - - return gw, resp, nil + return do[*GroupWiki](s.client, + withPath("groups/%s/wikis/%s", GroupID{gid}, slug), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // CreateGroupWikiPageOptions represents options to CreateGroupWikiPage. @@ -141,24 +113,12 @@ type CreateGroupWikiPageOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_wikis/#create-a-new-wiki-page func (s *GroupWikisService) CreateGroupWikiPage(gid any, opt *CreateGroupWikiPageOptions, options ...RequestOptionFunc) (*GroupWiki, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/wikis", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - w := new(GroupWiki) - resp, err := s.client.Do(req, w) - if err != nil { - return nil, resp, err - } - - return w, resp, nil + return do[*GroupWiki](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/wikis", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // EditGroupWikiPageOptions represents options to EditGroupWikiPage. @@ -177,24 +137,12 @@ type EditGroupWikiPageOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/group_wikis/#edit-an-existing-wiki-page func (s *GroupWikisService) EditGroupWikiPage(gid any, slug string, opt *EditGroupWikiPageOptions, options ...RequestOptionFunc) (*GroupWiki, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/wikis/%s", PathEscape(group), url.PathEscape(slug)) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, nil, err - } - - w := new(GroupWiki) - resp, err := s.client.Do(req, w) - if err != nil { - return nil, resp, err - } - - return w, resp, nil + return do[*GroupWiki](s.client, + withMethod(http.MethodPut), + withPath("groups/%s/wikis/%s", GroupID{gid}, slug), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // DeleteGroupWikiPage deletes a wiki page with a given slug. @@ -202,16 +150,10 @@ func (s *GroupWikisService) EditGroupWikiPage(gid any, slug string, opt *EditGro // GitLab API docs: // https://docs.gitlab.com/api/group_wikis/#delete-a-wiki-page func (s *GroupWikisService) DeleteGroupWikiPage(gid any, slug string, options ...RequestOptionFunc) (*Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/wikis/%s", PathEscape(group), url.PathEscape(slug)) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("groups/%s/wikis/%s", GroupID{gid}, slug), + withRequestOpts(options...), + ) + return resp, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/groups.go b/vendor/gitlab.com/gitlab-org/api/client-go/groups.go index a45313428..9c2f096dd 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/groups.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/groups.go @@ -57,7 +57,7 @@ type ( AddGroupSAMLLink(gid any, opt *AddGroupSAMLLinkOptions, options ...RequestOptionFunc) (*SAMLGroupLink, *Response, error) DeleteGroupSAMLLink(gid any, samlGroupName string, options ...RequestOptionFunc) (*Response, error) ShareGroupWithGroup(gid any, opt *ShareGroupWithGroupOptions, options ...RequestOptionFunc) (*Group, *Response, error) - UnshareGroupFromGroup(gid any, groupID int, options ...RequestOptionFunc) (*Response, error) + UnshareGroupFromGroup(gid any, groupID int64, options ...RequestOptionFunc) (*Response, error) GetGroupPushRules(gid any, options ...RequestOptionFunc) (*GroupPushRules, *Response, error) AddGroupPushRule(gid any, opt *AddGroupPushRuleOptions, options ...RequestOptionFunc) (*GroupPushRules, *Response, error) EditGroupPushRule(gid any, opt *EditGroupPushRuleOptions, options ...RequestOptionFunc) (*GroupPushRules, *Response, error) @@ -65,33 +65,33 @@ type ( // group_hooks.go ListGroupHooks(gid any, opt *ListGroupHooksOptions, options ...RequestOptionFunc) ([]*GroupHook, *Response, error) - GetGroupHook(gid any, hook int, options ...RequestOptionFunc) (*GroupHook, *Response, error) - ResendGroupHookEvent(gid any, hook int, hookEventID int, options ...RequestOptionFunc) (*Response, error) + GetGroupHook(gid any, hook int64, options ...RequestOptionFunc) (*GroupHook, *Response, error) + ResendGroupHookEvent(gid any, hook int64, hookEventID int64, options ...RequestOptionFunc) (*Response, error) AddGroupHook(gid any, opt *AddGroupHookOptions, options ...RequestOptionFunc) (*GroupHook, *Response, error) - EditGroupHook(gid any, hook int, opt *EditGroupHookOptions, options ...RequestOptionFunc) (*GroupHook, *Response, error) - DeleteGroupHook(gid any, hook int, options ...RequestOptionFunc) (*Response, error) - TriggerTestGroupHook(pid any, hook int, trigger GroupHookTrigger, options ...RequestOptionFunc) (*Response, error) - SetGroupCustomHeader(gid any, hook int, key string, opt *SetHookCustomHeaderOptions, options ...RequestOptionFunc) (*Response, error) - DeleteGroupCustomHeader(gid any, hook int, key string, options ...RequestOptionFunc) (*Response, error) - SetGroupHookURLVariable(gid any, hook int, key string, opt *SetHookURLVariableOptions, options ...RequestOptionFunc) (*Response, error) - DeleteGroupHookURLVariable(gid any, hook int, key string, options ...RequestOptionFunc) (*Response, error) + EditGroupHook(gid any, hook int64, opt *EditGroupHookOptions, options ...RequestOptionFunc) (*GroupHook, *Response, error) + DeleteGroupHook(gid any, hook int64, options ...RequestOptionFunc) (*Response, error) + TriggerTestGroupHook(pid any, hook int64, trigger GroupHookTrigger, options ...RequestOptionFunc) (*Response, error) + SetGroupCustomHeader(gid any, hook int64, key string, opt *SetHookCustomHeaderOptions, options ...RequestOptionFunc) (*Response, error) + DeleteGroupCustomHeader(gid any, hook int64, key string, options ...RequestOptionFunc) (*Response, error) + SetGroupHookURLVariable(gid any, hook int64, key string, opt *SetHookURLVariableOptions, options ...RequestOptionFunc) (*Response, error) + DeleteGroupHookURLVariable(gid any, hook int64, key string, options ...RequestOptionFunc) (*Response, error) // group_serviceaccounts.go ListServiceAccounts(gid any, opt *ListServiceAccountsOptions, options ...RequestOptionFunc) ([]*GroupServiceAccount, *Response, error) CreateServiceAccount(gid any, opt *CreateServiceAccountOptions, options ...RequestOptionFunc) (*GroupServiceAccount, *Response, error) - UpdateServiceAccount(gid any, serviceAccount int, opt *UpdateServiceAccountOptions, options ...RequestOptionFunc) (*GroupServiceAccount, *Response, error) - DeleteServiceAccount(gid any, serviceAccount int, opt *DeleteServiceAccountOptions, options ...RequestOptionFunc) (*Response, error) - ListServiceAccountPersonalAccessTokens(gid any, serviceAccount int, opt *ListServiceAccountPersonalAccessTokensOptions, options ...RequestOptionFunc) ([]*PersonalAccessToken, *Response, error) - CreateServiceAccountPersonalAccessToken(gid any, serviceAccount int, opt *CreateServiceAccountPersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) - RevokeServiceAccountPersonalAccessToken(gid any, serviceAccount, token int, options ...RequestOptionFunc) (*Response, error) - RotateServiceAccountPersonalAccessToken(gid any, serviceAccount, token int, opt *RotateServiceAccountPersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) + UpdateServiceAccount(gid any, serviceAccount int64, opt *UpdateServiceAccountOptions, options ...RequestOptionFunc) (*GroupServiceAccount, *Response, error) + DeleteServiceAccount(gid any, serviceAccount int64, opt *DeleteServiceAccountOptions, options ...RequestOptionFunc) (*Response, error) + ListServiceAccountPersonalAccessTokens(gid any, serviceAccount int64, opt *ListServiceAccountPersonalAccessTokensOptions, options ...RequestOptionFunc) ([]*PersonalAccessToken, *Response, error) + CreateServiceAccountPersonalAccessToken(gid any, serviceAccount int64, opt *CreateServiceAccountPersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) + RevokeServiceAccountPersonalAccessToken(gid any, serviceAccount, token int64, options ...RequestOptionFunc) (*Response, error) + RotateServiceAccountPersonalAccessToken(gid any, serviceAccount, token int64, opt *RotateServiceAccountPersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) // group_members.go ListGroupMembers(gid any, opt *ListGroupMembersOptions, options ...RequestOptionFunc) ([]*GroupMember, *Response, error) ListAllGroupMembers(gid any, opt *ListGroupMembersOptions, options ...RequestOptionFunc) ([]*GroupMember, *Response, error) ListBillableGroupMembers(gid any, opt *ListBillableGroupMembersOptions, options ...RequestOptionFunc) ([]*BillableGroupMember, *Response, error) - ListMembershipsForBillableGroupMember(gid any, user int, opt *ListMembershipsForBillableGroupMemberOptions, options ...RequestOptionFunc) ([]*BillableUserMembership, *Response, error) - RemoveBillableGroupMember(gid any, user int, options ...RequestOptionFunc) (*Response, error) + ListMembershipsForBillableGroupMember(gid any, user int64, opt *ListMembershipsForBillableGroupMemberOptions, options ...RequestOptionFunc) ([]*BillableUserMembership, *Response, error) + RemoveBillableGroupMember(gid any, user int64, options ...RequestOptionFunc) (*Response, error) } // GroupsService handles communication with the group related methods of @@ -109,7 +109,7 @@ var _ GroupsServiceInterface = (*GroupsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/groups/ type Group struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Path string `json:"path"` Description string `json:"description"` @@ -124,13 +124,13 @@ type Group struct { RepositoryStorage string `json:"repository_storage"` FullName string `json:"full_name"` FullPath string `json:"full_path"` - FileTemplateProjectID int `json:"file_template_project_id"` - ParentID int `json:"parent_id"` + FileTemplateProjectID int64 `json:"file_template_project_id"` + ParentID int64 `json:"parent_id"` Statistics *Statistics `json:"statistics"` CustomAttributes []*CustomAttribute `json:"custom_attributes"` ShareWithGroupLock bool `json:"share_with_group_lock"` RequireTwoFactorAuth bool `json:"require_two_factor_authentication"` - TwoFactorGracePeriod int `json:"two_factor_grace_period"` + TwoFactorGracePeriod int64 `json:"two_factor_grace_period"` ProjectCreationLevel ProjectCreationLevelValue `json:"project_creation_level"` AutoDevopsEnabled bool `json:"auto_devops_enabled"` SubGroupCreationLevel SubGroupCreationLevelValue `json:"subgroup_creation_level"` @@ -143,8 +143,8 @@ type Group struct { LDAPAccess AccessLevelValue `json:"ldap_access"` LDAPGroupLinks []*LDAPGroupLink `json:"ldap_group_links"` SAMLGroupLinks []*SAMLGroupLink `json:"saml_group_links"` - SharedRunnersMinutesLimit int `json:"shared_runners_minutes_limit"` - ExtraSharedRunnersMinutesLimit int `json:"extra_shared_runners_minutes_limit"` + SharedRunnersMinutesLimit int64 `json:"shared_runners_minutes_limit"` + ExtraSharedRunnersMinutesLimit int64 `json:"extra_shared_runners_minutes_limit"` PreventForkingOutsideGroup bool `json:"prevent_forking_outside_group"` MarkedForDeletionOn *ISOTime `json:"marked_for_deletion_on"` CreatedAt *time.Time `json:"created_at"` @@ -152,6 +152,10 @@ type Group struct { AllowedEmailDomainsList string `json:"allowed_email_domains_list"` WikiAccessLevel AccessControlValue `json:"wiki_access_level"` + OnlyAllowMergeIfPipelineSucceeds bool `json:"only_allow_merge_if_pipeline_succeeds"` + AllowMergeOnSkippedPipeline bool `json:"allow_merge_on_skipped_pipeline"` + OnlyAllowMergeIfAllDiscussionsAreResolved bool `json:"only_allow_merge_if_all_discussions_are_resolved"` + // Deprecated: will be removed in v5 of the API, use ListGroupProjects instead Projects []*Project `json:"projects"` @@ -162,19 +166,19 @@ type Group struct { EmailsDisabled bool `json:"emails_disabled"` // Deprecated: Use DefaultBranchProtectionDefaults instead - DefaultBranchProtection int `json:"default_branch_protection"` + DefaultBranchProtection int64 `json:"default_branch_protection"` } // SharedWithGroup represents a GitLab group shared with a group. // // GitLab API docs: https://docs.gitlab.com/api/groups/ type SharedWithGroup struct { - GroupID int `json:"group_id"` + GroupID int64 `json:"group_id"` GroupName string `json:"group_name"` GroupFullPath string `json:"group_full_path"` - GroupAccessLevel int `json:"group_access_level"` + GroupAccessLevel int64 `json:"group_access_level"` ExpiresAt *ISOTime `json:"expires_at"` - MemberRoleID int `json:"member_role_id"` + MemberRoleID int64 `json:"member_role_id"` } // BranchProtectionDefaults represents default Git protected branch permissions. @@ -231,7 +235,7 @@ type LDAPGroupLink struct { type SAMLGroupLink struct { Name string `json:"name"` AccessLevel AccessLevelValue `json:"access_level"` - MemberRoleID int `json:"member_role_id,omitempty"` + MemberRoleID int64 `json:"member_role_id,omitempty"` } // ListGroupsOptions represents the available ListGroups() options. @@ -239,7 +243,7 @@ type SAMLGroupLink struct { // GitLab API docs: https://docs.gitlab.com/api/groups/#list-groups type ListGroupsOptions struct { ListOptions - SkipGroups *[]int `url:"skip_groups,omitempty" del:"," json:"skip_groups,omitempty"` + SkipGroups *[]int64 `url:"skip_groups,omitempty" del:"," json:"skip_groups,omitempty"` AllAvailable *bool `url:"all_available,omitempty" json:"all_available,omitempty"` Search *string `url:"search,omitempty" json:"search,omitempty"` OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"` @@ -334,7 +338,7 @@ func (s *GroupsService) ListDescendantGroups(gid any, opt *ListDescendantGroupsO return gs, resp, nil } -// ListGroupProjectsOptions represents the available ListGroup() options. +// ListGroupProjectsOptions represents the available ListGroupProjects() options. // // GitLab API docs: // https://docs.gitlab.com/api/groups/#list-projects @@ -456,7 +460,7 @@ type CreateGroupOptions struct { Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"` ShareWithGroupLock *bool `url:"share_with_group_lock,omitempty" json:"share_with_group_lock,omitempty"` RequireTwoFactorAuth *bool `url:"require_two_factor_authentication,omitempty" json:"require_two_factor_authentication,omitempty"` - TwoFactorGracePeriod *int `url:"two_factor_grace_period,omitempty" json:"two_factor_grace_period,omitempty"` + TwoFactorGracePeriod *int64 `url:"two_factor_grace_period,omitempty" json:"two_factor_grace_period,omitempty"` ProjectCreationLevel *ProjectCreationLevelValue `url:"project_creation_level,omitempty" json:"project_creation_level,omitempty"` AutoDevopsEnabled *bool `url:"auto_devops_enabled,omitempty" json:"auto_devops_enabled,omitempty"` SubGroupCreationLevel *SubGroupCreationLevelValue `url:"subgroup_creation_level,omitempty" json:"subgroup_creation_level,omitempty"` @@ -465,16 +469,16 @@ type CreateGroupOptions struct { LFSEnabled *bool `url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"` DefaultBranchProtectionDefaults *DefaultBranchProtectionDefaultsOptions `url:"default_branch_protection_defaults,omitempty" json:"default_branch_protection_defaults,omitempty"` RequestAccessEnabled *bool `url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"` - ParentID *int `url:"parent_id,omitempty" json:"parent_id,omitempty"` - SharedRunnersMinutesLimit *int `url:"shared_runners_minutes_limit,omitempty" json:"shared_runners_minutes_limit,omitempty"` - ExtraSharedRunnersMinutesLimit *int `url:"extra_shared_runners_minutes_limit,omitempty" json:"extra_shared_runners_minutes_limit,omitempty"` + ParentID *int64 `url:"parent_id,omitempty" json:"parent_id,omitempty"` + SharedRunnersMinutesLimit *int64 `url:"shared_runners_minutes_limit,omitempty" json:"shared_runners_minutes_limit,omitempty"` + ExtraSharedRunnersMinutesLimit *int64 `url:"extra_shared_runners_minutes_limit,omitempty" json:"extra_shared_runners_minutes_limit,omitempty"` WikiAccessLevel *AccessControlValue `url:"wiki_access_level,omitempty" json:"wiki_access_level,omitempty"` // Deprecated: Use EmailsEnabled instead EmailsDisabled *bool `url:"emails_disabled,omitempty" json:"emails_disabled,omitempty"` // Deprecated: User DefaultBranchProtectionDefaults instead - DefaultBranchProtection *int `url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"` + DefaultBranchProtection *int64 `url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"` } // DefaultBranchProtectionDefaultsOptions represents the available options for @@ -503,7 +507,7 @@ func (d *DefaultBranchProtectionDefaultsOptions) EncodeValues(key string, v *url if d.AllowedToMerge != nil { for _, atm := range *d.AllowedToMerge { if atm != nil { - v.Add(key+"[allowed_to_merge][][access_level]", strconv.Itoa((int)(*atm.AccessLevel))) + v.Add(key+"[allowed_to_merge][][access_level]", strconv.FormatInt((int64)(*atm.AccessLevel), 10)) } } } @@ -513,7 +517,7 @@ func (d *DefaultBranchProtectionDefaultsOptions) EncodeValues(key string, v *url if d.AllowedToPush != nil { for _, atp := range *d.AllowedToPush { if atp != nil { - v.Add(key+"[allowed_to_push][][access_level]", strconv.Itoa((int)(*atp.AccessLevel))) + v.Add(key+"[allowed_to_push][][access_level]", strconv.FormatInt((int64)(*atp.AccessLevel), 10)) } } } @@ -600,7 +604,7 @@ func (s *GroupsService) TransferGroup(gid any, pid any, options ...RequestOption // GitLab API docs: // https://docs.gitlab.com/api/groups/#transfer-a-group type TransferSubGroupOptions struct { - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` } // TransferSubGroup transfers a group to a new parent group or turn a subgroup @@ -642,7 +646,7 @@ type UpdateGroupOptions struct { Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"` ShareWithGroupLock *bool `url:"share_with_group_lock,omitempty" json:"share_with_group_lock,omitempty"` RequireTwoFactorAuth *bool `url:"require_two_factor_authentication,omitempty" json:"require_two_factor_authentication,omitempty"` - TwoFactorGracePeriod *int `url:"two_factor_grace_period,omitempty" json:"two_factor_grace_period,omitempty"` + TwoFactorGracePeriod *int64 `url:"two_factor_grace_period,omitempty" json:"two_factor_grace_period,omitempty"` ProjectCreationLevel *ProjectCreationLevelValue `url:"project_creation_level,omitempty" json:"project_creation_level,omitempty"` AutoDevopsEnabled *bool `url:"auto_devops_enabled,omitempty" json:"auto_devops_enabled,omitempty"` SubGroupCreationLevel *SubGroupCreationLevelValue `url:"subgroup_creation_level,omitempty" json:"subgroup_creation_level,omitempty"` @@ -651,9 +655,9 @@ type UpdateGroupOptions struct { LFSEnabled *bool `url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"` RequestAccessEnabled *bool `url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"` DefaultBranchProtectionDefaults *DefaultBranchProtectionDefaultsOptions `url:"default_branch_protection_defaults,omitempty" json:"default_branch_protection_defaults,omitempty"` - FileTemplateProjectID *int `url:"file_template_project_id,omitempty" json:"file_template_project_id,omitempty"` - SharedRunnersMinutesLimit *int `url:"shared_runners_minutes_limit,omitempty" json:"shared_runners_minutes_limit,omitempty"` - ExtraSharedRunnersMinutesLimit *int `url:"extra_shared_runners_minutes_limit,omitempty" json:"extra_shared_runners_minutes_limit,omitempty"` + FileTemplateProjectID *int64 `url:"file_template_project_id,omitempty" json:"file_template_project_id,omitempty"` + SharedRunnersMinutesLimit *int64 `url:"shared_runners_minutes_limit,omitempty" json:"shared_runners_minutes_limit,omitempty"` + ExtraSharedRunnersMinutesLimit *int64 `url:"extra_shared_runners_minutes_limit,omitempty" json:"extra_shared_runners_minutes_limit,omitempty"` PreventForkingOutsideGroup *bool `url:"prevent_forking_outside_group,omitempty" json:"prevent_forking_outside_group,omitempty"` SharedRunnersSetting *SharedRunnersSettingValue `url:"shared_runners_setting,omitempty" json:"shared_runners_setting,omitempty"` PreventSharingGroupsOutsideHierarchy *bool `url:"prevent_sharing_groups_outside_hierarchy,omitempty" json:"prevent_sharing_groups_outside_hierarchy,omitempty"` @@ -661,11 +665,15 @@ type UpdateGroupOptions struct { AllowedEmailDomainsList *string `url:"allowed_email_domains_list,omitempty" json:"allowed_email_domains_list,omitempty"` WikiAccessLevel *AccessControlValue `url:"wiki_access_level,omitempty" json:"wiki_access_level,omitempty"` + OnlyAllowMergeIfPipelineSucceeds *bool `url:"only_allow_merge_if_pipeline_succeeds,omitempty" json:"only_allow_merge_if_pipeline_succeeds,omitempty"` + AllowMergeOnSkippedPipeline *bool `url:"allow_merge_on_skipped_pipeline,omitempty" json:"allow_merge_on_skipped_pipeline,omitempty"` + OnlyAllowMergeIfAllDiscussionsAreResolved *bool `url:"only_allow_merge_if_all_discussions_are_resolved,omitempty" json:"only_allow_merge_if_all_discussions_are_resolved,omitempty"` + // Deprecated: Use EmailsEnabled instead EmailsDisabled *bool `url:"emails_disabled,omitempty" json:"emails_disabled,omitempty"` // Deprecated: Use DefaultBranchProtectionDefaults instead - DefaultBranchProtection *int `url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"` + DefaultBranchProtection *int64 `url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"` } // UpdateGroup updates an existing group; only available to group owners and @@ -1108,7 +1116,7 @@ func (s *GroupsService) GetGroupSAMLLink(gid any, samlGroupName string, options type AddGroupSAMLLinkOptions struct { SAMLGroupName *string `url:"saml_group_name,omitempty" json:"saml_group_name,omitempty"` AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` - MemberRoleID *int `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` + MemberRoleID *int64 `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` } // AddGroupSAMLLink creates a new group SAML link. Available only for users who @@ -1162,10 +1170,10 @@ func (s *GroupsService) DeleteGroupSAMLLink(gid any, samlGroupName string, optio // GitLab API docs: // https://docs.gitlab.com/api/groups/#share-groups-with-groups type ShareGroupWithGroupOptions struct { - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` GroupAccess *AccessLevelValue `url:"group_access,omitempty" json:"group_access,omitempty"` ExpiresAt *ISOTime `url:"expires_at,omitempty" json:"expires_at,omitempty"` - MemberRoleID *int `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` + MemberRoleID *int64 `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` } // ShareGroupWithGroup shares a group with another group. @@ -1197,7 +1205,7 @@ func (s *GroupsService) ShareGroupWithGroup(gid any, opt *ShareGroupWithGroupOpt // // GitLab API docs: // https://docs.gitlab.com/api/groups/#delete-the-link-that-shares-a-group-with-another-group -func (s *GroupsService) UnshareGroupFromGroup(gid any, groupID int, options ...RequestOptionFunc) (*Response, error) { +func (s *GroupsService) UnshareGroupFromGroup(gid any, groupID int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -1217,7 +1225,7 @@ func (s *GroupsService) UnshareGroupFromGroup(gid any, groupID int, options ...R // GitLab API docs: // https://docs.gitlab.com/api/group_push_rules/#get-the-push-rules-of-a-group type GroupPushRules struct { - ID int `json:"id"` + ID int64 `json:"id"` CreatedAt *time.Time `json:"created_at"` CommitMessageRegex string `json:"commit_message_regex"` CommitMessageNegativeRegex string `json:"commit_message_negative_regex"` @@ -1227,7 +1235,7 @@ type GroupPushRules struct { PreventSecrets bool `json:"prevent_secrets"` AuthorEmailRegex string `json:"author_email_regex"` FileNameRegex string `json:"file_name_regex"` - MaxFileSize int `json:"max_file_size"` + MaxFileSize int64 `json:"max_file_size"` CommitCommitterCheck bool `json:"commit_committer_check"` CommitCommitterNameCheck bool `json:"commit_committer_name_check"` RejectUnsignedCommits bool `json:"reject_unsigned_commits"` @@ -1273,7 +1281,7 @@ type AddGroupPushRuleOptions struct { CommitMessageRegex *string `url:"commit_message_regex,omitempty" json:"commit_message_regex,omitempty"` DenyDeleteTag *bool `url:"deny_delete_tag,omitempty" json:"deny_delete_tag,omitempty"` FileNameRegex *string `url:"file_name_regex,omitempty" json:"file_name_regex,omitempty"` - MaxFileSize *int `url:"max_file_size,omitempty" json:"max_file_size,omitempty"` + MaxFileSize *int64 `url:"max_file_size,omitempty" json:"max_file_size,omitempty"` MemberCheck *bool `url:"member_check,omitempty" json:"member_check,omitempty"` PreventSecrets *bool `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"` RejectUnsignedCommits *bool `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"` @@ -1319,7 +1327,7 @@ type EditGroupPushRuleOptions struct { CommitMessageRegex *string `url:"commit_message_regex,omitempty" json:"commit_message_regex,omitempty"` DenyDeleteTag *bool `url:"deny_delete_tag,omitempty" json:"deny_delete_tag,omitempty"` FileNameRegex *string `url:"file_name_regex,omitempty" json:"file_name_regex,omitempty"` - MaxFileSize *int `url:"max_file_size,omitempty" json:"max_file_size,omitempty"` + MaxFileSize *int64 `url:"max_file_size,omitempty" json:"max_file_size,omitempty"` MemberCheck *bool `url:"member_check,omitempty" json:"member_check,omitempty"` PreventSecrets *bool `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"` RejectUnsignedCommits *bool `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"` diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/import.go b/vendor/gitlab.com/gitlab-org/api/client-go/import.go index ea4fdce8f..68424b690 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/import.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/import.go @@ -46,11 +46,11 @@ var _ ImportServiceInterface = (*ImportService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/import/#import-repository-from-github type GitHubImport struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` FullPath string `json:"full_path"` FullName string `json:"full_name"` - RefsUrl string `json:"refs_url"` + RefsURL string `json:"refs_url"` ImportSource string `json:"import_source"` ImportStatus string `json:"import_status"` HumanImportStatusName string `json:"human_import_status_name"` @@ -69,17 +69,19 @@ func (s GitHubImport) String() string { // GitLab API docs: // https://docs.gitlab.com/api/import/#import-repository-from-github type ImportRepositoryFromGitHubOptions struct { - PersonalAccessToken *string `url:"personal_access_token,omitempty" json:"personal_access_token,omitempty"` - RepoID *int `url:"repo_id,omitempty" json:"repo_id,omitempty"` - NewName *string `url:"new_name,omitempty" json:"new_name,omitempty"` - TargetNamespace *string `url:"target_namespace,omitempty" json:"target_namespace,omitempty"` - GitHubHostname *string `url:"github_hostname,omitempty" json:"github_hostname,omitempty"` - OptionalStages struct { - SingleEndpointNotesImport *bool `url:"single_endpoint_notes_import,omitempty" json:"single_endpoint_notes_import,omitempty"` - AttachmentsImport *bool `url:"attachments_import,omitempty" json:"attachments_import,omitempty"` - CollaboratorsImport *bool `url:"collaborators_import,omitempty" json:"collaborators_import,omitempty"` - } `url:"optional_stages,omitempty" json:"optional_stages,omitempty"` - TimeoutStrategy *string `url:"timeout_strategy,omitempty" json:"timeout_strategy,omitempty"` + PersonalAccessToken *string `url:"personal_access_token,omitempty" json:"personal_access_token,omitempty"` + RepoID *int64 `url:"repo_id,omitempty" json:"repo_id,omitempty"` + NewName *string `url:"new_name,omitempty" json:"new_name,omitempty"` + TargetNamespace *string `url:"target_namespace,omitempty" json:"target_namespace,omitempty"` + GitHubHostname *string `url:"github_hostname,omitempty" json:"github_hostname,omitempty"` + OptionalStages ImportRepositoryFromGitHubOptionalStagesOptions `url:"optional_stages,omitempty" json:"optional_stages,omitempty"` + TimeoutStrategy *string `url:"timeout_strategy,omitempty" json:"timeout_strategy,omitempty"` +} + +type ImportRepositoryFromGitHubOptionalStagesOptions struct { + SingleEndpointNotesImport *bool `url:"single_endpoint_notes_import,omitempty" json:"single_endpoint_notes_import,omitempty"` + AttachmentsImport *bool `url:"attachments_import,omitempty" json:"attachments_import,omitempty"` + CollaboratorsImport *bool `url:"collaborators_import,omitempty" json:"collaborators_import,omitempty"` } // ImportRepositoryFromGitHub imports a repository from GitHub. @@ -101,7 +103,7 @@ func (s *ImportService) ImportRepositoryFromGitHub(opt *ImportRepositoryFromGitH // GitLab API docs: // https://docs.gitlab.com/api/import/#cancel-github-project-import type CancelledGitHubImport struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` FullPath string `json:"full_path"` FullName string `json:"full_name"` @@ -121,7 +123,7 @@ func (s CancelledGitHubImport) String() string { // GitLab API docs: // https://docs.gitlab.com/api/import/#cancel-github-project-import type CancelGitHubProjectImportOptions struct { - ProjectID *int `url:"project_id,omitempty" json:"project_id,omitempty"` + ProjectID *int64 `url:"project_id,omitempty" json:"project_id,omitempty"` } // CancelGitHubProjectImport cancels an import of a repository from GitHub. @@ -166,11 +168,11 @@ func (s *ImportService) ImportGitHubGistsIntoGitLabSnippets(opt *ImportGitHubGis // GitLab API docs: // https://docs.gitlab.com/api/import/#import-repository-from-bitbucket-server type BitbucketServerImport struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` FullPath string `json:"full_path"` FullName string `json:"full_name"` - RefsUrl string `json:"refs_url"` + RefsURL string `json:"refs_url"` } func (s BitbucketServerImport) String() string { @@ -182,7 +184,7 @@ func (s BitbucketServerImport) String() string { // GitLab API docs: // https://docs.gitlab.com/api/import/#import-repository-from-bitbucket-server type ImportRepositoryFromBitbucketServerOptions struct { - BitbucketServerUrl *string `url:"bitbucket_server_url,omitempty" json:"bitbucket_server_url,omitempty"` + BitbucketServerURL *string `url:"bitbucket_server_url,omitempty" json:"bitbucket_server_url,omitempty"` BitbucketServerUsername *string `url:"bitbucket_server_username,omitempty" json:"bitbucket_server_username,omitempty"` PersonalAccessToken *string `url:"personal_access_token,omitempty" json:"personal_access_token,omitempty"` BitbucketServerProject *string `url:"bitbucket_server_project,omitempty" json:"bitbucket_server_project,omitempty"` @@ -211,11 +213,11 @@ func (s *ImportService) ImportRepositoryFromBitbucketServer(opt *ImportRepositor // GitLab API docs: // https://docs.gitlab.com/api/import/#import-repository-from-bitbucket-cloud type BitbucketCloudImport struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` FullPath string `json:"full_path"` FullName string `json:"full_name"` - RefsUrl string `json:"refs_url"` + RefsURL string `json:"refs_url"` ImportSource string `json:"import_source"` ImportStatus string `json:"import_status"` HumanImportStatusName string `json:"human_import_status_name"` diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/instance_clusters.go b/vendor/gitlab.com/gitlab-org/api/client-go/instance_clusters.go index fd4bce6be..ae143e20a 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/instance_clusters.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/instance_clusters.go @@ -28,13 +28,13 @@ type ( // Deprecated: in GitLab 14.5, to be removed in 19.0 ListClusters(options ...RequestOptionFunc) ([]*InstanceCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 - GetCluster(cluster int, options ...RequestOptionFunc) (*InstanceCluster, *Response, error) + GetCluster(cluster int64, options ...RequestOptionFunc) (*InstanceCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 AddCluster(opt *AddClusterOptions, options ...RequestOptionFunc) (*InstanceCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 - EditCluster(cluster int, opt *EditClusterOptions, options ...RequestOptionFunc) (*InstanceCluster, *Response, error) + EditCluster(cluster int64, opt *EditClusterOptions, options ...RequestOptionFunc) (*InstanceCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 - DeleteCluster(cluster int, options ...RequestOptionFunc) (*Response, error) + DeleteCluster(cluster int64, options ...RequestOptionFunc) (*Response, error) } // InstanceClustersService handles communication with the @@ -56,7 +56,7 @@ var _ InstanceClustersServiceInterface = (*InstanceClustersService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/instance_clusters/ type InstanceCluster struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Domain string `json:"domain"` Managed bool `json:"managed"` @@ -102,7 +102,7 @@ func (s *InstanceClustersService) ListClusters(options ...RequestOptionFunc) ([] // // GitLab API docs: // https://docs.gitlab.com/api/instance_clusters/#get-a-single-instance-cluster -func (s *InstanceClustersService) GetCluster(cluster int, options ...RequestOptionFunc) (*InstanceCluster, *Response, error) { +func (s *InstanceClustersService) GetCluster(cluster int64, options ...RequestOptionFunc) (*InstanceCluster, *Response, error) { u := fmt.Sprintf("admin/clusters/%d", cluster) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -146,7 +146,7 @@ func (s *InstanceClustersService) AddCluster(opt *AddClusterOptions, options ... // // GitLab API docs: // https://docs.gitlab.com/api/instance_clusters/#edit-instance-cluster -func (s *InstanceClustersService) EditCluster(cluster int, opt *EditClusterOptions, options ...RequestOptionFunc) (*InstanceCluster, *Response, error) { +func (s *InstanceClustersService) EditCluster(cluster int64, opt *EditClusterOptions, options ...RequestOptionFunc) (*InstanceCluster, *Response, error) { u := fmt.Sprintf("admin/clusters/%d", cluster) req, err := s.client.NewRequest(http.MethodPut, u, opt, options) @@ -168,7 +168,7 @@ func (s *InstanceClustersService) EditCluster(cluster int, opt *EditClusterOptio // // GitLab API docs: // https://docs.gitlab.com/api/instance_clusters/#delete-instance-cluster -func (s *InstanceClustersService) DeleteCluster(cluster int, options ...RequestOptionFunc) (*Response, error) { +func (s *InstanceClustersService) DeleteCluster(cluster int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("admin/clusters/%d", cluster) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/instance_variables.go b/vendor/gitlab.com/gitlab-org/api/client-go/instance_variables.go index 235a333e3..d5b6fd1be 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/instance_variables.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/instance_variables.go @@ -66,7 +66,9 @@ func (v InstanceVariable) String() string { // // GitLab API docs: // https://docs.gitlab.com/api/instance_level_ci_variables/#list-all-instance-variables -type ListInstanceVariablesOptions ListOptions +type ListInstanceVariablesOptions struct { + ListOptions +} // ListVariables gets a list of all variables for an instance. // diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/integrations.go b/vendor/gitlab.com/gitlab-org/api/client-go/integrations.go index 9885727ce..b8a528601 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/integrations.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/integrations.go @@ -102,7 +102,7 @@ var _ IntegrationsServiceInterface = (*IntegrationsService)(nil) // https://docs.gitlab.com/api/group_integrations/ // https://docs.gitlab.com/api/project_integrations/ type Integration struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` Slug string `json:"slug"` CreatedAt *time.Time `json:"created_at"` @@ -216,7 +216,7 @@ type SetMicrosoftTeamsNotificationsOptions struct { func (s *IntegrationsService) SetGroupMicrosoftTeamsNotifications(gid any, opt *SetMicrosoftTeamsNotificationsOptions, options ...RequestOptionFunc) (*Integration, *Response, error) { return do[*Integration]( s.client, - withPath("groups/%s/integrations/microsoft_teams", GroupID{gid}), + withPath("groups/%s/integrations/microsoft-teams", GroupID{gid}), withMethod(http.MethodPut), withAPIOpts(opt), withRequestOpts(options...), @@ -226,7 +226,7 @@ func (s *IntegrationsService) SetGroupMicrosoftTeamsNotifications(gid any, opt * func (s *IntegrationsService) DisableGroupMicrosoftTeamsNotifications(gid any, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none]( s.client, - withPath("groups/%s/integrations/microsoft_teams", GroupID{gid}), + withPath("groups/%s/integrations/microsoft-teams", GroupID{gid}), withMethod(http.MethodDelete), withRequestOpts(options...), ) @@ -236,7 +236,7 @@ func (s *IntegrationsService) DisableGroupMicrosoftTeamsNotifications(gid any, o func (s *IntegrationsService) GetGroupMicrosoftTeamsNotifications(gid any, options ...RequestOptionFunc) (*Integration, *Response, error) { return do[*Integration]( s.client, - withPath("groups/%s/integrations/microsoft_teams", GroupID{gid}), + withPath("groups/%s/integrations/microsoft-teams", GroupID{gid}), withMethod(http.MethodGet), withRequestOpts(options...), ) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/invites.go b/vendor/gitlab.com/gitlab-org/api/client-go/invites.go index 71b64e078..e8ef7bdec 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/invites.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/invites.go @@ -45,7 +45,7 @@ var _ InvitesServiceInterface = (*InvitesService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/invitations/ type PendingInvite struct { - ID int `json:"id"` + ID int64 `json:"id"` InviteEmail string `json:"invite_email"` CreatedAt *time.Time `json:"created_at"` AccessLevel AccessLevelValue `json:"access_level"` diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/issue_links.go b/vendor/gitlab.com/gitlab-org/api/client-go/issue_links.go index c3d360a97..1562e7c21 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/issue_links.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/issue_links.go @@ -23,10 +23,10 @@ import ( type ( IssueLinksServiceInterface interface { - ListIssueRelations(pid any, issue int, options ...RequestOptionFunc) ([]*IssueRelation, *Response, error) - GetIssueLink(pid any, issue, issueLink int, options ...RequestOptionFunc) (*IssueLink, *Response, error) - CreateIssueLink(pid any, issue int, opt *CreateIssueLinkOptions, options ...RequestOptionFunc) (*IssueLink, *Response, error) - DeleteIssueLink(pid any, issue, issueLink int, options ...RequestOptionFunc) (*IssueLink, *Response, error) + ListIssueRelations(pid any, issue int64, options ...RequestOptionFunc) ([]*IssueRelation, *Response, error) + GetIssueLink(pid any, issue, issueLink int64, options ...RequestOptionFunc) (*IssueLink, *Response, error) + CreateIssueLink(pid any, issue int64, opt *CreateIssueLinkOptions, options ...RequestOptionFunc) (*IssueLink, *Response, error) + DeleteIssueLink(pid any, issue, issueLink int64, options ...RequestOptionFunc) (*IssueLink, *Response, error) } // IssueLinksService handles communication with the issue relations related methods @@ -54,14 +54,14 @@ type IssueLink struct { // GitLab API docs: // https://docs.gitlab.com/api/issue_links/#list-issue-relations type IssueRelation struct { - ID int `json:"id"` - IID int `json:"iid"` + ID int64 `json:"id"` + IID int64 `json:"iid"` State string `json:"state"` Description string `json:"description"` Confidential bool `json:"confidential"` Author *IssueAuthor `json:"author"` Milestone *Milestone `json:"milestone"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Assignees []*IssueAssignee `json:"assignees"` Assignee *IssueAssignee `json:"assignee"` UpdatedAt *time.Time `json:"updated_at"` @@ -71,9 +71,9 @@ type IssueRelation struct { DueDate *ISOTime `json:"due_date"` WebURL string `json:"web_url"` References *IssueReferences `json:"references"` - Weight int `json:"weight"` - UserNotesCount int `json:"user_notes_count"` - IssueLinkID int `json:"issue_link_id"` + Weight int64 `json:"weight"` + UserNotesCount int64 `json:"user_notes_count"` + IssueLinkID int64 `json:"issue_link_id"` LinkType string `json:"link_type"` LinkCreatedAt *time.Time `json:"link_created_at"` LinkUpdatedAt *time.Time `json:"link_updated_at"` @@ -86,7 +86,7 @@ type IssueRelation struct { // // GitLab API docs: // https://docs.gitlab.com/api/issue_links/#list-issue-relations -func (s *IssueLinksService) ListIssueRelations(pid any, issue int, options ...RequestOptionFunc) ([]*IssueRelation, *Response, error) { +func (s *IssueLinksService) ListIssueRelations(pid any, issue int64, options ...RequestOptionFunc) ([]*IssueRelation, *Response, error) { // Use explicit format string for the path return do[[]*IssueRelation](s.client, withPath("projects/%s/issues/%d/links", ProjectID{pid}, issue), @@ -98,7 +98,7 @@ func (s *IssueLinksService) ListIssueRelations(pid any, issue int, options ...Re // // GitLab API docs: // https://docs.gitlab.com/api/issue_links/#get-an-issue-link -func (s *IssueLinksService) GetIssueLink(pid any, issue, issueLink int, options ...RequestOptionFunc) (*IssueLink, *Response, error) { +func (s *IssueLinksService) GetIssueLink(pid any, issue, issueLink int64, options ...RequestOptionFunc) (*IssueLink, *Response, error) { // Use explicit format string for the path return do[*IssueLink](s.client, withPath("projects/%s/issues/%d/links/%d", ProjectID{pid}, issue, issueLink), @@ -120,7 +120,7 @@ type CreateIssueLinkOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/issue_links/#create-an-issue-link -func (s *IssueLinksService) CreateIssueLink(pid any, issue int, opt *CreateIssueLinkOptions, options ...RequestOptionFunc) (*IssueLink, *Response, error) { +func (s *IssueLinksService) CreateIssueLink(pid any, issue int64, opt *CreateIssueLinkOptions, options ...RequestOptionFunc) (*IssueLink, *Response, error) { return do[*IssueLink](s.client, withMethod(http.MethodPost), withPath("projects/%s/issues/%d/links", ProjectID{pid}, issue), @@ -133,7 +133,7 @@ func (s *IssueLinksService) CreateIssueLink(pid any, issue int, opt *CreateIssue // // GitLab API docs: // https://docs.gitlab.com/api/issue_links/#delete-an-issue-link -func (s *IssueLinksService) DeleteIssueLink(pid any, issue, issueLink int, options ...RequestOptionFunc) (*IssueLink, *Response, error) { +func (s *IssueLinksService) DeleteIssueLink(pid any, issue, issueLink int64, options ...RequestOptionFunc) (*IssueLink, *Response, error) { return do[*IssueLink](s.client, withMethod(http.MethodDelete), withPath("projects/%s/issues/%d/links/%d", ProjectID{pid}, issue, issueLink), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/issues.go b/vendor/gitlab.com/gitlab-org/api/client-go/issues.go index 8a9fc25e4..63b3f01f1 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/issues.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/issues.go @@ -29,24 +29,24 @@ type ( ListIssues(opt *ListIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) ListGroupIssues(pid any, opt *ListGroupIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) ListProjectIssues(pid any, opt *ListProjectIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) - GetIssueByID(issue int, options ...RequestOptionFunc) (*Issue, *Response, error) - GetIssue(pid any, issue int, options ...RequestOptionFunc) (*Issue, *Response, error) + GetIssueByID(issue int64, options ...RequestOptionFunc) (*Issue, *Response, error) + GetIssue(pid any, issue int64, options ...RequestOptionFunc) (*Issue, *Response, error) CreateIssue(pid any, opt *CreateIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) - UpdateIssue(pid any, issue int, opt *UpdateIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) - DeleteIssue(pid any, issue int, options ...RequestOptionFunc) (*Response, error) - ReorderIssue(pid any, issue int, opt *ReorderIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) - MoveIssue(pid any, issue int, opt *MoveIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) - SubscribeToIssue(pid any, issue int, options ...RequestOptionFunc) (*Issue, *Response, error) - UnsubscribeFromIssue(pid any, issue int, options ...RequestOptionFunc) (*Issue, *Response, error) - CreateTodo(pid any, issue int, options ...RequestOptionFunc) (*Todo, *Response, error) - ListMergeRequestsClosingIssue(pid any, issue int, opt *ListMergeRequestsClosingIssueOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) - ListMergeRequestsRelatedToIssue(pid any, issue int, opt *ListMergeRequestsRelatedToIssueOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) - SetTimeEstimate(pid any, issue int, opt *SetTimeEstimateOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) - ResetTimeEstimate(pid any, issue int, options ...RequestOptionFunc) (*TimeStats, *Response, error) - AddSpentTime(pid any, issue int, opt *AddSpentTimeOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) - ResetSpentTime(pid any, issue int, options ...RequestOptionFunc) (*TimeStats, *Response, error) - GetTimeSpent(pid any, issue int, options ...RequestOptionFunc) (*TimeStats, *Response, error) - GetParticipants(pid any, issue int, options ...RequestOptionFunc) ([]*BasicUser, *Response, error) + UpdateIssue(pid any, issue int64, opt *UpdateIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) + DeleteIssue(pid any, issue int64, options ...RequestOptionFunc) (*Response, error) + ReorderIssue(pid any, issue int64, opt *ReorderIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) + MoveIssue(pid any, issue int64, opt *MoveIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) + SubscribeToIssue(pid any, issue int64, options ...RequestOptionFunc) (*Issue, *Response, error) + UnsubscribeFromIssue(pid any, issue int64, options ...RequestOptionFunc) (*Issue, *Response, error) + CreateTodo(pid any, issue int64, options ...RequestOptionFunc) (*Todo, *Response, error) + ListMergeRequestsClosingIssue(pid any, issue int64, opt *ListMergeRequestsClosingIssueOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) + ListMergeRequestsRelatedToIssue(pid any, issue int64, opt *ListMergeRequestsRelatedToIssueOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) + SetTimeEstimate(pid any, issue int64, opt *SetTimeEstimateOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) + ResetTimeEstimate(pid any, issue int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) + AddSpentTime(pid any, issue int64, opt *AddSpentTimeOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) + ResetSpentTime(pid any, issue int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) + GetTimeSpent(pid any, issue int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) + GetParticipants(pid any, issue int64, options ...RequestOptionFunc) ([]*BasicUser, *Response, error) } // IssuesService handles communication with the issue related methods @@ -63,7 +63,7 @@ var _ IssuesServiceInterface = (*IssuesService)(nil) // IssueAuthor represents a author of the issue. type IssueAuthor struct { - ID int `json:"id"` + ID int64 `json:"id"` State string `json:"state"` WebURL string `json:"web_url"` Name string `json:"name"` @@ -73,7 +73,7 @@ type IssueAuthor struct { // IssueAssignee represents a assignee of the issue. type IssueAssignee struct { - ID int `json:"id"` + ID int64 `json:"id"` State string `json:"state"` WebURL string `json:"web_url"` Name string `json:"name"` @@ -90,7 +90,7 @@ type IssueReferences struct { // IssueCloser represents a closer of the issue. type IssueCloser struct { - ID int `json:"id"` + ID int64 `json:"id"` State string `json:"state"` WebURL string `json:"web_url"` Name string `json:"name"` @@ -110,40 +110,40 @@ type IssueLinks struct { // // GitLab API docs: https://docs.gitlab.com/api/issues/ type Issue struct { - ID int `json:"id"` - IID int `json:"iid"` + ID int64 `json:"id"` + IID int64 `json:"iid"` ExternalID string `json:"external_id"` State string `json:"state"` Description string `json:"description"` HealthStatus string `json:"health_status"` Author *IssueAuthor `json:"author"` Milestone *Milestone `json:"milestone"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Assignees []*IssueAssignee `json:"assignees"` UpdatedAt *time.Time `json:"updated_at"` ClosedAt *time.Time `json:"closed_at"` ClosedBy *IssueCloser `json:"closed_by"` Title string `json:"title"` CreatedAt *time.Time `json:"created_at"` - MovedToID int `json:"moved_to_id"` + MovedToID int64 `json:"moved_to_id"` Labels Labels `json:"labels"` LabelDetails []*LabelDetails `json:"label_details"` - Upvotes int `json:"upvotes"` - Downvotes int `json:"downvotes"` + Upvotes int64 `json:"upvotes"` + Downvotes int64 `json:"downvotes"` DueDate *ISOTime `json:"due_date"` WebURL string `json:"web_url"` References *IssueReferences `json:"references"` TimeStats *TimeStats `json:"time_stats"` Confidential bool `json:"confidential"` - Weight int `json:"weight"` + Weight int64 `json:"weight"` DiscussionLocked bool `json:"discussion_locked"` IssueType *string `json:"issue_type,omitempty"` Subscribed bool `json:"subscribed"` - UserNotesCount int `json:"user_notes_count"` + UserNotesCount int64 `json:"user_notes_count"` Links *IssueLinks `json:"_links"` - IssueLinkID int `json:"issue_link_id"` - MergeRequestCount int `json:"merge_requests_count"` - EpicIssueID int `json:"epic_issue_id"` + IssueLinkID int64 `json:"issue_link_id"` + MergeRequestCount int64 `json:"merge_requests_count"` + EpicIssueID int64 `json:"epic_issue_id"` Epic *Epic `json:"epic"` Iteration *GroupIteration `json:"iteration"` TaskCompletionStatus *TasksCompletionStatus `json:"task_completion_status"` @@ -197,7 +197,7 @@ func (i *Issue) UnmarshalJSON(data []byte) error { // LabelDetails represents detailed label information. type LabelDetails struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Color string `json:"color"` Description string `json:"description"` @@ -217,17 +217,17 @@ type ListIssuesOptions struct { Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` NotMilestone *string `url:"not[milestone],omitempty" json:"not[milestone],omitempty"` Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` NotAuthorUsername *string `url:"not[author_username],omitempty" json:"not[author_username],omitempty"` - NotAuthorID *[]int `url:"not[author_id],omitempty" json:"not[author_id],omitempty"` + NotAuthorID *[]int64 `url:"not[author_id],omitempty" json:"not[author_id],omitempty"` AssigneeID *AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - NotAssigneeID *[]int `url:"not[assignee_id],omitempty" json:"not[assignee_id],omitempty"` + NotAssigneeID *[]int64 `url:"not[assignee_id],omitempty" json:"not[assignee_id],omitempty"` AssigneeUsername *string `url:"assignee_username,omitempty" json:"assignee_username,omitempty"` NotAssigneeUsername *string `url:"not[assignee_username],omitempty" json:"not[assignee_username],omitempty"` MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` NotMyReactionEmoji *[]string `url:"not[my_reaction_emoji],omitempty" json:"not[my_reaction_emoji],omitempty"` - IIDs *[]int `url:"iids[],omitempty" json:"iids,omitempty"` + IIDs *[]int64 `url:"iids[],omitempty" json:"iids,omitempty"` In *string `url:"in,omitempty" json:"in,omitempty"` NotIn *string `url:"not[in],omitempty" json:"not[in],omitempty"` OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"` @@ -241,7 +241,7 @@ type ListIssuesOptions struct { UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"` IssueType *string `url:"issue_type,omitempty" json:"issue_type,omitempty"` - IterationID *int `url:"iteration_id,omitempty" json:"iteration_id,omitempty"` + IterationID *int64 `url:"iteration_id,omitempty" json:"iteration_id,omitempty"` } // ListIssues gets all issues created by authenticated user. This function @@ -265,20 +265,20 @@ type ListGroupIssuesOptions struct { Labels *LabelOptions `url:"labels,comma,omitempty" json:"labels,omitempty"` NotLabels *LabelOptions `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"` WithLabelDetails *bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"` - IIDs *[]int `url:"iids[],omitempty" json:"iids,omitempty"` + IIDs *[]int64 `url:"iids[],omitempty" json:"iids,omitempty"` Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` NotMilestone *string `url:"not[milestone],omitempty" json:"not[milestone],omitempty"` Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` - NotAuthorID *int `url:"not[author_id],omitempty" json:"not[author_id],omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` + NotAuthorID *int64 `url:"not[author_id],omitempty" json:"not[author_id],omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` NotAuthorUsername *string `url:"not[author_username],omitempty" json:"not[author_username],omitempty"` - // AssigneeID is defined as an int in the documentation, however, the field + // AssigneeID is defined as an int64 in the documentation, however, the field // must be able to accept Assignee IDs and the words 'None' and 'Any'. Use - // *AssigneeIDValue instead of *int. + // *AssigneeIDValue instead of *int64. AssigneeID *AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - NotAssigneeID *int `url:"not[assignee_id],omitempty" json:"not[assignee_id],omitempty"` + NotAssigneeID *int64 `url:"not[assignee_id],omitempty" json:"not[assignee_id],omitempty"` AssigneeUsername *string `url:"assignee_username,omitempty" json:"assignee_username,omitempty"` NotAssigneeUsername *string `url:"not[assignee_username],omitempty" json:"not[assignee_username],omitempty"` MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` @@ -296,7 +296,7 @@ type ListGroupIssuesOptions struct { UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"` IssueType *string `url:"issue_type,omitempty" json:"issue_type,omitempty"` - IterationID *int `url:"iteration_id,omitempty" json:"iteration_id,omitempty"` + IterationID *int64 `url:"iteration_id,omitempty" json:"iteration_id,omitempty"` } // ListGroupIssues gets a list of group issues. This function accepts @@ -316,37 +316,41 @@ func (s *IssuesService) ListGroupIssues(pid any, opt *ListGroupIssuesOptions, op // GitLab API docs: https://docs.gitlab.com/api/issues/#list-project-issues type ListProjectIssuesOptions struct { ListOptions - IIDs *[]int `url:"iids[],omitempty" json:"iids,omitempty"` - State *string `url:"state,omitempty" json:"state,omitempty"` - Labels *LabelOptions `url:"labels,comma,omitempty" json:"labels,omitempty"` - NotLabels *LabelOptions `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"` - WithLabelDetails *bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"` - Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` - NotMilestone *string `url:"not[milestone],omitempty" json:"not[milestone],omitempty"` - Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` - AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` - NotAuthorUsername *string `url:"not[author_username],omitempty" json:"not[author_username],omitempty"` - NotAuthorID *int `url:"not[author_id],omitempty" json:"not[author_id],omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - NotAssigneeID *int `url:"not[assignee_id],omitempty" json:"not[assignee_id],omitempty"` - AssigneeUsername *string `url:"assignee_username,omitempty" json:"assignee_username,omitempty"` - NotAssigneeUsername *string `url:"not[assignee_username],omitempty" json:"not[assignee_username],omitempty"` - MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` - NotMyReactionEmoji *string `url:"not[my_reaction_emoji],omitempty" json:"not[my_reaction_emoji],omitempty"` - OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"` - Sort *string `url:"sort,omitempty" json:"sort,omitempty"` - Search *string `url:"search,omitempty" json:"search,omitempty"` - In *string `url:"in,omitempty" json:"in,omitempty"` - NotIn *string `url:"not[in],omitempty" json:"not[in],omitempty"` - CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"` - CreatedBefore *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"` - DueDate *string `url:"due_date,omitempty" json:"due_date,omitempty"` - UpdatedAfter *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"` - UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` - Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"` - IssueType *string `url:"issue_type,omitempty" json:"issue_type,omitempty"` - IterationID *int `url:"iteration_id,omitempty" json:"iteration_id,omitempty"` + IIDs *[]int64 `url:"iids[],omitempty" json:"iids,omitempty"` + State *string `url:"state,omitempty" json:"state,omitempty"` + Labels *LabelOptions `url:"labels,comma,omitempty" json:"labels,omitempty"` + NotLabels *LabelOptions `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"` + WithLabelDetails *bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"` + Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` + NotMilestone *string `url:"not[milestone],omitempty" json:"not[milestone],omitempty"` + Scope *string `url:"scope,omitempty" json:"scope,omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` + AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` + NotAuthorUsername *string `url:"not[author_username],omitempty" json:"not[author_username],omitempty"` + NotAuthorID *int64 `url:"not[author_id],omitempty" json:"not[author_id],omitempty"` + + // AssigneeID is defined as an int in the documentation, however, the field + // must be able to accept Assignee IDs and the words 'None' and 'Any'. Use + // *AssigneeIDValue instead of *int. + AssigneeID *AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + NotAssigneeID *int64 `url:"not[assignee_id],omitempty" json:"not[assignee_id],omitempty"` + AssigneeUsername *string `url:"assignee_username,omitempty" json:"assignee_username,omitempty"` + NotAssigneeUsername *string `url:"not[assignee_username],omitempty" json:"not[assignee_username],omitempty"` + MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` + NotMyReactionEmoji *string `url:"not[my_reaction_emoji],omitempty" json:"not[my_reaction_emoji],omitempty"` + OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"` + Sort *string `url:"sort,omitempty" json:"sort,omitempty"` + Search *string `url:"search,omitempty" json:"search,omitempty"` + In *string `url:"in,omitempty" json:"in,omitempty"` + NotIn *string `url:"not[in],omitempty" json:"not[in],omitempty"` + CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"` + CreatedBefore *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"` + DueDate *string `url:"due_date,omitempty" json:"due_date,omitempty"` + UpdatedAfter *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"` + UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` + Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"` + IssueType *string `url:"issue_type,omitempty" json:"issue_type,omitempty"` + IterationID *int64 `url:"iteration_id,omitempty" json:"iteration_id,omitempty"` } // ListProjectIssues gets a list of project issues. This function accepts @@ -364,7 +368,7 @@ func (s *IssuesService) ListProjectIssues(pid any, opt *ListProjectIssuesOptions // GetIssueByID gets a single issue. // // GitLab API docs: https://docs.gitlab.com/api/issues/#single-issue -func (s *IssuesService) GetIssueByID(issue int, options ...RequestOptionFunc) (*Issue, *Response, error) { +func (s *IssuesService) GetIssueByID(issue int64, options ...RequestOptionFunc) (*Issue, *Response, error) { return do[*Issue](s.client, withPath("issues/%d", issue), withRequestOpts(options...), @@ -374,7 +378,7 @@ func (s *IssuesService) GetIssueByID(issue int, options ...RequestOptionFunc) (* // GetIssue gets a single project issue. // // GitLab API docs: https://docs.gitlab.com/api/issues/#single-project-issue -func (s *IssuesService) GetIssue(pid any, issue int, options ...RequestOptionFunc) (*Issue, *Response, error) { +func (s *IssuesService) GetIssue(pid any, issue int64, options ...RequestOptionFunc) (*Issue, *Response, error) { return do[*Issue](s.client, withPath("projects/%s/issues/%d", ProjectID{pid}, issue), withRequestOpts(options...), @@ -385,19 +389,19 @@ func (s *IssuesService) GetIssue(pid any, issue int, options ...RequestOptionFun // // GitLab API docs: https://docs.gitlab.com/api/issues/#new-issue type CreateIssueOptions struct { - IID *int `url:"iid,omitempty" json:"iid,omitempty"` + IID *int64 `url:"iid,omitempty" json:"iid,omitempty"` Title *string `url:"title,omitempty" json:"title,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"` Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"` - AssigneeIDs *[]int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"` - MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` + AssigneeIDs *[]int64 `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"` + MilestoneID *int64 `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` Labels *LabelOptions `url:"labels,comma,omitempty" json:"labels,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` DueDate *ISOTime `url:"due_date,omitempty" json:"due_date,omitempty"` - EpicID *int `url:"epic_id,omitempty" json:"epic_id,omitempty"` - MergeRequestToResolveDiscussionsOf *int `url:"merge_request_to_resolve_discussions_of,omitempty" json:"merge_request_to_resolve_discussions_of,omitempty"` + EpicID *int64 `url:"epic_id,omitempty" json:"epic_id,omitempty"` + MergeRequestToResolveDiscussionsOf *int64 `url:"merge_request_to_resolve_discussions_of,omitempty" json:"merge_request_to_resolve_discussions_of,omitempty"` DiscussionToResolve *string `url:"discussion_to_resolve,omitempty" json:"discussion_to_resolve,omitempty"` - Weight *int `url:"weight,omitempty" json:"weight,omitempty"` + Weight *int64 `url:"weight,omitempty" json:"weight,omitempty"` IssueType *string `url:"issue_type,omitempty" json:"issue_type,omitempty"` } @@ -423,16 +427,16 @@ type UpdateIssueOptions struct { Title *string `url:"title,omitempty" json:"title,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"` Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"` - AssigneeIDs *[]int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"` - MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` + AssigneeIDs *[]int64 `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"` + MilestoneID *int64 `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` Labels *LabelOptions `url:"labels,comma,omitempty" json:"labels,omitempty"` AddLabels *LabelOptions `url:"add_labels,comma,omitempty" json:"add_labels,omitempty"` RemoveLabels *LabelOptions `url:"remove_labels,comma,omitempty" json:"remove_labels,omitempty"` StateEvent *string `url:"state_event,omitempty" json:"state_event,omitempty"` UpdatedAt *time.Time `url:"updated_at,omitempty" json:"updated_at,omitempty"` DueDate *ISOTime `url:"due_date,omitempty" json:"due_date,omitempty"` - EpicID *int `url:"epic_id,omitempty" json:"epic_id,omitempty"` - Weight *int `url:"weight,omitempty" json:"weight,omitempty"` + EpicID *int64 `url:"epic_id,omitempty" json:"epic_id,omitempty"` + Weight *int64 `url:"weight,omitempty" json:"weight,omitempty"` DiscussionLocked *bool `url:"discussion_locked,omitempty" json:"discussion_locked,omitempty"` IssueType *string `url:"issue_type,omitempty" json:"issue_type,omitempty"` @@ -498,7 +502,7 @@ func (o UpdateIssueOptions) MarshalJSON() ([]byte, error) { // to mark an issue as closed. // // GitLab API docs: https://docs.gitlab.com/api/issues/#edit-an-issue -func (s *IssuesService) UpdateIssue(pid any, issue int, opt *UpdateIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) { +func (s *IssuesService) UpdateIssue(pid any, issue int64, opt *UpdateIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) { return do[*Issue](s.client, withMethod(http.MethodPut), withPath("projects/%s/issues/%d", ProjectID{pid}, issue), @@ -510,7 +514,7 @@ func (s *IssuesService) UpdateIssue(pid any, issue int, opt *UpdateIssueOptions, // DeleteIssue deletes a single project issue. // // GitLab API docs: https://docs.gitlab.com/api/issues/#delete-an-issue -func (s *IssuesService) DeleteIssue(pid any, issue int, options ...RequestOptionFunc) (*Response, error) { +func (s *IssuesService) DeleteIssue(pid any, issue int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/issues/%d", ProjectID{pid}, issue), @@ -523,14 +527,14 @@ func (s *IssuesService) DeleteIssue(pid any, issue int, options ...RequestOption // // GitLab API docs: https://docs.gitlab.com/api/issues/#reorder-an-issue type ReorderIssueOptions struct { - MoveAfterID *int `url:"move_after_id,omitempty" json:"move_after_id,omitempty"` - MoveBeforeID *int `url:"move_before_id,omitempty" json:"move_before_id,omitempty"` + MoveAfterID *int64 `url:"move_after_id,omitempty" json:"move_after_id,omitempty"` + MoveBeforeID *int64 `url:"move_before_id,omitempty" json:"move_before_id,omitempty"` } // ReorderIssue reorders an issue. // // GitLab API docs: https://docs.gitlab.com/api/issues/#reorder-an-issue -func (s *IssuesService) ReorderIssue(pid any, issue int, opt *ReorderIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) { +func (s *IssuesService) ReorderIssue(pid any, issue int64, opt *ReorderIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) { return do[*Issue](s.client, withMethod(http.MethodPut), withPath("projects/%s/issues/%d/reorder", ProjectID{pid}, issue), @@ -543,14 +547,14 @@ func (s *IssuesService) ReorderIssue(pid any, issue int, opt *ReorderIssueOption // // GitLab API docs: https://docs.gitlab.com/api/issues/#move-an-issue type MoveIssueOptions struct { - ToProjectID *int `url:"to_project_id,omitempty" json:"to_project_id,omitempty"` + ToProjectID *int64 `url:"to_project_id,omitempty" json:"to_project_id,omitempty"` } // MoveIssue updates an existing project issue. This function is also used // to mark an issue as closed. // // GitLab API docs: https://docs.gitlab.com/api/issues/#move-an-issue -func (s *IssuesService) MoveIssue(pid any, issue int, opt *MoveIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) { +func (s *IssuesService) MoveIssue(pid any, issue int64, opt *MoveIssueOptions, options ...RequestOptionFunc) (*Issue, *Response, error) { return do[*Issue](s.client, withMethod(http.MethodPost), withPath("projects/%s/issues/%d/move", ProjectID{pid}, issue), @@ -565,7 +569,7 @@ func (s *IssuesService) MoveIssue(pid any, issue int, opt *MoveIssueOptions, opt // // GitLab API docs: // https://docs.gitlab.com/api/issues/#subscribe-to-an-issue -func (s *IssuesService) SubscribeToIssue(pid any, issue int, options ...RequestOptionFunc) (*Issue, *Response, error) { +func (s *IssuesService) SubscribeToIssue(pid any, issue int64, options ...RequestOptionFunc) (*Issue, *Response, error) { return do[*Issue](s.client, withMethod(http.MethodPost), withPath("projects/%s/issues/%d/subscribe", ProjectID{pid}, issue), @@ -579,7 +583,7 @@ func (s *IssuesService) SubscribeToIssue(pid any, issue int, options ...RequestO // // GitLab API docs: // https://docs.gitlab.com/api/issues/#unsubscribe-from-an-issue -func (s *IssuesService) UnsubscribeFromIssue(pid any, issue int, options ...RequestOptionFunc) (*Issue, *Response, error) { +func (s *IssuesService) UnsubscribeFromIssue(pid any, issue int64, options ...RequestOptionFunc) (*Issue, *Response, error) { return do[*Issue](s.client, withMethod(http.MethodPost), withPath("projects/%s/issues/%d/unsubscribe", ProjectID{pid}, issue), @@ -593,7 +597,7 @@ func (s *IssuesService) UnsubscribeFromIssue(pid any, issue int, options ...Requ // // GitLab API docs: // https://docs.gitlab.com/api/issues/#create-a-to-do-item -func (s *IssuesService) CreateTodo(pid any, issue int, options ...RequestOptionFunc) (*Todo, *Response, error) { +func (s *IssuesService) CreateTodo(pid any, issue int64, options ...RequestOptionFunc) (*Todo, *Response, error) { return do[*Todo](s.client, withMethod(http.MethodPost), withPath("projects/%s/issues/%d/todo", ProjectID{pid}, issue), @@ -606,14 +610,16 @@ func (s *IssuesService) CreateTodo(pid any, issue int, options ...RequestOptionF // // GitLab API docs: // https://docs.gitlab.com/api/issues/#list-merge-requests-that-close-a-particular-issue-on-merge -type ListMergeRequestsClosingIssueOptions ListOptions +type ListMergeRequestsClosingIssueOptions struct { + ListOptions +} // ListMergeRequestsClosingIssue gets all the merge requests that will close // issue when merged. // // GitLab API docs: // https://docs.gitlab.com/api/issues/#list-merge-requests-that-close-a-particular-issue-on-merge -func (s *IssuesService) ListMergeRequestsClosingIssue(pid any, issue int, opt *ListMergeRequestsClosingIssueOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { +func (s *IssuesService) ListMergeRequestsClosingIssue(pid any, issue int64, opt *ListMergeRequestsClosingIssueOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { return do[[]*BasicMergeRequest](s.client, withPath("projects/%s/issues/%d/closed_by", ProjectID{pid}, issue), withAPIOpts(opt), @@ -626,14 +632,16 @@ func (s *IssuesService) ListMergeRequestsClosingIssue(pid any, issue int, opt *L // // GitLab API docs: // https://docs.gitlab.com/api/issues/#list-merge-requests-related-to-issue -type ListMergeRequestsRelatedToIssueOptions ListOptions +type ListMergeRequestsRelatedToIssueOptions struct { + ListOptions +} // ListMergeRequestsRelatedToIssue gets all the merge requests that are // related to the issue // // GitLab API docs: // https://docs.gitlab.com/api/issues/#list-merge-requests-related-to-issue -func (s *IssuesService) ListMergeRequestsRelatedToIssue(pid any, issue int, opt *ListMergeRequestsRelatedToIssueOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { +func (s *IssuesService) ListMergeRequestsRelatedToIssue(pid any, issue int64, opt *ListMergeRequestsRelatedToIssueOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { return do[[]*BasicMergeRequest](s.client, withPath("projects/%s/issues/%d/related_merge_requests", ProjectID{pid}, issue), withAPIOpts(opt), @@ -645,7 +653,7 @@ func (s *IssuesService) ListMergeRequestsRelatedToIssue(pid any, issue int, opt // // GitLab API docs: // https://docs.gitlab.com/api/issues/#set-a-time-estimate-for-an-issue -func (s *IssuesService) SetTimeEstimate(pid any, issue int, opt *SetTimeEstimateOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *IssuesService) SetTimeEstimate(pid any, issue int64, opt *SetTimeEstimateOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { return s.timeStats.setTimeEstimate(pid, "issues", issue, opt, options...) } @@ -653,7 +661,7 @@ func (s *IssuesService) SetTimeEstimate(pid any, issue int, opt *SetTimeEstimate // // GitLab API docs: // https://docs.gitlab.com/api/issues/#reset-the-time-estimate-for-an-issue -func (s *IssuesService) ResetTimeEstimate(pid any, issue int, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *IssuesService) ResetTimeEstimate(pid any, issue int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) { return s.timeStats.resetTimeEstimate(pid, "issues", issue, options...) } @@ -661,7 +669,7 @@ func (s *IssuesService) ResetTimeEstimate(pid any, issue int, options ...Request // // GitLab API docs: // https://docs.gitlab.com/api/issues/#add-spent-time-for-an-issue -func (s *IssuesService) AddSpentTime(pid any, issue int, opt *AddSpentTimeOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *IssuesService) AddSpentTime(pid any, issue int64, opt *AddSpentTimeOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { return s.timeStats.addSpentTime(pid, "issues", issue, opt, options...) } @@ -669,7 +677,7 @@ func (s *IssuesService) AddSpentTime(pid any, issue int, opt *AddSpentTimeOption // // GitLab API docs: // https://docs.gitlab.com/api/issues/#reset-spent-time-for-an-issue -func (s *IssuesService) ResetSpentTime(pid any, issue int, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *IssuesService) ResetSpentTime(pid any, issue int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) { return s.timeStats.resetSpentTime(pid, "issues", issue, options...) } @@ -677,7 +685,7 @@ func (s *IssuesService) ResetSpentTime(pid any, issue int, options ...RequestOpt // // GitLab API docs: // https://docs.gitlab.com/api/issues/#get-time-tracking-stats -func (s *IssuesService) GetTimeSpent(pid any, issue int, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *IssuesService) GetTimeSpent(pid any, issue int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) { return s.timeStats.getTimeSpent(pid, "issues", issue, options...) } @@ -685,7 +693,7 @@ func (s *IssuesService) GetTimeSpent(pid any, issue int, options ...RequestOptio // // GitLab API docs: // https://docs.gitlab.com/api/issues/#list-participants-in-an-issue -func (s *IssuesService) GetParticipants(pid any, issue int, options ...RequestOptionFunc) ([]*BasicUser, *Response, error) { +func (s *IssuesService) GetParticipants(pid any, issue int64, options ...RequestOptionFunc) ([]*BasicUser, *Response, error) { return do[[]*BasicUser](s.client, withPath("projects/%s/issues/%d/participants", ProjectID{pid}, issue), withRequestOpts(options...), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/issues_statistics.go b/vendor/gitlab.com/gitlab-org/api/client-go/issues_statistics.go index 811324093..5a2df7b69 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/issues_statistics.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/issues_statistics.go @@ -42,19 +42,29 @@ var _ IssuesStatisticsServiceInterface = (*IssuesStatisticsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/issues_statistics/ type IssuesStatistics struct { - Statistics struct { - Counts struct { - All int `json:"all"` - Closed int `json:"closed"` - Opened int `json:"opened"` - } `json:"counts"` - } `json:"statistics"` + Statistics IssuesStatisticsStatistics `json:"statistics"` } func (n IssuesStatistics) String() string { return Stringify(n) } +// IssuesStatisticsStatistics represents a GitLab issues statistic statistics. +// +// GitLab API docs: https://docs.gitlab.com/api/issues_statistics/ +type IssuesStatisticsStatistics struct { + Counts IssuesStatisticsCounts `json:"counts"` +} + +// IssuesStatisticsCounts represents a GitLab issues statistic counts. +// +// GitLab API docs: https://docs.gitlab.com/api/issues_statistics/ +type IssuesStatisticsCounts struct { + All int64 `json:"all"` + Closed int64 `json:"closed"` + Opened int64 `json:"opened"` +} + // GetIssuesStatisticsOptions represents the available GetIssuesStatistics() options. // // GitLab API docs: @@ -63,12 +73,12 @@ type GetIssuesStatisticsOptions struct { Labels *LabelOptions `url:"labels,omitempty" json:"labels,omitempty"` Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + AssigneeID *int64 `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` AssigneeUsername *[]string `url:"assignee_username,omitempty" json:"assignee_username,omitempty"` MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` - IIDs *[]int `url:"iids[],omitempty" json:"iids,omitempty"` + IIDs *[]int64 `url:"iids[],omitempty" json:"iids,omitempty"` Search *string `url:"search,omitempty" json:"search,omitempty"` In *string `url:"in,omitempty" json:"in,omitempty"` CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"` @@ -98,12 +108,12 @@ func (s *IssuesStatisticsService) GetIssuesStatistics(opt *GetIssuesStatisticsOp // https://docs.gitlab.com/api/issues_statistics/#get-group-issues-statistics type GetGroupIssuesStatisticsOptions struct { Labels *LabelOptions `url:"labels,omitempty" json:"labels,omitempty"` - IIDs *[]int `url:"iids[],omitempty" json:"iids,omitempty"` + IIDs *[]int64 `url:"iids[],omitempty" json:"iids,omitempty"` Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + AssigneeID *int64 `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` AssigneeUsername *[]string `url:"assignee_username,omitempty" json:"assignee_username,omitempty"` MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` Search *string `url:"search,omitempty" json:"search,omitempty"` @@ -132,13 +142,13 @@ func (s *IssuesStatisticsService) GetGroupIssuesStatistics(gid any, opt *GetGrou // GitLab API docs: // https://docs.gitlab.com/api/issues_statistics/#get-project-issues-statistics type GetProjectIssuesStatisticsOptions struct { - IIDs *[]int `url:"iids[],omitempty" json:"iids,omitempty"` + IIDs *[]int64 `url:"iids[],omitempty" json:"iids,omitempty"` Labels *LabelOptions `url:"labels,omitempty" json:"labels,omitempty"` Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"` Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + AssigneeID *int64 `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` AssigneeUsername *[]string `url:"assignee_username,omitempty" json:"assignee_username,omitempty"` MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` Search *string `url:"search,omitempty" json:"search,omitempty"` diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/job_token_scope.go b/vendor/gitlab.com/gitlab-org/api/client-go/job_token_scope.go index 93239844d..e4ae37057 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/job_token_scope.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/job_token_scope.go @@ -25,10 +25,10 @@ type ( PatchProjectJobTokenAccessSettings(pid any, opt *PatchProjectJobTokenAccessSettingsOptions, options ...RequestOptionFunc) (*Response, error) GetProjectJobTokenInboundAllowList(pid any, opt *GetJobTokenInboundAllowListOptions, options ...RequestOptionFunc) ([]*Project, *Response, error) AddProjectToJobScopeAllowList(pid any, opt *JobTokenInboundAllowOptions, options ...RequestOptionFunc) (*JobTokenInboundAllowItem, *Response, error) - RemoveProjectFromJobScopeAllowList(pid any, targetProject int, options ...RequestOptionFunc) (*Response, error) + RemoveProjectFromJobScopeAllowList(pid any, targetProject int64, options ...RequestOptionFunc) (*Response, error) GetJobTokenAllowlistGroups(pid any, opt *GetJobTokenAllowlistGroupsOptions, options ...RequestOptionFunc) ([]*Group, *Response, error) AddGroupToJobTokenAllowlist(pid any, opt *AddGroupToJobTokenAllowlistOptions, options ...RequestOptionFunc) (*JobTokenAllowlistItem, *Response, error) - RemoveGroupFromJobTokenAllowlist(pid any, targetGroup int, options ...RequestOptionFunc) (*Response, error) + RemoveGroupFromJobTokenAllowlist(pid any, targetGroup int64, options ...RequestOptionFunc) (*Response, error) } // JobTokenScopeService handles communication with project CI settings @@ -106,8 +106,8 @@ func (j *JobTokenScopeService) PatchProjectJobTokenAccessSettings(pid any, opt * // // GitLab API docs: https://docs.gitlab.com/api/project_job_token_scopes/ type JobTokenInboundAllowItem struct { - SourceProjectID int `json:"source_project_id"` - TargetProjectID int `json:"target_project_id"` + SourceProjectID int64 `json:"source_project_id"` + TargetProjectID int64 `json:"target_project_id"` } // GetJobTokenInboundAllowListOptions represents the available @@ -151,7 +151,7 @@ func (j *JobTokenScopeService) GetProjectJobTokenInboundAllowList(pid any, opt * // GitLab API docs: // https://docs.gitlab.com/api/project_job_token_scopes/#add-a-project-to-a-cicd-job-token-inbound-allowlist type JobTokenInboundAllowOptions struct { - TargetProjectID *int `url:"target_project_id,omitempty" json:"target_project_id,omitempty"` + TargetProjectID *int64 `url:"target_project_id,omitempty" json:"target_project_id,omitempty"` } // AddProjectToJobScopeAllowList adds a new project to a project's job token @@ -185,7 +185,7 @@ func (j *JobTokenScopeService) AddProjectToJobScopeAllowList(pid any, opt *JobTo // // GitLab API docs: // https://docs.gitlab.com/api/project_job_token_scopes/#remove-a-project-from-a-cicd-job-token-inbound-allowlist -func (j *JobTokenScopeService) RemoveProjectFromJobScopeAllowList(pid any, targetProject int, options ...RequestOptionFunc) (*Response, error) { +func (j *JobTokenScopeService) RemoveProjectFromJobScopeAllowList(pid any, targetProject int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -204,8 +204,8 @@ func (j *JobTokenScopeService) RemoveProjectFromJobScopeAllowList(pid any, targe // // GitLab API docs: https://docs.gitlab.com/api/project_job_token_scopes/ type JobTokenAllowlistItem struct { - SourceProjectID int `json:"source_project_id"` - TargetGroupID int `json:"target_group_id"` + SourceProjectID int64 `json:"source_project_id"` + TargetGroupID int64 `json:"target_group_id"` } // GetJobTokenAllowlistGroupsOptions represents the available @@ -249,7 +249,7 @@ func (j *JobTokenScopeService) GetJobTokenAllowlistGroups(pid any, opt *GetJobTo // GitLab API docs: // https://docs.gitlab.com/api/project_job_token_scopes/#add-a-group-to-a-cicd-job-token-allowlist type AddGroupToJobTokenAllowlistOptions struct { - TargetGroupID *int `url:"target_group_id,omitempty" json:"target_group_id,omitempty"` + TargetGroupID *int64 `url:"target_group_id,omitempty" json:"target_group_id,omitempty"` } // AddGroupToJobTokenAllowlist adds a new group to a project's job token @@ -283,7 +283,7 @@ func (j *JobTokenScopeService) AddGroupToJobTokenAllowlist(pid any, opt *AddGrou // // GitLab API docs: // https://docs.gitlab.com/api/project_job_token_scopes/#remove-a-group-from-a-cicd-job-token-allowlist -func (j *JobTokenScopeService) RemoveGroupFromJobTokenAllowlist(pid any, targetGroup int, options ...RequestOptionFunc) (*Response, error) { +func (j *JobTokenScopeService) RemoveGroupFromJobTokenAllowlist(pid any, targetGroup int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/jobs.go b/vendor/gitlab.com/gitlab-org/api/client-go/jobs.go index 94aef9540..f7d5f0159 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/jobs.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/jobs.go @@ -18,7 +18,6 @@ package gitlab import ( "bytes" - "fmt" "net/http" "time" ) @@ -26,21 +25,21 @@ import ( type ( JobsServiceInterface interface { ListProjectJobs(pid any, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Job, *Response, error) - ListPipelineJobs(pid any, pipelineID int, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Job, *Response, error) - ListPipelineBridges(pid any, pipelineID int, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Bridge, *Response, error) + ListPipelineJobs(pid any, pipelineID int64, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Job, *Response, error) + ListPipelineBridges(pid any, pipelineID int64, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Bridge, *Response, error) GetJobTokensJob(opts *GetJobTokensJobOptions, options ...RequestOptionFunc) (*Job, *Response, error) - GetJob(pid any, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) - GetJobArtifacts(pid any, jobID int, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) + GetJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) + GetJobArtifacts(pid any, jobID int64, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) DownloadArtifactsFile(pid any, refName string, opt *DownloadArtifactsFileOptions, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) - DownloadSingleArtifactsFile(pid any, jobID int, artifactPath string, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) + DownloadSingleArtifactsFile(pid any, jobID int64, artifactPath string, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) DownloadSingleArtifactsFileByTagOrBranch(pid any, refName string, artifactPath string, opt *DownloadArtifactsFileOptions, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) - GetTraceFile(pid any, jobID int, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) - CancelJob(pid any, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) - RetryJob(pid any, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) - EraseJob(pid any, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) - KeepArtifacts(pid any, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) - PlayJob(pid any, jobID int, opt *PlayJobOptions, options ...RequestOptionFunc) (*Job, *Response, error) - DeleteArtifacts(pid any, jobID int, options ...RequestOptionFunc) (*Response, error) + GetTraceFile(pid any, jobID int64, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) + CancelJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) + RetryJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) + EraseJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) + KeepArtifacts(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) + PlayJob(pid any, jobID int64, opt *PlayJobOptions, options ...RequestOptionFunc) (*Job, *Response, error) + DeleteArtifacts(pid any, jobID int64, options ...RequestOptionFunc) (*Response, error) DeleteProjectArtifacts(pid any, options ...RequestOptionFunc) (*Response, error) } @@ -59,51 +58,71 @@ var _ JobsServiceInterface = (*JobsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/jobs/ type Job struct { - Commit *Commit `json:"commit"` - Coverage float64 `json:"coverage"` - AllowFailure bool `json:"allow_failure"` - CreatedAt *time.Time `json:"created_at"` - StartedAt *time.Time `json:"started_at"` - FinishedAt *time.Time `json:"finished_at"` - ErasedAt *time.Time `json:"erased_at"` - Duration float64 `json:"duration"` - QueuedDuration float64 `json:"queued_duration"` - ArtifactsExpireAt *time.Time `json:"artifacts_expire_at"` - TagList []string `json:"tag_list"` - ID int `json:"id"` - Name string `json:"name"` - Pipeline struct { - ID int `json:"id"` - ProjectID int `json:"project_id"` - Ref string `json:"ref"` - Sha string `json:"sha"` - Status string `json:"status"` - } `json:"pipeline"` + Commit *Commit `json:"commit"` + Coverage float64 `json:"coverage"` + AllowFailure bool `json:"allow_failure"` + CreatedAt *time.Time `json:"created_at"` + StartedAt *time.Time `json:"started_at"` + FinishedAt *time.Time `json:"finished_at"` + ErasedAt *time.Time `json:"erased_at"` + Duration float64 `json:"duration"` + QueuedDuration float64 `json:"queued_duration"` + ArtifactsExpireAt *time.Time `json:"artifacts_expire_at"` + TagList []string `json:"tag_list"` + ID int64 `json:"id"` + Name string `json:"name"` + Pipeline JobPipeline `json:"pipeline"` + Ref string `json:"ref"` + Artifacts []JobArtifact `json:"artifacts"` + ArtifactsFile JobArtifactsFile `json:"artifacts_file"` + Runner JobRunner `json:"runner"` + Stage string `json:"stage"` + Status string `json:"status"` + FailureReason string `json:"failure_reason"` + Tag bool `json:"tag"` + WebURL string `json:"web_url"` + Project *Project `json:"project"` + User *User `json:"user"` +} + +// JobPipeline represents a ci build pipeline. +// +// GitLab API docs: https://docs.gitlab.com/api/jobs/ +type JobPipeline struct { + ID int64 `json:"id"` + ProjectID int64 `json:"project_id"` Ref string `json:"ref"` - Artifacts []struct { - FileType string `json:"file_type"` - Filename string `json:"filename"` - Size int `json:"size"` - FileFormat string `json:"file_format"` - } `json:"artifacts"` - ArtifactsFile struct { - Filename string `json:"filename"` - Size int `json:"size"` - } `json:"artifacts_file"` - Runner struct { - ID int `json:"id"` - Description string `json:"description"` - Active bool `json:"active"` - IsShared bool `json:"is_shared"` - Name string `json:"name"` - } `json:"runner"` - Stage string `json:"stage"` - Status string `json:"status"` - FailureReason string `json:"failure_reason"` - Tag bool `json:"tag"` - WebURL string `json:"web_url"` - Project *Project `json:"project"` - User *User `json:"user"` + Sha string `json:"sha"` + Status string `json:"status"` +} + +// JobArtifact represents a ci build artifact. +// +// GitLab API docs: https://docs.gitlab.com/api/jobs/ +type JobArtifact struct { + FileType string `json:"file_type"` + Filename string `json:"filename"` + Size int64 `json:"size"` + FileFormat string `json:"file_format"` +} + +// JobArtifactsFile represents a ci build artifacts file. +// +// GitLab API docs: https://docs.gitlab.com/api/jobs/ +type JobArtifactsFile struct { + Filename string `json:"filename"` + Size int64 `json:"size"` +} + +// JobRunner represents a ci build runner. +// +// GitLab API docs: https://docs.gitlab.com/api/jobs/ +type JobRunner struct { + ID int64 `json:"id"` + Description string `json:"description"` + Active bool `json:"active"` + IsShared bool `json:"is_shared"` + Name string `json:"name"` } // Bridge represents a pipeline bridge. @@ -119,7 +138,7 @@ type Bridge struct { ErasedAt *time.Time `json:"erased_at"` Duration float64 `json:"duration"` QueuedDuration float64 `json:"queued_duration"` - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Pipeline PipelineInfo `json:"pipeline"` Ref string `json:"ref"` @@ -150,24 +169,12 @@ type ListJobsOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/jobs/#list-project-jobs func (s *JobsService) ListProjectJobs(pid any, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Job, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/jobs", PathEscape(project)) - - req, err := s.client.NewRequest(http.MethodGet, u, opts, options) - if err != nil { - return nil, nil, err - } - - var jobs []*Job - resp, err := s.client.Do(req, &jobs) - if err != nil { - return nil, resp, err - } - - return jobs, resp, nil + return do[[]*Job](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/jobs", ProjectID{pid}), + withAPIOpts(opts), + withRequestOpts(options...), + ) } // ListPipelineJobs gets a list of jobs for specific pipeline in a @@ -175,25 +182,13 @@ func (s *JobsService) ListProjectJobs(pid any, opts *ListJobsOptions, options .. // // GitLab API docs: // https://docs.gitlab.com/api/jobs/#list-pipeline-jobs -func (s *JobsService) ListPipelineJobs(pid any, pipelineID int, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Job, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/pipelines/%d/jobs", PathEscape(project), pipelineID) - - req, err := s.client.NewRequest(http.MethodGet, u, opts, options) - if err != nil { - return nil, nil, err - } - - var jobs []*Job - resp, err := s.client.Do(req, &jobs) - if err != nil { - return nil, resp, err - } - - return jobs, resp, nil +func (s *JobsService) ListPipelineJobs(pid any, pipelineID int64, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Job, *Response, error) { + return do[[]*Job](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/pipelines/%d/jobs", ProjectID{pid}, pipelineID), + withAPIOpts(opts), + withRequestOpts(options...), + ) } // ListPipelineBridges gets a list of bridges for specific pipeline in a @@ -201,25 +196,13 @@ func (s *JobsService) ListPipelineJobs(pid any, pipelineID int, opts *ListJobsOp // // GitLab API docs: // https://docs.gitlab.com/api/jobs/#list-pipeline-trigger-jobs -func (s *JobsService) ListPipelineBridges(pid any, pipelineID int, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Bridge, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/pipelines/%d/bridges", PathEscape(project), pipelineID) - - req, err := s.client.NewRequest(http.MethodGet, u, opts, options) - if err != nil { - return nil, nil, err - } - - var bridges []*Bridge - resp, err := s.client.Do(req, &bridges) - if err != nil { - return nil, resp, err - } - - return bridges, resp, nil +func (s *JobsService) ListPipelineBridges(pid any, pipelineID int64, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Bridge, *Response, error) { + return do[[]*Bridge](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/pipelines/%d/bridges", ProjectID{pid}, pipelineID), + withAPIOpts(opts), + withRequestOpts(options...), + ) } // GetJobTokensJobOptions represents the available GetJobTokensJob() options. @@ -233,68 +216,38 @@ type GetJobTokensJobOptions struct { // // GitLab API docs: https://docs.gitlab.com/api/jobs/#get-job-tokens-job func (s *JobsService) GetJobTokensJob(opts *GetJobTokensJobOptions, options ...RequestOptionFunc) (*Job, *Response, error) { - req, err := s.client.NewRequest(http.MethodGet, "job", opts, options) - if err != nil { - return nil, nil, err - } - - job := new(Job) - resp, err := s.client.Do(req, job) - if err != nil { - return nil, resp, err - } - - return job, resp, nil + return do[*Job](s.client, + withMethod(http.MethodGet), + withPath("job"), + withAPIOpts(opts), + withRequestOpts(options...), + ) } // GetJob gets a single job of a project. // // GitLab API docs: // https://docs.gitlab.com/api/jobs/#get-a-single-job -func (s *JobsService) GetJob(pid any, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/jobs/%d", PathEscape(project), jobID) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - job := new(Job) - resp, err := s.client.Do(req, job) - if err != nil { - return nil, resp, err - } - - return job, resp, nil +func (s *JobsService) GetJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) { + return do[*Job](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/jobs/%d", ProjectID{pid}, jobID), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // GetJobArtifacts get jobs artifacts of a project // // GitLab API docs: // https://docs.gitlab.com/api/job_artifacts/#get-job-artifacts -func (s *JobsService) GetJobArtifacts(pid any, jobID int, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/jobs/%d/artifacts", PathEscape(project), jobID) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - artifactsBuf := new(bytes.Buffer) - resp, err := s.client.Do(req, artifactsBuf) - if err != nil { - return nil, resp, err - } +func (s *JobsService) GetJobArtifacts(pid any, jobID int64, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { + b, resp, err := do[bytes.Buffer](s.client, + withPath("projects/%s/jobs/%d/artifacts", ProjectID{pid}, jobID), + withRequestOpts(options...), + ) - return bytes.NewReader(artifactsBuf.Bytes()), resp, err + return bytes.NewReader(b.Bytes()), resp, err } // DownloadArtifactsFileOptions represents the available DownloadArtifactsFile() @@ -312,24 +265,13 @@ type DownloadArtifactsFileOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/job_artifacts/#download-the-artifacts-archive func (s *JobsService) DownloadArtifactsFile(pid any, refName string, opt *DownloadArtifactsFileOptions, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/jobs/artifacts/%s/download", PathEscape(project), refName) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - artifactsBuf := new(bytes.Buffer) - resp, err := s.client.Do(req, artifactsBuf) - if err != nil { - return nil, resp, err - } + b, resp, err := do[bytes.Buffer](s.client, + withPath("projects/%s/jobs/artifacts/%s/download", ProjectID{pid}, NoEscape{refName}), + withAPIOpts(opt), + withRequestOpts(options...), + ) - return bytes.NewReader(artifactsBuf.Bytes()), resp, err + return bytes.NewReader(b.Bytes()), resp, err } // DownloadSingleArtifactsFile download a file from the artifacts from the @@ -339,31 +281,13 @@ func (s *JobsService) DownloadArtifactsFile(pid any, refName string, opt *Downlo // // GitLab API docs: // https://docs.gitlab.com/api/job_artifacts/#download-a-single-artifact-file-by-job-id -func (s *JobsService) DownloadSingleArtifactsFile(pid any, jobID int, artifactPath string, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - - u := fmt.Sprintf( - "projects/%s/jobs/%d/artifacts/%s", - PathEscape(project), - jobID, - artifactPath, +func (s *JobsService) DownloadSingleArtifactsFile(pid any, jobID int64, artifactPath string, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { + b, resp, err := do[bytes.Buffer](s.client, + withPath("projects/%s/jobs/%d/artifacts/%s", ProjectID{pid}, jobID, NoEscape{artifactPath}), + withRequestOpts(options...), ) - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - artifactBuf := new(bytes.Buffer) - resp, err := s.client.Do(req, artifactBuf) - if err != nil { - return nil, resp, err - } - - return bytes.NewReader(artifactBuf.Bytes()), resp, err + return bytes.NewReader(b.Bytes()), resp, err } // DownloadSingleArtifactsFileByTagOrBranch downloads a single file from @@ -373,105 +297,52 @@ func (s *JobsService) DownloadSingleArtifactsFile(pid any, jobID int, artifactPa // GitLab API docs: // https://docs.gitlab.com/api/job_artifacts/#download-a-single-artifact-file-from-specific-tag-or-branch func (s *JobsService) DownloadSingleArtifactsFileByTagOrBranch(pid any, refName string, artifactPath string, opt *DownloadArtifactsFileOptions, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - - u := fmt.Sprintf( - "projects/%s/jobs/artifacts/%s/raw/%s", - PathEscape(project), - PathEscape(refName), - artifactPath, + b, resp, err := do[bytes.Buffer](s.client, + withPath("projects/%s/jobs/artifacts/%s/raw/%s", ProjectID{pid}, refName, NoEscape{artifactPath}), + withAPIOpts(opt), + withRequestOpts(options...), ) - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - artifactBuf := new(bytes.Buffer) - resp, err := s.client.Do(req, artifactBuf) - if err != nil { - return nil, resp, err - } - - return bytes.NewReader(artifactBuf.Bytes()), resp, err + return bytes.NewReader(b.Bytes()), resp, err } // GetTraceFile gets a trace of a specific job of a project // // GitLab API docs: // https://docs.gitlab.com/api/jobs/#get-a-log-file -func (s *JobsService) GetTraceFile(pid any, jobID int, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/jobs/%d/trace", PathEscape(project), jobID) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - traceBuf := new(bytes.Buffer) - resp, err := s.client.Do(req, traceBuf) - if err != nil { - return nil, resp, err - } +func (s *JobsService) GetTraceFile(pid any, jobID int64, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { + b, resp, err := do[bytes.Buffer](s.client, + withPath("projects/%s/jobs/%d/trace", ProjectID{pid}, jobID), + withRequestOpts(options...), + ) - return bytes.NewReader(traceBuf.Bytes()), resp, err + return bytes.NewReader(b.Bytes()), resp, err } // CancelJob cancels a single job of a project. // // GitLab API docs: // https://docs.gitlab.com/api/jobs/#cancel-a-job -func (s *JobsService) CancelJob(pid any, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/jobs/%d/cancel", PathEscape(project), jobID) - - req, err := s.client.NewRequest(http.MethodPost, u, nil, options) - if err != nil { - return nil, nil, err - } - - job := new(Job) - resp, err := s.client.Do(req, job) - if err != nil { - return nil, resp, err - } - - return job, resp, nil +func (s *JobsService) CancelJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) { + return do[*Job](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/jobs/%d/cancel", ProjectID{pid}, jobID), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // RetryJob retries a single job of a project // // GitLab API docs: // https://docs.gitlab.com/api/jobs/#retry-a-job -func (s *JobsService) RetryJob(pid any, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/jobs/%d/retry", PathEscape(project), jobID) - - req, err := s.client.NewRequest(http.MethodPost, u, nil, options) - if err != nil { - return nil, nil, err - } - - job := new(Job) - resp, err := s.client.Do(req, job) - if err != nil { - return nil, resp, err - } - - return job, resp, nil +func (s *JobsService) RetryJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) { + return do[*Job](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/jobs/%d/retry", ProjectID{pid}, jobID), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // EraseJob erases a single job of a project, removes a job @@ -479,25 +350,13 @@ func (s *JobsService) RetryJob(pid any, jobID int, options ...RequestOptionFunc) // // GitLab API docs: // https://docs.gitlab.com/api/jobs/#erase-a-job -func (s *JobsService) EraseJob(pid any, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/jobs/%d/erase", PathEscape(project), jobID) - - req, err := s.client.NewRequest(http.MethodPost, u, nil, options) - if err != nil { - return nil, nil, err - } - - job := new(Job) - resp, err := s.client.Do(req, job) - if err != nil { - return nil, resp, err - } - - return job, resp, nil +func (s *JobsService) EraseJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) { + return do[*Job](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/jobs/%d/erase", ProjectID{pid}, jobID), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // KeepArtifacts prevents artifacts from being deleted when @@ -505,25 +364,13 @@ func (s *JobsService) EraseJob(pid any, jobID int, options ...RequestOptionFunc) // // GitLab API docs: // https://docs.gitlab.com/api/job_artifacts/#keep-artifacts -func (s *JobsService) KeepArtifacts(pid any, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/jobs/%d/artifacts/keep", PathEscape(project), jobID) - - req, err := s.client.NewRequest(http.MethodPost, u, nil, options) - if err != nil { - return nil, nil, err - } - - job := new(Job) - resp, err := s.client.Do(req, job) - if err != nil { - return nil, resp, err - } - - return job, resp, nil +func (s *JobsService) KeepArtifacts(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) { + return do[*Job](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/jobs/%d/artifacts/keep", ProjectID{pid}, jobID), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // PlayJobOptions represents the available PlayJob() options. @@ -548,44 +395,27 @@ type JobVariableOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/jobs/#run-a-job -func (s *JobsService) PlayJob(pid any, jobID int, opt *PlayJobOptions, options ...RequestOptionFunc) (*Job, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/jobs/%d/play", PathEscape(project), jobID) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - job := new(Job) - resp, err := s.client.Do(req, job) - if err != nil { - return nil, resp, err - } - - return job, resp, nil +func (s *JobsService) PlayJob(pid any, jobID int64, opt *PlayJobOptions, options ...RequestOptionFunc) (*Job, *Response, error) { + return do[*Job](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/jobs/%d/play", ProjectID{pid}, jobID), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // DeleteArtifacts delete artifacts of a job // // GitLab API docs: // https://docs.gitlab.com/api/job_artifacts/#delete-job-artifacts -func (s *JobsService) DeleteArtifacts(pid any, jobID int, options ...RequestOptionFunc) (*Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("projects/%s/jobs/%d/artifacts", PathEscape(project), jobID) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *JobsService) DeleteArtifacts(pid any, jobID int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("projects/%s/jobs/%d/artifacts", ProjectID{pid}, jobID), + withAPIOpts(nil), + withRequestOpts(options...), + ) + return resp, err } // DeleteProjectArtifacts delete artifacts eligible for deletion in a project @@ -593,16 +423,11 @@ func (s *JobsService) DeleteArtifacts(pid any, jobID int, options ...RequestOpti // GitLab API docs: // https://docs.gitlab.com/api/job_artifacts/#delete-job-artifacts func (s *JobsService) DeleteProjectArtifacts(pid any, options ...RequestOptionFunc) (*Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("projects/%s/artifacts", PathEscape(project)) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("projects/%s/artifacts", ProjectID{pid}), + withAPIOpts(nil), + withRequestOpts(options...), + ) + return resp, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/keys.go b/vendor/gitlab.com/gitlab-org/api/client-go/keys.go index 3b2187c65..8d76a22ba 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/keys.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/keys.go @@ -24,7 +24,7 @@ import ( type ( KeysServiceInterface interface { - GetKeyWithUser(key int, options ...RequestOptionFunc) (*Key, *Response, error) + GetKeyWithUser(key int64, options ...RequestOptionFunc) (*Key, *Response, error) GetKeyByFingerprint(opt *GetKeyByFingerprintOptions, options ...RequestOptionFunc) (*Key, *Response, error) } @@ -45,7 +45,7 @@ var _ KeysServiceInterface = (*KeysService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/keys/ type Key struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` Key string `json:"key"` CreatedAt *time.Time `json:"created_at"` @@ -57,7 +57,7 @@ type Key struct { // // GitLab API docs: // https://docs.gitlab.com/api/keys/#get-ssh-key-with-user-by-id-of-an-ssh-key -func (s *KeysService) GetKeyWithUser(key int, options ...RequestOptionFunc) (*Key, *Response, error) { +func (s *KeysService) GetKeyWithUser(key int64, options ...RequestOptionFunc) (*Key, *Response, error) { u := fmt.Sprintf("keys/%d", key) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/labels.go b/vendor/gitlab.com/gitlab-org/api/client-go/labels.go index d7eb1e624..3a78a14e2 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/labels.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/labels.go @@ -49,16 +49,16 @@ var _ LabelsServiceInterface = (*LabelsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/labels/ type Label struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Color string `json:"color"` TextColor string `json:"text_color"` Description string `json:"description"` - OpenIssuesCount int `json:"open_issues_count"` - ClosedIssuesCount int `json:"closed_issues_count"` - OpenMergeRequestsCount int `json:"open_merge_requests_count"` + OpenIssuesCount int64 `json:"open_issues_count"` + ClosedIssuesCount int64 `json:"closed_issues_count"` + OpenMergeRequestsCount int64 `json:"open_merge_requests_count"` Subscribed bool `json:"subscribed"` - Priority int `json:"priority"` + Priority int64 `json:"priority"` IsProjectLabel bool `json:"is_project_label"` } @@ -155,7 +155,7 @@ type CreateLabelOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` Color *string `url:"color,omitempty" json:"color,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"` - Priority *int `url:"priority,omitempty" json:"priority,omitempty"` + Priority *int64 `url:"priority,omitempty" json:"priority,omitempty"` } // CreateLabel creates a new label for given repository with given name and @@ -224,7 +224,7 @@ type UpdateLabelOptions struct { NewName *string `url:"new_name,omitempty" json:"new_name,omitempty"` Color *string `url:"color,omitempty" json:"color,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"` - Priority *int `url:"priority,omitempty" json:"priority,omitempty"` + Priority *int64 `url:"priority,omitempty" json:"priority,omitempty"` } // UpdateLabel updates an existing label with new name or now color. At least diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/license.go b/vendor/gitlab.com/gitlab-org/api/client-go/license.go index 9e9d2a068..89418fb97 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/license.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/license.go @@ -26,7 +26,7 @@ type ( LicenseServiceInterface interface { GetLicense(options ...RequestOptionFunc) (*License, *Response, error) AddLicense(opt *AddLicenseOptions, options ...RequestOptionFunc) (*License, *Response, error) - DeleteLicense(licenseID int, options ...RequestOptionFunc) (*Response, error) + DeleteLicense(licenseID int64, options ...RequestOptionFunc) (*Response, error) } // LicenseService handles communication with the license @@ -46,37 +46,57 @@ var _ LicenseServiceInterface = (*LicenseService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/license/ type License struct { - ID int `json:"id"` - Plan string `json:"plan"` - CreatedAt *time.Time `json:"created_at"` - StartsAt *ISOTime `json:"starts_at"` - ExpiresAt *ISOTime `json:"expires_at"` - HistoricalMax int `json:"historical_max"` - MaximumUserCount int `json:"maximum_user_count"` - Expired bool `json:"expired"` - Overage int `json:"overage"` - UserLimit int `json:"user_limit"` - ActiveUsers int `json:"active_users"` - Licensee struct { - Name string `json:"Name"` - Company string `json:"Company"` - Email string `json:"Email"` - } `json:"licensee"` + ID int64 `json:"id"` + Plan string `json:"plan"` + CreatedAt *time.Time `json:"created_at"` + StartsAt *ISOTime `json:"starts_at"` + ExpiresAt *ISOTime `json:"expires_at"` + HistoricalMax int64 `json:"historical_max"` + MaximumUserCount int64 `json:"maximum_user_count"` + Expired bool `json:"expired"` + Overage int64 `json:"overage"` + UserLimit int64 `json:"user_limit"` + ActiveUsers int64 `json:"active_users"` + Licensee LicenseLicensee `json:"licensee"` // Add on codes that may occur in legacy licenses that don't have a plan yet. // https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/models/license.rb - AddOns struct { - GitLabAuditorUser int `json:"GitLab_Auditor_User"` - GitLabDeployBoard int `json:"GitLab_DeployBoard"` - GitLabFileLocks int `json:"GitLab_FileLocks"` - GitLabGeo int `json:"GitLab_Geo"` - GitLabServiceDesk int `json:"GitLab_ServiceDesk"` - } `json:"add_ons"` + AddOns LicenseAddOns `json:"add_ons"` } func (l License) String() string { return Stringify(l) } +// LicenseLicensee represents a GitLab license licensee. +// +// GitLab API docs: +// https://docs.gitlab.com/api/license/ +type LicenseLicensee struct { + Name string `json:"Name"` + Company string `json:"Company"` + Email string `json:"Email"` +} + +func (l LicenseLicensee) String() string { + return Stringify(l) +} + +// LicenseAddOns represents a GitLab license add ons. +// +// GitLab API docs: +// https://docs.gitlab.com/api/license/ +type LicenseAddOns struct { + GitLabAuditorUser int64 `json:"GitLab_Auditor_User"` + GitLabDeployBoard int64 `json:"GitLab_DeployBoard"` + GitLabFileLocks int64 `json:"GitLab_FileLocks"` + GitLabGeo int64 `json:"GitLab_Geo"` + GitLabServiceDesk int64 `json:"GitLab_ServiceDesk"` +} + +func (a LicenseAddOns) String() string { + return Stringify(a) +} + // GetLicense retrieves information about the current license. // // GitLab API docs: @@ -126,7 +146,7 @@ func (s *LicenseService) AddLicense(opt *AddLicenseOptions, options ...RequestOp // // GitLab API docs: // https://docs.gitlab.com/api/license/#delete-a-license -func (s *LicenseService) DeleteLicense(licenseID int, options ...RequestOptionFunc) (*Response, error) { +func (s *LicenseService) DeleteLicense(licenseID int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("license/%d", licenseID) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/markdown_uploads.go b/vendor/gitlab.com/gitlab-org/api/client-go/markdown_uploads.go index 13b662394..1f45039d2 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/markdown_uploads.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/markdown_uploads.go @@ -18,7 +18,6 @@ package gitlab import ( "bytes" - "fmt" "net/http" "time" ) @@ -29,8 +28,8 @@ import ( // https://docs.gitlab.com/api/project_markdown_uploads/ // https://docs.gitlab.com/api/group_markdown_uploads/ type MarkdownUpload struct { - ID int `json:"id"` - Size int `json:"size"` + ID int64 `json:"id"` + Size int64 `json:"size"` Filename string `json:"filename"` CreatedAt *time.Time `json:"created_at"` UploadedBy *User `json:"uploaded_by"` @@ -50,7 +49,7 @@ func (m MarkdownUpload) String() string { // GitLab API docs: // https://docs.gitlab.com/api/project_markdown_uploads/ type MarkdownUploadedFile struct { - ID int `json:"id"` + ID int64 `json:"id"` Alt string `json:"alt"` URL string `json:"url"` FullPath string `json:"full_path"` @@ -70,99 +69,55 @@ type ListMarkdownUploadsOptions struct { } // listMarkdownUploads gets all markdown uploads for a resource -func listMarkdownUploads[T any](client *Client, resourceType ResourceType, id any, opt *ListMarkdownUploadsOptions, options []RequestOptionFunc) ([]*T, *Response, error) { - resourceID, err := parseID(id) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("%s/%s/uploads", resourceType, PathEscape(resourceID)) - - req, err := client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var uploads []*T - resp, err := client.Do(req, &uploads) - if err != nil { - return nil, resp, err - } - - return uploads, resp, err +func listMarkdownUploads[T any](client *Client, resourceType ResourceType, id Pather, opt *ListMarkdownUploadsOptions, options []RequestOptionFunc) ([]*T, *Response, error) { + return do[[]*T](client, + withMethod(http.MethodGet), + withPath("%s/%s/uploads", resourceType, id), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // downloadMarkdownUploadByID downloads a specific upload by ID -func downloadMarkdownUploadByID(client *Client, resourceType ResourceType, id any, uploadID int, options []RequestOptionFunc) (*bytes.Buffer, *Response, error) { - resourceID, err := parseID(id) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("%s/%s/uploads/%d", resourceType, PathEscape(resourceID), uploadID) - - req, err := client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - var file bytes.Buffer - resp, err := client.Do(req, &file) - if err != nil { - return nil, resp, err - } +func downloadMarkdownUploadByID(client *Client, resourceType ResourceType, id Pather, uploadID int64, options []RequestOptionFunc) (*bytes.Buffer, *Response, error) { + file, resp, err := do[bytes.Buffer](client, + withMethod(http.MethodGet), + withPath("%s/%s/uploads/%d", resourceType, id, uploadID), + withRequestOpts(options...), + ) return &file, resp, err } // downloadMarkdownUploadBySecretAndFilename downloads a specific upload by secret and filename -func downloadMarkdownUploadBySecretAndFilename(client *Client, resourceType ResourceType, id any, secret string, filename string, options []RequestOptionFunc) (*bytes.Buffer, *Response, error) { - resourceID, err := parseID(id) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("%s/%s/uploads/%s/%s", resourceType, PathEscape(resourceID), PathEscape(secret), PathEscape(filename)) - - req, err := client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - var file bytes.Buffer - resp, err := client.Do(req, &file) - if err != nil { - return nil, resp, err - } +func downloadMarkdownUploadBySecretAndFilename(client *Client, resourceType ResourceType, id Pather, secret string, filename string, options []RequestOptionFunc) (*bytes.Buffer, *Response, error) { + file, resp, err := do[bytes.Buffer](client, + withMethod(http.MethodGet), + withPath("%s/%s/uploads/%s/%s", resourceType, id, secret, filename), + withRequestOpts(options...), + ) return &file, resp, err } // deleteMarkdownUploadByID deletes an upload by ID -func deleteMarkdownUploadByID(client *Client, resourceType ResourceType, id any, uploadID int, options []RequestOptionFunc) (*Response, error) { - resourceID, err := parseID(id) - if err != nil { - return nil, err - } - u := fmt.Sprintf("%s/%s/uploads/%d", resourceType, PathEscape(resourceID), uploadID) - - req, err := client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return client.Do(req, nil) +func deleteMarkdownUploadByID(client *Client, resourceType ResourceType, id Pather, uploadID int64, options []RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](client, + withMethod(http.MethodDelete), + withPath("%s/%s/uploads/%d", resourceType, id, uploadID), + withAPIOpts(nil), + withRequestOpts(options...), + ) + return resp, err } // deleteMarkdownUploadBySecretAndFilename deletes an upload by secret and filename -func deleteMarkdownUploadBySecretAndFilename(client *Client, resourceType ResourceType, id any, secret string, filename string, options []RequestOptionFunc) (*Response, error) { - resourceID, err := parseID(id) - if err != nil { - return nil, err - } - u := fmt.Sprintf("%s/%s/uploads/%s/%s", resourceType, PathEscape(resourceID), PathEscape(secret), PathEscape(filename)) - - req, err := client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return client.Do(req, nil) +func deleteMarkdownUploadBySecretAndFilename(client *Client, resourceType ResourceType, id Pather, secret string, filename string, options []RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](client, + withMethod(http.MethodDelete), + withPath("%s/%s/uploads/%s/%s", resourceType, id, secret, filename), + withAPIOpts(nil), + withRequestOpts(options...), + ) + return resp, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/member_roles.go b/vendor/gitlab.com/gitlab-org/api/client-go/member_roles.go index 1b1d7daab..094e3dab9 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/member_roles.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/member_roles.go @@ -1,7 +1,6 @@ package gitlab import ( - "fmt" "net/http" ) @@ -9,10 +8,10 @@ type ( MemberRolesServiceInterface interface { ListInstanceMemberRoles(options ...RequestOptionFunc) ([]*MemberRole, *Response, error) CreateInstanceMemberRole(opt *CreateMemberRoleOptions, options ...RequestOptionFunc) (*MemberRole, *Response, error) - DeleteInstanceMemberRole(memberRoleID int, options ...RequestOptionFunc) (*Response, error) + DeleteInstanceMemberRole(memberRoleID int64, options ...RequestOptionFunc) (*Response, error) ListMemberRoles(gid any, options ...RequestOptionFunc) ([]*MemberRole, *Response, error) CreateMemberRole(gid any, opt *CreateMemberRoleOptions, options ...RequestOptionFunc) (*MemberRole, *Response, error) - DeleteMemberRole(gid any, memberRole int, options ...RequestOptionFunc) (*Response, error) + DeleteMemberRole(gid any, memberRole int64, options ...RequestOptionFunc) (*Response, error) } // MemberRolesService handles communication with the member roles related @@ -32,10 +31,10 @@ var _ MemberRolesServiceInterface = (*MemberRolesService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/member_roles/#list-all-member-roles-of-a-group type MemberRole struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description,omitempty"` - GroupID int `json:"group_id"` + GroupID int64 `json:"group_id"` BaseAccessLevel AccessLevelValue `json:"base_access_level"` AdminCICDVariables bool `json:"admin_cicd_variables,omitempty"` AdminComplianceFramework bool `json:"admin_compliance_framework,omitempty"` @@ -65,18 +64,12 @@ type MemberRole struct { // GitLab API docs: // https://docs.gitlab.com/api/member_roles/#get-all-instance-member-roles func (s *MemberRolesService) ListInstanceMemberRoles(options ...RequestOptionFunc) ([]*MemberRole, *Response, error) { - req, err := s.client.NewRequest(http.MethodGet, "member_roles", nil, options) - if err != nil { - return nil, nil, err - } - - var mrs []*MemberRole - resp, err := s.client.Do(req, &mrs) - if err != nil { - return nil, resp, err - } - - return mrs, resp, nil + return do[[]*MemberRole](s.client, + withMethod(http.MethodGet), + withPath("member_roles"), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // CreateMemberRoleOptions represents the available CreateInstanceMemberRole() @@ -116,33 +109,26 @@ type CreateMemberRoleOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/member_roles/#create-a-instance-member-role func (s *MemberRolesService) CreateInstanceMemberRole(opt *CreateMemberRoleOptions, options ...RequestOptionFunc) (*MemberRole, *Response, error) { - req, err := s.client.NewRequest(http.MethodPost, "member_roles", opt, options) - if err != nil { - return nil, nil, err - } - - mr := new(MemberRole) - resp, err := s.client.Do(req, mr) - if err != nil { - return nil, resp, err - } - - return mr, resp, nil + return do[*MemberRole](s.client, + withMethod(http.MethodPost), + withPath("member_roles"), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // DeleteInstanceMemberRole deletes a member role from a specified group. // // GitLab API docs: // https://docs.gitlab.com/api/member_roles/#delete-an-instance-member-role -func (s *MemberRolesService) DeleteInstanceMemberRole(memberRoleID int, options ...RequestOptionFunc) (*Response, error) { - u := fmt.Sprintf("member_roles/%d", memberRoleID) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *MemberRolesService) DeleteInstanceMemberRole(memberRoleID int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("member_roles/%d", memberRoleID), + withAPIOpts(nil), + withRequestOpts(options...), + ) + return resp, err } // ListMemberRoles gets a list of member roles for a specified group. @@ -150,24 +136,12 @@ func (s *MemberRolesService) DeleteInstanceMemberRole(memberRoleID int, options // GitLab API docs: // https://docs.gitlab.com/api/member_roles/#get-all-group-member-roles func (s *MemberRolesService) ListMemberRoles(gid any, options ...RequestOptionFunc) ([]*MemberRole, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/member_roles", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - var mrs []*MemberRole - resp, err := s.client.Do(req, &mrs) - if err != nil { - return nil, resp, err - } - - return mrs, resp, nil + return do[[]*MemberRole](s.client, + withMethod(http.MethodGet), + withPath("groups/%s/member_roles", GroupID{gid}), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // CreateMemberRole creates a new member role for a specified group. @@ -175,41 +149,24 @@ func (s *MemberRolesService) ListMemberRoles(gid any, options ...RequestOptionFu // GitLab API docs: // https://docs.gitlab.com/api/member_roles/#add-a-member-role-to-a-group func (s *MemberRolesService) CreateMemberRole(gid any, opt *CreateMemberRoleOptions, options ...RequestOptionFunc) (*MemberRole, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/member_roles", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - mr := new(MemberRole) - resp, err := s.client.Do(req, mr) - if err != nil { - return nil, resp, err - } - - return mr, resp, nil + return do[*MemberRole](s.client, + withMethod(http.MethodPost), + withPath("groups/%s/member_roles", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // DeleteMemberRole deletes a member role from a specified group. // // GitLab API docs: // https://docs.gitlab.com/api/member_roles/#remove-member-role-of-a-group -func (s *MemberRolesService) DeleteMemberRole(gid any, memberRole int, options ...RequestOptionFunc) (*Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("groups/%s/member_roles/%d", PathEscape(group), memberRole) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *MemberRolesService) DeleteMemberRole(gid any, memberRole int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("groups/%s/member_roles/%d", GroupID{gid}, memberRole), + withAPIOpts(nil), + withRequestOpts(options...), + ) + return resp, err } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/merge_request_approval_settings.go b/vendor/gitlab.com/gitlab-org/api/client-go/merge_request_approval_settings.go index c1701be22..6d183a64c 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/merge_request_approval_settings.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/merge_request_approval_settings.go @@ -22,9 +22,9 @@ import ( type ( MergeRequestApprovalSettingsServiceInterface interface { GetGroupMergeRequestApprovalSettings(gid any, options ...RequestOptionFunc) (*MergeRequestApprovalSettings, *Response, error) - UpdateGroupMergeRequestApprovalSettings(gid any, opt *UpdateMergeRequestApprovalSettingsOptions, options ...RequestOptionFunc) (*MergeRequestApprovalSettings, *Response, error) + UpdateGroupMergeRequestApprovalSettings(gid any, opt *UpdateGroupMergeRequestApprovalSettingsOptions, options ...RequestOptionFunc) (*MergeRequestApprovalSettings, *Response, error) GetProjectMergeRequestApprovalSettings(pid any, options ...RequestOptionFunc) (*MergeRequestApprovalSettings, *Response, error) - UpdateProjectMergeRequestApprovalSettings(pid any, opt *UpdateMergeRequestApprovalSettingsOptions, options ...RequestOptionFunc) (*MergeRequestApprovalSettings, *Response, error) + UpdateProjectMergeRequestApprovalSettings(pid any, opt *UpdateProjectMergeRequestApprovalSettingsOptions, options ...RequestOptionFunc) (*MergeRequestApprovalSettings, *Response, error) } // MergeRequestApprovalSettingsService handles communication with the merge @@ -90,19 +90,32 @@ func (s *MergeRequestApprovalSettingsService) GetGroupMergeRequestApprovalSettin return settings, resp, nil } -// UpdateMergeRequestApprovalSettingsOptions represents the available -// UpdateGroupMergeRequestApprovalSettings() and UpdateProjectMergeRequestApprovalSettings() +// UpdateProjectMergeRequestApprovalSettingsOptions represents the available +// UpdateProjectMergeRequestApprovalSettings() // options. // // GitLab API docs: -// https://docs.gitlab.com/api/merge_request_approval_settings/#update-group-mr-approval-settings // https://docs.gitlab.com/api/merge_request_approval_settings/#update-project-mr-approval-settings -type UpdateMergeRequestApprovalSettingsOptions struct { +type UpdateProjectMergeRequestApprovalSettingsOptions struct { AllowAuthorApproval *bool `url:"allow_author_approval,omitempty" json:"allow_author_approval,omitempty"` AllowCommitterApproval *bool `url:"allow_committer_approval,omitempty" json:"allow_committer_approval,omitempty"` AllowOverridesToApproverListPerMergeRequest *bool `url:"allow_overrides_to_approver_list_per_merge_request,omitempty" json:"allow_overrides_to_approver_list_per_merge_request,omitempty"` RetainApprovalsOnPush *bool `url:"retain_approvals_on_push,omitempty" json:"retain_approvals_on_push,omitempty"` + RequireReauthenticationToApprove *bool `url:"require_reauthentication_to_approve,omitempty" json:"require_reauthentication_to_approve,omitempty"` SelectiveCodeOwnerRemovals *bool `url:"selective_code_owner_removals,omitempty" json:"selective_code_owner_removals,omitempty"` +} + +// UpdateGroupMergeRequestApprovalSettingsOptions represents the available +// UpdateGroupRequestApprovalSettings() +// options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/merge_request_approval_settings/#update-group-mr-approval-settings +type UpdateGroupMergeRequestApprovalSettingsOptions struct { + AllowAuthorApproval *bool `url:"allow_author_approval,omitempty" json:"allow_author_approval,omitempty"` + AllowCommitterApproval *bool `url:"allow_committer_approval,omitempty" json:"allow_committer_approval,omitempty"` + AllowOverridesToApproverListPerMergeRequest *bool `url:"allow_overrides_to_approver_list_per_merge_request,omitempty" json:"allow_overrides_to_approver_list_per_merge_request,omitempty"` + RetainApprovalsOnPush *bool `url:"retain_approvals_on_push,omitempty" json:"retain_approvals_on_push,omitempty"` RequireReauthenticationToApprove *bool `url:"require_reauthentication_to_approve,omitempty" json:"require_reauthentication_to_approve,omitempty"` } @@ -111,7 +124,7 @@ type UpdateMergeRequestApprovalSettingsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approval_settings/#update-group-mr-approval-settings -func (s *MergeRequestApprovalSettingsService) UpdateGroupMergeRequestApprovalSettings(gid any, opt *UpdateMergeRequestApprovalSettingsOptions, options ...RequestOptionFunc) (*MergeRequestApprovalSettings, *Response, error) { +func (s *MergeRequestApprovalSettingsService) UpdateGroupMergeRequestApprovalSettings(gid any, opt *UpdateGroupMergeRequestApprovalSettingsOptions, options ...RequestOptionFunc) (*MergeRequestApprovalSettings, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -163,7 +176,7 @@ func (s *MergeRequestApprovalSettingsService) GetProjectMergeRequestApprovalSett // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approval_settings/#update-project-mr-approval-settings -func (s *MergeRequestApprovalSettingsService) UpdateProjectMergeRequestApprovalSettings(pid any, opt *UpdateMergeRequestApprovalSettingsOptions, options ...RequestOptionFunc) (*MergeRequestApprovalSettings, *Response, error) { +func (s *MergeRequestApprovalSettingsService) UpdateProjectMergeRequestApprovalSettings(pid any, opt *UpdateProjectMergeRequestApprovalSettingsOptions, options ...RequestOptionFunc) (*MergeRequestApprovalSettings, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/merge_request_approvals.go b/vendor/gitlab.com/gitlab-org/api/client-go/merge_request_approvals.go index 80d16bec6..12263ac96 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/merge_request_approvals.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/merge_request_approvals.go @@ -24,16 +24,16 @@ import ( type ( MergeRequestApprovalsServiceInterface interface { - ApproveMergeRequest(pid any, mr int, opt *ApproveMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) - UnapproveMergeRequest(pid any, mr int, options ...RequestOptionFunc) (*Response, error) - ResetApprovalsOfMergeRequest(pid any, mr int, options ...RequestOptionFunc) (*Response, error) - GetConfiguration(pid any, mr int, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) - ChangeApprovalConfiguration(pid any, mergeRequest int, opt *ChangeMergeRequestApprovalConfigurationOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) - GetApprovalRules(pid any, mergeRequest int, options ...RequestOptionFunc) ([]*MergeRequestApprovalRule, *Response, error) - GetApprovalState(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeRequestApprovalState, *Response, error) - CreateApprovalRule(pid any, mergeRequest int, opt *CreateMergeRequestApprovalRuleOptions, options ...RequestOptionFunc) (*MergeRequestApprovalRule, *Response, error) - UpdateApprovalRule(pid any, mergeRequest int, approvalRule int, opt *UpdateMergeRequestApprovalRuleOptions, options ...RequestOptionFunc) (*MergeRequestApprovalRule, *Response, error) - DeleteApprovalRule(pid any, mergeRequest int, approvalRule int, options ...RequestOptionFunc) (*Response, error) + ApproveMergeRequest(pid any, mr int64, opt *ApproveMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) + UnapproveMergeRequest(pid any, mr int64, options ...RequestOptionFunc) (*Response, error) + ResetApprovalsOfMergeRequest(pid any, mr int64, options ...RequestOptionFunc) (*Response, error) + GetConfiguration(pid any, mr int64, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) + ChangeApprovalConfiguration(pid any, mergeRequest int64, opt *ChangeMergeRequestApprovalConfigurationOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) + GetApprovalRules(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*MergeRequestApprovalRule, *Response, error) + GetApprovalState(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequestApprovalState, *Response, error) + CreateApprovalRule(pid any, mergeRequest int64, opt *CreateMergeRequestApprovalRuleOptions, options ...RequestOptionFunc) (*MergeRequestApprovalRule, *Response, error) + UpdateApprovalRule(pid any, mergeRequest int64, approvalRule int64, opt *UpdateMergeRequestApprovalRuleOptions, options ...RequestOptionFunc) (*MergeRequestApprovalRule, *Response, error) + DeleteApprovalRule(pid any, mergeRequest int64, approvalRule int64, options ...RequestOptionFunc) (*Response, error) } // MergeRequestApprovalsService handles communication with the merge request @@ -53,9 +53,9 @@ var _ MergeRequestApprovalsServiceInterface = (*MergeRequestApprovalsService)(ni // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#single-merge-request-approval type MergeRequestApprovals struct { - ID int `json:"id"` - IID int `json:"iid"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + ProjectID int64 `json:"project_id"` Title string `json:"title"` Description string `json:"description"` State string `json:"state"` @@ -63,9 +63,9 @@ type MergeRequestApprovals struct { UpdatedAt *time.Time `json:"updated_at"` MergeStatus string `json:"merge_status"` Approved bool `json:"approved"` - ApprovalsBeforeMerge int `json:"approvals_before_merge"` - ApprovalsRequired int `json:"approvals_required"` - ApprovalsLeft int `json:"approvals_left"` + ApprovalsBeforeMerge int64 `json:"approvals_before_merge"` + ApprovalsRequired int64 `json:"approvals_required"` + ApprovalsLeft int64 `json:"approvals_left"` RequirePasswordToApprove bool `json:"require_password_to_approve"` ApprovedBy []*MergeRequestApproverUser `json:"approved_by"` SuggestedApprovers []*BasicUser `json:"suggested_approvers"` @@ -83,24 +83,26 @@ func (m MergeRequestApprovals) String() string { return Stringify(m) } -// MergeRequestApproverGroup represents GitLab project level merge request approver group. +// MergeRequestApproverGroup represents GitLab project level merge request approver group. // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#project-approval-rules type MergeRequestApproverGroup struct { - Group struct { - ID int `json:"id"` - Name string `json:"name"` - Path string `json:"path"` - Description string `json:"description"` - Visibility string `json:"visibility"` - AvatarURL string `json:"avatar_url"` - WebURL string `json:"web_url"` - FullName string `json:"full_name"` - FullPath string `json:"full_path"` - LFSEnabled bool `json:"lfs_enabled"` - RequestAccessEnabled bool `json:"request_access_enabled"` - } + Group MergeRequestApproverNestedGroup `json:"group"` +} + +type MergeRequestApproverNestedGroup struct { + ID int64 `json:"id"` + Name string `json:"name"` + Path string `json:"path"` + Description string `json:"description"` + Visibility string `json:"visibility"` + AvatarURL string `json:"avatar_url"` + WebURL string `json:"web_url"` + FullName string `json:"full_name"` + FullPath string `json:"full_path"` + LFSEnabled bool `json:"lfs_enabled"` + RequestAccessEnabled bool `json:"request_access_enabled"` } // MergeRequestApprovalRule represents a GitLab merge request approval rule. @@ -108,12 +110,12 @@ type MergeRequestApproverGroup struct { // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#get-merge-request-approval-rules type MergeRequestApprovalRule struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` RuleType string `json:"rule_type"` ReportType string `json:"report_type"` EligibleApprovers []*BasicUser `json:"eligible_approvers"` - ApprovalsRequired int `json:"approvals_required"` + ApprovalsRequired int64 `json:"approvals_required"` SourceRule *ProjectApprovalRule `json:"source_rule"` Users []*BasicUser `json:"users"` Groups []*Group `json:"groups"` @@ -158,7 +160,7 @@ type ApproveMergeRequestOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#approve-merge-request -func (s *MergeRequestApprovalsService) ApproveMergeRequest(pid any, mr int, opt *ApproveMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) { +func (s *MergeRequestApprovalsService) ApproveMergeRequest(pid any, mr int64, opt *ApproveMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -183,7 +185,7 @@ func (s *MergeRequestApprovalsService) ApproveMergeRequest(pid any, mr int, opt // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#unapprove-merge-request -func (s *MergeRequestApprovalsService) UnapproveMergeRequest(pid any, mr int, options ...RequestOptionFunc) (*Response, error) { +func (s *MergeRequestApprovalsService) UnapproveMergeRequest(pid any, mr int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -203,7 +205,7 @@ func (s *MergeRequestApprovalsService) UnapproveMergeRequest(pid any, mr int, op // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#reset-approvals-of-a-merge-request -func (s *MergeRequestApprovalsService) ResetApprovalsOfMergeRequest(pid any, mr int, options ...RequestOptionFunc) (*Response, error) { +func (s *MergeRequestApprovalsService) ResetApprovalsOfMergeRequest(pid any, mr int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -222,7 +224,7 @@ func (s *MergeRequestApprovalsService) ResetApprovalsOfMergeRequest(pid any, mr // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#single-merge-request-approval -func (s *MergeRequestApprovalsService) GetConfiguration(pid any, mr int, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) { +func (s *MergeRequestApprovalsService) GetConfiguration(pid any, mr int64, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -248,13 +250,13 @@ func (s *MergeRequestApprovalsService) GetConfiguration(pid any, mr int, options // // Deprecated: in GitLab 16.0 type ChangeMergeRequestApprovalConfigurationOptions struct { - ApprovalsRequired *int `url:"approvals_required,omitempty" json:"approvals_required,omitempty"` + ApprovalsRequired *int64 `url:"approvals_required,omitempty" json:"approvals_required,omitempty"` } // ChangeApprovalConfiguration updates the approval configuration of a merge request. // // Deprecated: in GitLab 16.0 -func (s *MergeRequestApprovalsService) ChangeApprovalConfiguration(pid any, mergeRequest int, opt *ChangeMergeRequestApprovalConfigurationOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { +func (s *MergeRequestApprovalsService) ChangeApprovalConfiguration(pid any, mergeRequest int64, opt *ChangeMergeRequestApprovalConfigurationOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -279,7 +281,7 @@ func (s *MergeRequestApprovalsService) ChangeApprovalConfiguration(pid any, merg // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#get-merge-request-approval-rules -func (s *MergeRequestApprovalsService) GetApprovalRules(pid any, mergeRequest int, options ...RequestOptionFunc) ([]*MergeRequestApprovalRule, *Response, error) { +func (s *MergeRequestApprovalsService) GetApprovalRules(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*MergeRequestApprovalRule, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -304,7 +306,7 @@ func (s *MergeRequestApprovalsService) GetApprovalRules(pid any, mergeRequest in // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#get-the-approval-state-of-merge-requests -func (s *MergeRequestApprovalsService) GetApprovalState(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeRequestApprovalState, *Response, error) { +func (s *MergeRequestApprovalsService) GetApprovalState(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequestApprovalState, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -331,18 +333,18 @@ func (s *MergeRequestApprovalsService) GetApprovalState(pid any, mergeRequest in // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#create-merge-request-rule type CreateMergeRequestApprovalRuleOptions struct { - Name *string `url:"name,omitempty" json:"name,omitempty"` - ApprovalsRequired *int `url:"approvals_required,omitempty" json:"approvals_required,omitempty"` - ApprovalProjectRuleID *int `url:"approval_project_rule_id,omitempty" json:"approval_project_rule_id,omitempty"` - UserIDs *[]int `url:"user_ids,omitempty" json:"user_ids,omitempty"` - GroupIDs *[]int `url:"group_ids,omitempty" json:"group_ids,omitempty"` + Name *string `url:"name,omitempty" json:"name,omitempty"` + ApprovalsRequired *int64 `url:"approvals_required,omitempty" json:"approvals_required,omitempty"` + ApprovalProjectRuleID *int64 `url:"approval_project_rule_id,omitempty" json:"approval_project_rule_id,omitempty"` + UserIDs *[]int64 `url:"user_ids,omitempty" json:"user_ids,omitempty"` + GroupIDs *[]int64 `url:"group_ids,omitempty" json:"group_ids,omitempty"` } // CreateApprovalRule creates a new MR level approval rule. // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#create-merge-request-rule -func (s *MergeRequestApprovalsService) CreateApprovalRule(pid any, mergeRequest int, opt *CreateMergeRequestApprovalRuleOptions, options ...RequestOptionFunc) (*MergeRequestApprovalRule, *Response, error) { +func (s *MergeRequestApprovalsService) CreateApprovalRule(pid any, mergeRequest int64, opt *CreateMergeRequestApprovalRuleOptions, options ...RequestOptionFunc) (*MergeRequestApprovalRule, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -369,17 +371,17 @@ func (s *MergeRequestApprovalsService) CreateApprovalRule(pid any, mergeRequest // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#update-merge-request-rule type UpdateMergeRequestApprovalRuleOptions struct { - Name *string `url:"name,omitempty" json:"name,omitempty"` - ApprovalsRequired *int `url:"approvals_required,omitempty" json:"approvals_required,omitempty"` - UserIDs *[]int `url:"user_ids,omitempty" json:"user_ids,omitempty"` - GroupIDs *[]int `url:"group_ids,omitempty" json:"group_ids,omitempty"` + Name *string `url:"name,omitempty" json:"name,omitempty"` + ApprovalsRequired *int64 `url:"approvals_required,omitempty" json:"approvals_required,omitempty"` + UserIDs *[]int64 `url:"user_ids,omitempty" json:"user_ids,omitempty"` + GroupIDs *[]int64 `url:"group_ids,omitempty" json:"group_ids,omitempty"` } // UpdateApprovalRule updates an existing approval rule with new options. // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#update-merge-request-rule -func (s *MergeRequestApprovalsService) UpdateApprovalRule(pid any, mergeRequest int, approvalRule int, opt *UpdateMergeRequestApprovalRuleOptions, options ...RequestOptionFunc) (*MergeRequestApprovalRule, *Response, error) { +func (s *MergeRequestApprovalsService) UpdateApprovalRule(pid any, mergeRequest int64, approvalRule int64, opt *UpdateMergeRequestApprovalRuleOptions, options ...RequestOptionFunc) (*MergeRequestApprovalRule, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -404,7 +406,7 @@ func (s *MergeRequestApprovalsService) UpdateApprovalRule(pid any, mergeRequest // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#delete-merge-request-rule -func (s *MergeRequestApprovalsService) DeleteApprovalRule(pid any, mergeRequest int, approvalRule int, options ...RequestOptionFunc) (*Response, error) { +func (s *MergeRequestApprovalsService) DeleteApprovalRule(pid any, mergeRequest int64, approvalRule int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/merge_requests.go b/vendor/gitlab.com/gitlab-org/api/client-go/merge_requests.go index ab2d6c443..220d4daec 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/merge_requests.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/merge_requests.go @@ -19,7 +19,6 @@ package gitlab import ( "bytes" "encoding/json" - "fmt" "net/http" "time" ) @@ -29,37 +28,37 @@ type ( ListMergeRequests(opt *ListMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) ListProjectMergeRequests(pid any, opt *ListProjectMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) ListGroupMergeRequests(gid any, opt *ListGroupMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) - GetMergeRequest(pid any, mergeRequest int, opt *GetMergeRequestsOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) - GetMergeRequestApprovals(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) - GetMergeRequestCommits(pid any, mergeRequest int, opt *GetMergeRequestCommitsOptions, options ...RequestOptionFunc) ([]*Commit, *Response, error) - GetMergeRequestChanges(pid any, mergeRequest int, opt *GetMergeRequestChangesOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) - ListMergeRequestDiffs(pid any, mergeRequest int, opt *ListMergeRequestDiffsOptions, options ...RequestOptionFunc) ([]*MergeRequestDiff, *Response, error) - ShowMergeRequestRawDiffs(pid any, mergeRequest int, opt *ShowMergeRequestRawDiffsOptions, options ...RequestOptionFunc) ([]byte, *Response, error) - GetMergeRequestParticipants(pid any, mergeRequest int, options ...RequestOptionFunc) ([]*BasicUser, *Response, error) - GetMergeRequestReviewers(pid any, mergeRequest int, options ...RequestOptionFunc) ([]*MergeRequestReviewer, *Response, error) - ListMergeRequestPipelines(pid any, mergeRequest int, options ...RequestOptionFunc) ([]*PipelineInfo, *Response, error) - CreateMergeRequestPipeline(pid any, mergeRequest int, options ...RequestOptionFunc) (*PipelineInfo, *Response, error) - GetIssuesClosedOnMerge(pid any, mergeRequest int, opt *GetIssuesClosedOnMergeOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) - ListRelatedIssues(pid any, mergeRequest int, opt *ListRelatedIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) + GetMergeRequest(pid any, mergeRequest int64, opt *GetMergeRequestsOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) + GetMergeRequestApprovals(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) + GetMergeRequestCommits(pid any, mergeRequest int64, opt *GetMergeRequestCommitsOptions, options ...RequestOptionFunc) ([]*Commit, *Response, error) + GetMergeRequestChanges(pid any, mergeRequest int64, opt *GetMergeRequestChangesOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) + ListMergeRequestDiffs(pid any, mergeRequest int64, opt *ListMergeRequestDiffsOptions, options ...RequestOptionFunc) ([]*MergeRequestDiff, *Response, error) + ShowMergeRequestRawDiffs(pid any, mergeRequest int64, opt *ShowMergeRequestRawDiffsOptions, options ...RequestOptionFunc) ([]byte, *Response, error) + GetMergeRequestParticipants(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*BasicUser, *Response, error) + GetMergeRequestReviewers(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*MergeRequestReviewer, *Response, error) + ListMergeRequestPipelines(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*PipelineInfo, *Response, error) + CreateMergeRequestPipeline(pid any, mergeRequest int64, options ...RequestOptionFunc) (*PipelineInfo, *Response, error) + GetIssuesClosedOnMerge(pid any, mergeRequest int64, opt *GetIssuesClosedOnMergeOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) + ListRelatedIssues(pid any, mergeRequest int64, opt *ListRelatedIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) CreateMergeRequest(pid any, opt *CreateMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) - UpdateMergeRequest(pid any, mergeRequest int, opt *UpdateMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) - DeleteMergeRequest(pid any, mergeRequest int, options ...RequestOptionFunc) (*Response, error) - AcceptMergeRequest(pid any, mergeRequest int, opt *AcceptMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) - CancelMergeWhenPipelineSucceeds(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeRequest, *Response, error) - RebaseMergeRequest(pid any, mergeRequest int, opt *RebaseMergeRequestOptions, options ...RequestOptionFunc) (*Response, error) - GetMergeRequestDiffVersions(pid any, mergeRequest int, opt *GetMergeRequestDiffVersionsOptions, options ...RequestOptionFunc) ([]*MergeRequestDiffVersion, *Response, error) - GetSingleMergeRequestDiffVersion(pid any, mergeRequest, version int, opt *GetSingleMergeRequestDiffVersionOptions, options ...RequestOptionFunc) (*MergeRequestDiffVersion, *Response, error) - SubscribeToMergeRequest(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeRequest, *Response, error) - UnsubscribeFromMergeRequest(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeRequest, *Response, error) - CreateTodo(pid any, mergeRequest int, options ...RequestOptionFunc) (*Todo, *Response, error) - SetTimeEstimate(pid any, mergeRequest int, opt *SetTimeEstimateOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) - ResetTimeEstimate(pid any, mergeRequest int, options ...RequestOptionFunc) (*TimeStats, *Response, error) - AddSpentTime(pid any, mergeRequest int, opt *AddSpentTimeOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) - ResetSpentTime(pid any, mergeRequest int, options ...RequestOptionFunc) (*TimeStats, *Response, error) - GetTimeSpent(pid any, mergeRequest int, options ...RequestOptionFunc) (*TimeStats, *Response, error) - CreateMergeRequestDependency(pid any, mergeRequest int, opts CreateMergeRequestDependencyOptions, options ...RequestOptionFunc) (*MergeRequestDependency, *Response, error) - DeleteMergeRequestDependency(pid any, mergeRequest int, blockingMergeRequest int, options ...RequestOptionFunc) (*Response, error) - GetMergeRequestDependencies(pid any, mergeRequest int, options ...RequestOptionFunc) ([]MergeRequestDependency, *Response, error) + UpdateMergeRequest(pid any, mergeRequest int64, opt *UpdateMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) + DeleteMergeRequest(pid any, mergeRequest int64, options ...RequestOptionFunc) (*Response, error) + AcceptMergeRequest(pid any, mergeRequest int64, opt *AcceptMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) + CancelMergeWhenPipelineSucceeds(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequest, *Response, error) + RebaseMergeRequest(pid any, mergeRequest int64, opt *RebaseMergeRequestOptions, options ...RequestOptionFunc) (*Response, error) + GetMergeRequestDiffVersions(pid any, mergeRequest int64, opt *GetMergeRequestDiffVersionsOptions, options ...RequestOptionFunc) ([]*MergeRequestDiffVersion, *Response, error) + GetSingleMergeRequestDiffVersion(pid any, mergeRequest, version int64, opt *GetSingleMergeRequestDiffVersionOptions, options ...RequestOptionFunc) (*MergeRequestDiffVersion, *Response, error) + SubscribeToMergeRequest(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequest, *Response, error) + UnsubscribeFromMergeRequest(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequest, *Response, error) + CreateTodo(pid any, mergeRequest int64, options ...RequestOptionFunc) (*Todo, *Response, error) + SetTimeEstimate(pid any, mergeRequest int64, opt *SetTimeEstimateOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) + ResetTimeEstimate(pid any, mergeRequest int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) + AddSpentTime(pid any, mergeRequest int64, opt *AddSpentTimeOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) + ResetSpentTime(pid any, mergeRequest int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) + GetTimeSpent(pid any, mergeRequest int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) + CreateMergeRequestDependency(pid any, mergeRequest int64, opts CreateMergeRequestDependencyOptions, options ...RequestOptionFunc) (*MergeRequestDependency, *Response, error) + DeleteMergeRequestDependency(pid any, mergeRequest int64, blockingMergeRequest int64, options ...RequestOptionFunc) (*Response, error) + GetMergeRequestDependencies(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]MergeRequestDependency, *Response, error) } // MergeRequestsService handles communication with the merge requests related @@ -79,25 +78,25 @@ var _ MergeRequestsServiceInterface = (*MergeRequestsService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/ type BasicMergeRequest struct { - ID int `json:"id"` - IID int `json:"iid"` + ID int64 `json:"id"` + IID int64 `json:"iid"` TargetBranch string `json:"target_branch"` SourceBranch string `json:"source_branch"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Title string `json:"title"` State string `json:"state"` Imported bool `json:"imported"` ImportedFrom string `json:"imported_from"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` - Upvotes int `json:"upvotes"` - Downvotes int `json:"downvotes"` + Upvotes int64 `json:"upvotes"` + Downvotes int64 `json:"downvotes"` Author *BasicUser `json:"author"` Assignee *BasicUser `json:"assignee"` Assignees []*BasicUser `json:"assignees"` Reviewers []*BasicUser `json:"reviewers"` - SourceProjectID int `json:"source_project_id"` - TargetProjectID int `json:"target_project_id"` + SourceProjectID int64 `json:"source_project_id"` + TargetProjectID int64 `json:"target_project_id"` Labels Labels `json:"labels"` LabelDetails []*LabelDetails `json:"label_details"` Description string `json:"description"` @@ -114,7 +113,7 @@ type BasicMergeRequest struct { SHA string `json:"sha"` MergeCommitSHA string `json:"merge_commit_sha"` SquashCommitSHA string `json:"squash_commit_sha"` - UserNotesCount int `json:"user_notes_count"` + UserNotesCount int64 `json:"user_notes_count"` ShouldRemoveSourceBranch bool `json:"should_remove_source_branch"` ForceRemoveSourceBranch bool `json:"force_remove_source_branch"` AllowCollaboration bool `json:"allow_collaboration"` @@ -142,25 +141,19 @@ func (m BasicMergeRequest) String() string { // GitLab API docs: https://docs.gitlab.com/api/merge_requests/ type MergeRequest struct { BasicMergeRequest - MergeError string `json:"merge_error"` - Subscribed bool `json:"subscribed"` - ChangesCount string `json:"changes_count"` - User struct { - CanMerge bool `json:"can_merge"` - } `json:"user"` - LatestBuildStartedAt *time.Time `json:"latest_build_started_at"` - LatestBuildFinishedAt *time.Time `json:"latest_build_finished_at"` - FirstDeployedToProductionAt *time.Time `json:"first_deployed_to_production_at"` - Pipeline *PipelineInfo `json:"pipeline"` - HeadPipeline *Pipeline `json:"head_pipeline"` - DiffRefs struct { - BaseSha string `json:"base_sha"` - HeadSha string `json:"head_sha"` - StartSha string `json:"start_sha"` - } `json:"diff_refs"` - RebaseInProgress bool `json:"rebase_in_progress"` - DivergedCommitsCount int `json:"diverged_commits_count"` - FirstContribution bool `json:"first_contribution"` + MergeError string `json:"merge_error"` + Subscribed bool `json:"subscribed"` + ChangesCount string `json:"changes_count"` + User MergeRequestUser `json:"user"` + LatestBuildStartedAt *time.Time `json:"latest_build_started_at"` + LatestBuildFinishedAt *time.Time `json:"latest_build_finished_at"` + FirstDeployedToProductionAt *time.Time `json:"first_deployed_to_production_at"` + Pipeline *PipelineInfo `json:"pipeline"` + HeadPipeline *Pipeline `json:"head_pipeline"` + DiffRefs MergeRequestDiffRefs `json:"diff_refs"` + RebaseInProgress bool `json:"rebase_in_progress"` + DivergedCommitsCount int64 `json:"diverged_commits_count"` + FirstContribution bool `json:"first_contribution"` // Deprecated: use Draft instead WorkInProgress bool `json:"work_in_progress"` @@ -170,6 +163,30 @@ func (m MergeRequest) String() string { return Stringify(m) } +// MergeRequestUser represents a GitLab merge request user. +// +// GitLab API docs: https://docs.gitlab.com/api/merge_requests/ +type MergeRequestUser struct { + CanMerge bool `json:"can_merge"` +} + +func (u MergeRequestUser) String() string { + return Stringify(u) +} + +// MergeRequestDiffRefs represents a GitLab merge request diff refs. +// +// GitLab API docs: https://docs.gitlab.com/api/merge_requests/ +type MergeRequestDiffRefs struct { + BaseSha string `json:"base_sha"` + HeadSha string `json:"head_sha"` + StartSha string `json:"start_sha"` +} + +func (d MergeRequestDiffRefs) String() string { + return Stringify(d) +} + func (m *MergeRequest) UnmarshalJSON(data []byte) error { type alias MergeRequest @@ -225,12 +242,12 @@ type MergeRequestDiff struct { // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-merge-request-diff-versions type MergeRequestDiffVersion struct { - ID int `json:"id"` + ID int64 `json:"id"` HeadCommitSHA string `json:"head_commit_sha,omitempty"` BaseCommitSHA string `json:"base_commit_sha,omitempty"` StartCommitSHA string `json:"start_commit_sha,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` - MergeRequestID int `json:"merge_request_id,omitempty"` + MergeRequestID int64 `json:"merge_request_id,omitempty"` State string `json:"state,omitempty"` RealSize string `json:"real_size,omitempty"` Commits []*Commit `json:"commits,omitempty"` @@ -241,6 +258,15 @@ func (m MergeRequestDiffVersion) String() string { return Stringify(m) } +// MergeRequestReviewer represents a reviewer entry returned by the reviewers API. +// Matches the JSON shape used in tests: {"user": {...}, "state": "...", "created_at": "..."} +// Placed here because it's used by MergeRequestsService.GetMergeRequestReviewers and tests/mock. +type MergeRequestReviewer struct { + User *BasicUser `json:"user"` + State string `json:"state"` + CreatedAt *time.Time `json:"created_at"` +} + // ListMergeRequestsOptions represents the available ListMergeRequests() // options. // @@ -263,7 +289,7 @@ type ListMergeRequestsOptions struct { UpdatedAfter *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"` UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` NotAuthorUsername *string `url:"not[author_username],omitempty" json:"not[author_username],omitempty"` AssigneeID *AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` @@ -288,13 +314,12 @@ type ListMergeRequestsOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#list-merge-requests func (s *MergeRequestsService) ListMergeRequests(opt *ListMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { - req, err := s.client.NewRequest(http.MethodGet, "merge_requests", opt, options) - if err != nil { - return nil, nil, err - } - - var mrs []*MergeRequest - resp, err := s.client.Do(req, &mrs) + mrs, resp, err := do[[]*MergeRequest](s.client, + withMethod(http.MethodGet), + withPath("merge_requests"), + withAPIOpts(opt), + withRequestOpts(options...), + ) if err != nil { return nil, resp, err } @@ -309,7 +334,7 @@ func (s *MergeRequestsService) ListMergeRequests(opt *ListMergeRequestsOptions, // https://docs.gitlab.com/api/merge_requests/#list-project-merge-requests type ListProjectMergeRequestsOptions struct { ListOptions - IIDs *[]int `url:"iids[],omitempty" json:"iids,omitempty"` + IIDs *[]int64 `url:"iids[],omitempty" json:"iids,omitempty"` State *string `url:"state,omitempty" json:"state,omitempty"` OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"` Sort *string `url:"sort,omitempty" json:"sort,omitempty"` @@ -324,7 +349,7 @@ type ListProjectMergeRequestsOptions struct { UpdatedAfter *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"` UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` NotAuthorUsername *string `url:"not[author_username],omitempty" json:"not[author_username],omitempty"` AssigneeID *AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` @@ -345,19 +370,12 @@ type ListProjectMergeRequestsOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#list-project-merge-requests func (s *MergeRequestsService) ListProjectMergeRequests(pid any, opt *ListProjectMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests", PathEscape(project)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var mrs []*MergeRequest - resp, err := s.client.Do(req, &mrs) + mrs, resp, err := do[[]*MergeRequest](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests", ProjectID{pid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) if err != nil { return nil, resp, err } @@ -386,7 +404,7 @@ type ListGroupMergeRequestsOptions struct { UpdatedAfter *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"` UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"` Scope *string `url:"scope,omitempty" json:"scope,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` NotAuthorUsername *string `url:"not[author_username],omitempty" json:"not[author_username],omitempty"` AssigneeID *AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` @@ -408,19 +426,12 @@ type ListGroupMergeRequestsOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#list-group-merge-requests func (s *MergeRequestsService) ListGroupMergeRequests(gid any, opt *ListGroupMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { - group, err := parseID(gid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("groups/%s/merge_requests", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var mrs []*MergeRequest - resp, err := s.client.Do(req, &mrs) + mrs, resp, err := do[[]*MergeRequest](s.client, + withMethod(http.MethodGet), + withPath("groups/%s/merge_requests", GroupID{gid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) if err != nil { return nil, resp, err } @@ -443,50 +454,26 @@ type GetMergeRequestsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-single-mr -func (s *MergeRequestsService) GetMergeRequest(pid any, mergeRequest int, opt *GetMergeRequestsOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - m := new(MergeRequest) - resp, err := s.client.Do(req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil +func (s *MergeRequestsService) GetMergeRequest(pid any, mergeRequest int64, opt *GetMergeRequestsOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { + return do[*MergeRequest](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // GetMergeRequestApprovals gets information about a merge requests approvals // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#single-merge-request-approval -func (s *MergeRequestsService) GetMergeRequestApprovals(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/approvals", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - a := new(MergeRequestApprovals) - resp, err := s.client.Do(req, a) - if err != nil { - return nil, resp, err - } - - return a, resp, nil +func (s *MergeRequestsService) GetMergeRequestApprovals(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) { + return do[*MergeRequestApprovals](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/approvals", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // GetMergeRequestCommitsOptions represents the available GetMergeRequestCommits() @@ -494,31 +481,21 @@ func (s *MergeRequestsService) GetMergeRequestApprovals(pid any, mergeRequest in // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-single-merge-request-commits -type GetMergeRequestCommitsOptions ListOptions +type GetMergeRequestCommitsOptions struct { + ListOptions +} // GetMergeRequestCommits gets a list of merge request commits. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-single-merge-request-commits -func (s *MergeRequestsService) GetMergeRequestCommits(pid any, mergeRequest int, opt *GetMergeRequestCommitsOptions, options ...RequestOptionFunc) ([]*Commit, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/commits", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var c []*Commit - resp, err := s.client.Do(req, &c) - if err != nil { - return nil, resp, err - } - - return c, resp, nil +func (s *MergeRequestsService) GetMergeRequestCommits(pid any, mergeRequest int64, opt *GetMergeRequestCommitsOptions, options ...RequestOptionFunc) ([]*Commit, *Response, error) { + return do[[]*Commit](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/commits", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // GetMergeRequestChangesOptions represents the available GetMergeRequestChanges() @@ -541,25 +518,13 @@ type GetMergeRequestChangesOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-single-merge-request-changes -func (s *MergeRequestsService) GetMergeRequestChanges(pid any, mergeRequest int, opt *GetMergeRequestChangesOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/changes", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - m := new(MergeRequest) - resp, err := s.client.Do(req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil +func (s *MergeRequestsService) GetMergeRequestChanges(pid any, mergeRequest int64, opt *GetMergeRequestChangesOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { + return do[*MergeRequest](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/changes", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // ListMergeRequestDiffsOptions represents the available ListMergeRequestDiffs() @@ -576,25 +541,13 @@ type ListMergeRequestDiffsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#list-merge-request-diffs -func (s *MergeRequestsService) ListMergeRequestDiffs(pid any, mergeRequest int, opt *ListMergeRequestDiffsOptions, options ...RequestOptionFunc) ([]*MergeRequestDiff, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/diffs", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var m []*MergeRequestDiff - resp, err := s.client.Do(req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil +func (s *MergeRequestsService) ListMergeRequestDiffs(pid any, mergeRequest int64, opt *ListMergeRequestDiffsOptions, options ...RequestOptionFunc) ([]*MergeRequestDiff, *Response, error) { + return do[[]*MergeRequestDiff](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/diffs", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // ShowMergeRequestRawDiffsOptions represents the available ShowMergeRequestRawDiffs() @@ -608,139 +561,66 @@ type ShowMergeRequestRawDiffsOptions struct{} // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#show-merge-request-raw-diffs -func (s *MergeRequestsService) ShowMergeRequestRawDiffs(pid any, mergeRequest int, opt *ShowMergeRequestRawDiffsOptions, options ...RequestOptionFunc) ([]byte, *Response, error) { - project, err := parseID(pid) - if err != nil { - return []byte{}, nil, err - } - u := fmt.Sprintf( - "projects/%s/merge_requests/%d/raw_diffs", - PathEscape(project), - mergeRequest, +func (s *MergeRequestsService) ShowMergeRequestRawDiffs(pid any, mergeRequest int64, opt *ShowMergeRequestRawDiffsOptions, options ...RequestOptionFunc) ([]byte, *Response, error) { + b, resp, err := do[bytes.Buffer](s.client, + withPath("projects/%s/merge_requests/%d/raw_diffs", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), ) - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return []byte{}, nil, err - } - - var rd bytes.Buffer - resp, err := s.client.Do(req, &rd) - if err != nil { - return []byte{}, resp, err - } - - return rd.Bytes(), resp, nil + return b.Bytes(), resp, err } // GetMergeRequestParticipants gets a list of merge request participants. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-single-merge-request-participants -func (s *MergeRequestsService) GetMergeRequestParticipants(pid any, mergeRequest int, options ...RequestOptionFunc) ([]*BasicUser, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/participants", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - var bu []*BasicUser - resp, err := s.client.Do(req, &bu) - if err != nil { - return nil, resp, err - } - - return bu, resp, nil -} - -// MergeRequestReviewer represents a GitLab merge request reviewer. -// -// GitLab API docs: -// https://docs.gitlab.com/api/merge_requests/#get-single-merge-request-reviewers -type MergeRequestReviewer struct { - User *BasicUser `json:"user"` - State string `json:"state"` - CreatedAt *time.Time `json:"created_at"` +func (s *MergeRequestsService) GetMergeRequestParticipants(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*BasicUser, *Response, error) { + return do[[]*BasicUser](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/participants", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // GetMergeRequestReviewers gets a list of merge request reviewers. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-single-merge-request-reviewers -func (s *MergeRequestsService) GetMergeRequestReviewers(pid any, mergeRequest int, options ...RequestOptionFunc) ([]*MergeRequestReviewer, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/reviewers", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - var mrr []*MergeRequestReviewer - resp, err := s.client.Do(req, &mrr) - if err != nil { - return nil, resp, err - } - - return mrr, resp, nil +func (s *MergeRequestsService) GetMergeRequestReviewers(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*MergeRequestReviewer, *Response, error) { + return do[[]*MergeRequestReviewer](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/reviewers", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // ListMergeRequestPipelines gets all pipelines for the provided merge request. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#list-merge-request-pipelines -func (s *MergeRequestsService) ListMergeRequestPipelines(pid any, mergeRequest int, options ...RequestOptionFunc) ([]*PipelineInfo, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/pipelines", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - var p []*PipelineInfo - resp, err := s.client.Do(req, &p) - if err != nil { - return nil, resp, err - } - - return p, resp, nil +func (s *MergeRequestsService) ListMergeRequestPipelines(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*PipelineInfo, *Response, error) { + return do[[]*PipelineInfo](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/pipelines", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // CreateMergeRequestPipeline creates a new pipeline for a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#create-merge-request-pipeline -func (s *MergeRequestsService) CreateMergeRequestPipeline(pid any, mergeRequest int, options ...RequestOptionFunc) (*PipelineInfo, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/pipelines", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodPost, u, nil, options) - if err != nil { - return nil, nil, err - } - - p := new(PipelineInfo) - resp, err := s.client.Do(req, p) - if err != nil { - return nil, resp, err - } - - return p, resp, nil +func (s *MergeRequestsService) CreateMergeRequestPipeline(pid any, mergeRequest int64, options ...RequestOptionFunc) (*PipelineInfo, *Response, error) { + return do[*PipelineInfo](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/merge_requests/%d/pipelines", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // GetIssuesClosedOnMergeOptions represents the available GetIssuesClosedOnMerge() @@ -748,64 +628,43 @@ func (s *MergeRequestsService) CreateMergeRequestPipeline(pid any, mergeRequest // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#list-issues-that-close-on-merge -type GetIssuesClosedOnMergeOptions ListOptions +type GetIssuesClosedOnMergeOptions struct { + ListOptions +} // GetIssuesClosedOnMerge gets all the issues that would be closed by merging the // provided merge request. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#list-issues-that-close-on-merge -func (s *MergeRequestsService) GetIssuesClosedOnMerge(pid any, mergeRequest int, opt *GetIssuesClosedOnMergeOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/closes_issues", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var i []*Issue - resp, err := s.client.Do(req, &i) - if err != nil { - return nil, resp, err - } - - return i, resp, nil +func (s *MergeRequestsService) GetIssuesClosedOnMerge(pid any, mergeRequest int64, opt *GetIssuesClosedOnMergeOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { + return do[[]*Issue](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/closes_issues", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // ListRelatedIssuesOptions represents the available ListRelatedIssues() options. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#list-issues-related-to-the-merge-request -type ListRelatedIssuesOptions ListOptions +type ListRelatedIssuesOptions struct { + ListOptions +} // ListRelatedIssues gets all the issues related to provided merge request. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#list-issues-related-to-the-merge-request -func (s *MergeRequestsService) ListRelatedIssues(pid any, mergeRequest int, opt *ListRelatedIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - - u := fmt.Sprintf("projects/%s/merge_requests/%d/related_issues", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var i []*Issue - resp, err := s.client.Do(req, &i) - if err != nil { - return nil, resp, err - } - - return i, resp, nil +func (s *MergeRequestsService) ListRelatedIssues(pid any, mergeRequest int64, opt *ListRelatedIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { + return do[[]*Issue](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/related_issues", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // CreateMergeRequestOptions represents the available CreateMergeRequest() @@ -819,17 +678,17 @@ type CreateMergeRequestOptions struct { SourceBranch *string `url:"source_branch,omitempty" json:"source_branch,omitempty"` TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"` Labels *LabelOptions `url:"labels,comma,omitempty" json:"labels,omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - AssigneeIDs *[]int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"` - ReviewerIDs *[]int `url:"reviewer_ids,omitempty" json:"reviewer_ids,omitempty"` - TargetProjectID *int `url:"target_project_id,omitempty" json:"target_project_id,omitempty"` - MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` + AssigneeID *int64 `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + AssigneeIDs *[]int64 `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"` + ReviewerIDs *[]int64 `url:"reviewer_ids,omitempty" json:"reviewer_ids,omitempty"` + TargetProjectID *int64 `url:"target_project_id,omitempty" json:"target_project_id,omitempty"` + MilestoneID *int64 `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` RemoveSourceBranch *bool `url:"remove_source_branch,omitempty" json:"remove_source_branch,omitempty"` Squash *bool `url:"squash,omitempty" json:"squash,omitempty"` AllowCollaboration *bool `url:"allow_collaboration,omitempty" json:"allow_collaboration,omitempty"` // Deprecated: will be removed in v5 of the API, use the Merge Request Approvals API instead - ApprovalsBeforeMerge *int `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` + ApprovalsBeforeMerge *int64 `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` } // CreateMergeRequest creates a new merge request. @@ -837,24 +696,12 @@ type CreateMergeRequestOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#create-mr func (s *MergeRequestsService) CreateMergeRequest(pid any, opt *CreateMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests", PathEscape(project)) - - req, err := s.client.NewRequest(http.MethodPost, u, opt, options) - if err != nil { - return nil, nil, err - } - - m := new(MergeRequest) - resp, err := s.client.Do(req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil + return do[*MergeRequest](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/merge_requests", ProjectID{pid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // UpdateMergeRequestOptions represents the available UpdateMergeRequest() @@ -866,13 +713,13 @@ type UpdateMergeRequestOptions struct { Title *string `url:"title,omitempty" json:"title,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"` TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - AssigneeIDs *[]int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"` - ReviewerIDs *[]int `url:"reviewer_ids,omitempty" json:"reviewer_ids,omitempty"` + AssigneeID *int64 `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + AssigneeIDs *[]int64 `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"` + ReviewerIDs *[]int64 `url:"reviewer_ids,omitempty" json:"reviewer_ids,omitempty"` Labels *LabelOptions `url:"labels,comma,omitempty" json:"labels,omitempty"` AddLabels *LabelOptions `url:"add_labels,comma,omitempty" json:"add_labels,omitempty"` RemoveLabels *LabelOptions `url:"remove_labels,comma,omitempty" json:"remove_labels,omitempty"` - MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` + MilestoneID *int64 `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` StateEvent *string `url:"state_event,omitempty" json:"state_event,omitempty"` RemoveSourceBranch *bool `url:"remove_source_branch,omitempty" json:"remove_source_branch,omitempty"` Squash *bool `url:"squash,omitempty" json:"squash,omitempty"` @@ -884,44 +731,27 @@ type UpdateMergeRequestOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#update-mr -func (s *MergeRequestsService) UpdateMergeRequest(pid any, mergeRequest int, opt *UpdateMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, nil, err - } - - m := new(MergeRequest) - resp, err := s.client.Do(req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil +func (s *MergeRequestsService) UpdateMergeRequest(pid any, mergeRequest int64, opt *UpdateMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { + return do[*MergeRequest](s.client, + withMethod(http.MethodPut), + withPath("projects/%s/merge_requests/%d", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // DeleteMergeRequest deletes a merge request. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#delete-a-merge-request -func (s *MergeRequestsService) DeleteMergeRequest(pid any, mergeRequest int, options ...RequestOptionFunc) (*Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *MergeRequestsService) DeleteMergeRequest(pid any, mergeRequest int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("projects/%s/merge_requests/%d", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) + return resp, err } // AcceptMergeRequestOptions represents the available AcceptMergeRequest() @@ -948,25 +778,13 @@ type AcceptMergeRequestOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#merge-a-merge-request -func (s *MergeRequestsService) AcceptMergeRequest(pid any, mergeRequest int, opt *AcceptMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/merge", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, nil, err - } - - m := new(MergeRequest) - resp, err := s.client.Do(req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil +func (s *MergeRequestsService) AcceptMergeRequest(pid any, mergeRequest int64, opt *AcceptMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { + return do[*MergeRequest](s.client, + withMethod(http.MethodPut), + withPath("projects/%s/merge_requests/%d/merge", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // CancelMergeWhenPipelineSucceeds cancels a merge when pipeline succeeds. If @@ -977,25 +795,13 @@ func (s *MergeRequestsService) AcceptMergeRequest(pid any, mergeRequest int, opt // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#cancel-merge-when-pipeline-succeeds -func (s *MergeRequestsService) CancelMergeWhenPipelineSucceeds(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/cancel_merge_when_pipeline_succeeds", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodPost, u, nil, options) - if err != nil { - return nil, nil, err - } - - m := new(MergeRequest) - resp, err := s.client.Do(req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil +func (s *MergeRequestsService) CancelMergeWhenPipelineSucceeds(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { + return do[*MergeRequest](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/merge_requests/%d/cancel_merge_when_pipeline_succeeds", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // RebaseMergeRequestOptions represents the available RebaseMergeRequest() @@ -1013,19 +819,14 @@ type RebaseMergeRequestOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#rebase-a-merge-request -func (s *MergeRequestsService) RebaseMergeRequest(pid any, mergeRequest int, opt *RebaseMergeRequestOptions, options ...RequestOptionFunc) (*Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/rebase", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *MergeRequestsService) RebaseMergeRequest(pid any, mergeRequest int64, opt *RebaseMergeRequestOptions, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodPut), + withPath("projects/%s/merge_requests/%d/rebase", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), + ) + return resp, err } // GetMergeRequestDiffVersionsOptions represents the available @@ -1033,31 +834,21 @@ func (s *MergeRequestsService) RebaseMergeRequest(pid any, mergeRequest int, opt // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-merge-request-diff-versions -type GetMergeRequestDiffVersionsOptions ListOptions +type GetMergeRequestDiffVersionsOptions struct { + ListOptions +} // GetMergeRequestDiffVersions get a list of merge request diff versions. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-merge-request-diff-versions -func (s *MergeRequestsService) GetMergeRequestDiffVersions(pid any, mergeRequest int, opt *GetMergeRequestDiffVersionsOptions, options ...RequestOptionFunc) ([]*MergeRequestDiffVersion, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/versions", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var v []*MergeRequestDiffVersion - resp, err := s.client.Do(req, &v) - if err != nil { - return nil, resp, err - } - - return v, resp, nil +func (s *MergeRequestsService) GetMergeRequestDiffVersions(pid any, mergeRequest int64, opt *GetMergeRequestDiffVersionsOptions, options ...RequestOptionFunc) ([]*MergeRequestDiffVersion, *Response, error) { + return do[[]*MergeRequestDiffVersion](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/versions", ProjectID{pid}, mergeRequest), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // GetSingleMergeRequestDiffVersionOptions represents the available @@ -1073,25 +864,13 @@ type GetSingleMergeRequestDiffVersionOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-a-single-merge-request-diff-version -func (s *MergeRequestsService) GetSingleMergeRequestDiffVersion(pid any, mergeRequest, version int, opt *GetSingleMergeRequestDiffVersionOptions, options ...RequestOptionFunc) (*MergeRequestDiffVersion, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/versions/%d", PathEscape(project), mergeRequest, version) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - v := new(MergeRequestDiffVersion) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, nil +func (s *MergeRequestsService) GetSingleMergeRequestDiffVersion(pid any, mergeRequest, version int64, opt *GetSingleMergeRequestDiffVersionOptions, options ...RequestOptionFunc) (*MergeRequestDiffVersion, *Response, error) { + return do[*MergeRequestDiffVersion](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/versions/%d", ProjectID{pid}, mergeRequest, version), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // SubscribeToMergeRequest subscribes the authenticated user to the given merge @@ -1100,25 +879,13 @@ func (s *MergeRequestsService) GetSingleMergeRequestDiffVersion(pid any, mergeRe // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#subscribe-to-a-merge-request -func (s *MergeRequestsService) SubscribeToMergeRequest(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/subscribe", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodPost, u, nil, options) - if err != nil { - return nil, nil, err - } - - m := new(MergeRequest) - resp, err := s.client.Do(req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil +func (s *MergeRequestsService) SubscribeToMergeRequest(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { + return do[*MergeRequest](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/merge_requests/%d/subscribe", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // UnsubscribeFromMergeRequest unsubscribes the authenticated user from the @@ -1128,25 +895,13 @@ func (s *MergeRequestsService) SubscribeToMergeRequest(pid any, mergeRequest int // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#unsubscribe-from-a-merge-request -func (s *MergeRequestsService) UnsubscribeFromMergeRequest(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/unsubscribe", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodPost, u, nil, options) - if err != nil { - return nil, nil, err - } - - m := new(MergeRequest) - resp, err := s.client.Do(req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil +func (s *MergeRequestsService) UnsubscribeFromMergeRequest(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { + return do[*MergeRequest](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/merge_requests/%d/unsubscribe", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // CreateTodo manually creates a todo for the current user on a merge request. @@ -1155,32 +910,20 @@ func (s *MergeRequestsService) UnsubscribeFromMergeRequest(pid any, mergeRequest // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#create-a-to-do-item -func (s *MergeRequestsService) CreateTodo(pid any, mergeRequest int, options ...RequestOptionFunc) (*Todo, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/todo", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodPost, u, nil, options) - if err != nil { - return nil, nil, err - } - - t := new(Todo) - resp, err := s.client.Do(req, t) - if err != nil { - return nil, resp, err - } - - return t, resp, nil +func (s *MergeRequestsService) CreateTodo(pid any, mergeRequest int64, options ...RequestOptionFunc) (*Todo, *Response, error) { + return do[*Todo](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/merge_requests/%d/todo", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) } // SetTimeEstimate sets the time estimate for a single project merge request. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#set-a-time-estimate-for-a-merge-request -func (s *MergeRequestsService) SetTimeEstimate(pid any, mergeRequest int, opt *SetTimeEstimateOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *MergeRequestsService) SetTimeEstimate(pid any, mergeRequest int64, opt *SetTimeEstimateOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { return s.timeStats.setTimeEstimate(pid, "merge_requests", mergeRequest, opt, options...) } @@ -1188,7 +931,7 @@ func (s *MergeRequestsService) SetTimeEstimate(pid any, mergeRequest int, opt *S // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#reset-the-time-estimate-for-a-merge-request -func (s *MergeRequestsService) ResetTimeEstimate(pid any, mergeRequest int, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *MergeRequestsService) ResetTimeEstimate(pid any, mergeRequest int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) { return s.timeStats.resetTimeEstimate(pid, "merge_requests", mergeRequest, options...) } @@ -1196,7 +939,7 @@ func (s *MergeRequestsService) ResetTimeEstimate(pid any, mergeRequest int, opti // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#add-spent-time-for-a-merge-request -func (s *MergeRequestsService) AddSpentTime(pid any, mergeRequest int, opt *AddSpentTimeOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *MergeRequestsService) AddSpentTime(pid any, mergeRequest int64, opt *AddSpentTimeOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { return s.timeStats.addSpentTime(pid, "merge_requests", mergeRequest, opt, options...) } @@ -1204,7 +947,7 @@ func (s *MergeRequestsService) AddSpentTime(pid any, mergeRequest int, opt *AddS // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#reset-spent-time-for-a-merge-request -func (s *MergeRequestsService) ResetSpentTime(pid any, mergeRequest int, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *MergeRequestsService) ResetSpentTime(pid any, mergeRequest int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) { return s.timeStats.resetSpentTime(pid, "merge_requests", mergeRequest, options...) } @@ -1212,7 +955,7 @@ func (s *MergeRequestsService) ResetSpentTime(pid any, mergeRequest int, options // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-time-tracking-stats -func (s *MergeRequestsService) GetTimeSpent(pid any, mergeRequest int, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *MergeRequestsService) GetTimeSpent(pid any, mergeRequest int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) { return s.timeStats.getTimeSpent(pid, "merge_requests", mergeRequest, options...) } @@ -1221,9 +964,9 @@ func (s *MergeRequestsService) GetTimeSpent(pid any, mergeRequest int, options . // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#create-a-merge-request-dependency type MergeRequestDependency struct { - ID int `json:"id"` + ID int64 `json:"id"` BlockingMergeRequest BlockingMergeRequest `json:"blocking_merge_request"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` } // BlockingMergeRequest represents a GitLab merge request dependency. @@ -1231,23 +974,23 @@ type MergeRequestDependency struct { // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#create-a-merge-request-dependency type BlockingMergeRequest struct { - ID int `json:"id"` - Iid int `json:"iid"` + ID int64 `json:"id"` + Iid int64 `json:"iid"` TargetBranch string `json:"target_branch"` SourceBranch string `json:"source_branch"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Title string `json:"title"` State string `json:"state"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` - Upvotes int `json:"upvotes"` - Downvotes int `json:"downvotes"` + Upvotes int64 `json:"upvotes"` + Downvotes int64 `json:"downvotes"` Author *BasicUser `json:"author"` Assignee *BasicUser `json:"assignee"` Assignees []*BasicUser `json:"assignees"` Reviewers []*BasicUser `json:"reviewers"` - SourceProjectID int `json:"source_project_id"` - TargetProjectID int `json:"target_project_id"` + SourceProjectID int64 `json:"source_project_id"` + TargetProjectID int64 `json:"target_project_id"` Labels *LabelOptions `json:"labels"` Description string `json:"description"` Draft bool `json:"draft"` @@ -1260,7 +1003,7 @@ type BlockingMergeRequest struct { Sha string `json:"sha"` MergeCommitSha string `json:"merge_commit_sha"` SquashCommitSha string `json:"squash_commit_sha"` - UserNotesCount int `json:"user_notes_count"` + UserNotesCount int64 `json:"user_notes_count"` ShouldRemoveSourceBranch *bool `json:"should_remove_source_branch"` ForceRemoveSourceBranch bool `json:"force_remove_source_branch"` WebURL string `json:"web_url"` @@ -1285,7 +1028,7 @@ type BlockingMergeRequest struct { // Deprecated: will be removed in v5 of the API, use MergeUser instead MergedBy *BasicUser `json:"merged_by"` // Deprecated: will be removed in v5 of the API, use the Merge Request Approvals API instead - ApprovalsBeforeMerge *int `json:"approvals_before_merge"` + ApprovalsBeforeMerge *int64 `json:"approvals_before_merge"` // Deprecated: will be removed in v5 of the API, use References instead Reference string `json:"reference"` // Deprecated: in 15.6, use DetailedMergeStatus instead @@ -1302,7 +1045,7 @@ func (m MergeRequestDependency) String() string { // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#create-a-merge-request-dependency type CreateMergeRequestDependencyOptions struct { - BlockingMergeRequestID *int `url:"blocking_merge_request_id,omitempty" json:"blocking_merge_request_id,omitempty"` + BlockingMergeRequestID *int64 `url:"blocking_merge_request_id,omitempty" json:"blocking_merge_request_id,omitempty"` } // CreateMergeRequestDependency creates a new merge request dependency for a given @@ -1310,25 +1053,13 @@ type CreateMergeRequestDependencyOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#create-a-merge-request-dependency -func (s *MergeRequestsService) CreateMergeRequestDependency(pid any, mergeRequest int, opts CreateMergeRequestDependencyOptions, options ...RequestOptionFunc) (*MergeRequestDependency, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/blocks", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodPost, u, opts, options) - if err != nil { - return nil, nil, err - } - - var mrd MergeRequestDependency - resp, err := s.client.Do(req, &mrd) - if err != nil { - return nil, resp, err - } - - return &mrd, resp, err +func (s *MergeRequestsService) CreateMergeRequestDependency(pid any, mergeRequest int64, opts CreateMergeRequestDependencyOptions, options ...RequestOptionFunc) (*MergeRequestDependency, *Response, error) { + return do[*MergeRequestDependency](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/merge_requests/%d/blocks", ProjectID{pid}, mergeRequest), + withAPIOpts(opts), + withRequestOpts(options...), + ) } // DeleteMergeRequestDependency deletes a merge request dependency for a given @@ -1336,44 +1067,27 @@ func (s *MergeRequestsService) CreateMergeRequestDependency(pid any, mergeReques // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#delete-a-merge-request-dependency -func (s *MergeRequestsService) DeleteMergeRequestDependency(pid any, mergeRequest int, blockingMergeRequest int, options ...RequestOptionFunc) (*Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/blocks/%d", PathEscape(project), mergeRequest, blockingMergeRequest) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) +func (s *MergeRequestsService) DeleteMergeRequestDependency(pid any, mergeRequest int64, blockingMergeRequest int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("projects/%s/merge_requests/%d/blocks/%d", ProjectID{pid}, mergeRequest, blockingMergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) + return resp, err } // GetMergeRequestDependencies gets a list of merge request dependencies. // // GitLab API docs: // https://docs.gitlab.com/api/merge_requests/#get-merge-request-dependencies -func (s *MergeRequestsService) GetMergeRequestDependencies(pid any, mergeRequest int, options ...RequestOptionFunc) ([]MergeRequestDependency, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_requests/%d/blocks", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - var mrd []MergeRequestDependency - resp, err := s.client.Do(req, &mrd) - if err != nil { - return nil, resp, err - } - - return mrd, resp, err +func (s *MergeRequestsService) GetMergeRequestDependencies(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]MergeRequestDependency, *Response, error) { + return do[[]MergeRequestDependency](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_requests/%d/blocks", ProjectID{pid}, mergeRequest), + withAPIOpts(nil), + withRequestOpts(options...), + ) } func toBasic(mrs []*MergeRequest) []*BasicMergeRequest { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/merge_trains.go b/vendor/gitlab.com/gitlab-org/api/client-go/merge_trains.go index 89b37d33c..9d807fc3b 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/merge_trains.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/merge_trains.go @@ -1,7 +1,6 @@ package gitlab import ( - "fmt" "net/http" "time" ) @@ -10,8 +9,8 @@ type ( MergeTrainsServiceInterface interface { ListProjectMergeTrains(pid any, opt *ListMergeTrainsOptions, options ...RequestOptionFunc) ([]*MergeTrain, *Response, error) ListMergeRequestInMergeTrain(pid any, targetBranch string, opts *ListMergeTrainsOptions, options ...RequestOptionFunc) ([]*MergeTrain, *Response, error) - GetMergeRequestOnAMergeTrain(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeTrain, *Response, error) - AddMergeRequestToMergeTrain(pid any, mergeRequest int, opts *AddMergeRequestToMergeTrainOptions, options ...RequestOptionFunc) ([]*MergeTrain, *Response, error) + GetMergeRequestOnAMergeTrain(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeTrain, *Response, error) + AddMergeRequestToMergeTrain(pid any, mergeRequest int64, opts *AddMergeRequestToMergeTrainOptions, options ...RequestOptionFunc) ([]*MergeTrain, *Response, error) } // MergeTrainsService handles communication with the merge trains related @@ -29,7 +28,7 @@ var _ MergeTrainsServiceInterface = (*MergeTrainsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/merge_trains/ type MergeTrain struct { - ID int `json:"id"` + ID int64 `json:"id"` MergeRequest *MergeTrainMergeRequest `json:"merge_request"` User *BasicUser `json:"user"` Pipeline *Pipeline `json:"pipeline"` @@ -38,16 +37,16 @@ type MergeTrain struct { TargetBranch string `json:"target_branch"` Status string `json:"status"` MergedAt *time.Time `json:"merged_at"` - Duration int `json:"duration"` + Duration int64 `json:"duration"` } // MergeTrainMergeRequest represents a GitLab merge request inside merge train. // // GitLab API docs: https://docs.gitlab.com/api/merge_trains/ type MergeTrainMergeRequest struct { - ID int `json:"id"` - IID int `json:"iid"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + ProjectID int64 `json:"project_id"` Title string `json:"title"` Description string `json:"description"` State string `json:"state"` @@ -71,24 +70,12 @@ type ListMergeTrainsOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/merge_trains/#list-merge-trains-for-a-project func (s *MergeTrainsService) ListProjectMergeTrains(pid any, opt *ListMergeTrainsOptions, options ...RequestOptionFunc) ([]*MergeTrain, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_trains", PathEscape(project)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var mts []*MergeTrain - resp, err := s.client.Do(req, &mts) - if err != nil { - return nil, resp, err - } - - return mts, resp, nil + return do[[]*MergeTrain](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_trains", ProjectID{pid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) } // ListMergeRequestInMergeTrain gets a list of merge requests added to a merge @@ -97,24 +84,12 @@ func (s *MergeTrainsService) ListProjectMergeTrains(pid any, opt *ListMergeTrain // GitLab API docs: // https://docs.gitlab.com/api/merge_trains/#list-merge-requests-in-a-merge-train func (s *MergeTrainsService) ListMergeRequestInMergeTrain(pid any, targetBranch string, opts *ListMergeTrainsOptions, options ...RequestOptionFunc) ([]*MergeTrain, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_trains/%s", PathEscape(project), targetBranch) - - req, err := s.client.NewRequest(http.MethodGet, u, opts, options) - if err != nil { - return nil, nil, err - } - - var mts []*MergeTrain - resp, err := s.client.Do(req, &mts) - if err != nil { - return nil, resp, err - } - - return mts, resp, nil + return do[[]*MergeTrain](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/merge_trains/%s", ProjectID{pid}, targetBranch), + withAPIOpts(opts), + withRequestOpts(options...), + ) } // GetMergeRequestOnAMergeTrain Get merge train information for the requested @@ -122,25 +97,11 @@ func (s *MergeTrainsService) ListMergeRequestInMergeTrain(pid any, targetBranch // // GitLab API docs: // https://docs.gitlab.com/api/merge_trains/#get-the-status-of-a-merge-request-on-a-merge-train -func (s *MergeTrainsService) GetMergeRequestOnAMergeTrain(pid any, mergeRequest int, options ...RequestOptionFunc) (*MergeTrain, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_trains/merge_requests/%d", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - mt := new(MergeTrain) - resp, err := s.client.Do(req, mt) - if err != nil { - return nil, resp, err - } - - return mt, resp, nil +func (s *MergeTrainsService) GetMergeRequestOnAMergeTrain(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeTrain, *Response, error) { + return do[*MergeTrain](s.client, + withPath("projects/%s/merge_trains/merge_requests/%d", ProjectID{pid}, mergeRequest), + withRequestOpts(options...), + ) } // AddMergeRequestToMergeTrainOptions represents the available @@ -162,23 +123,11 @@ type AddMergeRequestToMergeTrainOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_trains/#add-a-merge-request-to-a-merge-train -func (s *MergeTrainsService) AddMergeRequestToMergeTrain(pid any, mergeRequest int, opts *AddMergeRequestToMergeTrainOptions, options ...RequestOptionFunc) ([]*MergeTrain, *Response, error) { - project, err := parseID(pid) - if err != nil { - return nil, nil, err - } - u := fmt.Sprintf("projects/%s/merge_trains/merge_requests/%d", PathEscape(project), mergeRequest) - - req, err := s.client.NewRequest(http.MethodPost, u, opts, options) - if err != nil { - return nil, nil, err - } - - var mts []*MergeTrain - resp, err := s.client.Do(req, &mts) - if err != nil { - return nil, resp, err - } - - return mts, resp, nil +func (s *MergeTrainsService) AddMergeRequestToMergeTrain(pid any, mergeRequest int64, opts *AddMergeRequestToMergeTrainOptions, options ...RequestOptionFunc) ([]*MergeTrain, *Response, error) { + return do[[]*MergeTrain](s.client, + withMethod(http.MethodPost), + withPath("projects/%s/merge_trains/merge_requests/%d", ProjectID{pid}, mergeRequest), + withAPIOpts(opts), + withRequestOpts(options...), + ) } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/metadata.go b/vendor/gitlab.com/gitlab-org/api/client-go/metadata.go index 0a702f8e3..5c9f7170f 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/metadata.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/metadata.go @@ -38,21 +38,30 @@ var _ MetadataServiceInterface = (*MetadataService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/metadata/ type Metadata struct { - Version string `json:"version"` - Revision string `json:"revision"` - KAS struct { - Enabled bool `json:"enabled"` - ExternalURL string `json:"externalUrl"` - ExternalK8SProxyURL string `json:"externalK8sProxyUrl"` - Version string `json:"version"` - } `json:"kas"` - Enterprise bool `json:"enterprise"` + Version string `json:"version"` + Revision string `json:"revision"` + KAS MetadataKAS `json:"kas"` + Enterprise bool `json:"enterprise"` } func (s Metadata) String() string { return Stringify(s) } +// MetadataKAS represents a GitLab instance version metadata KAS. +// +// GitLab API docs: https://docs.gitlab.com/api/metadata/ +type MetadataKAS struct { + Enabled bool `json:"enabled"` + ExternalURL string `json:"externalUrl"` + ExternalK8SProxyURL string `json:"externalK8sProxyUrl"` + Version string `json:"version"` +} + +func (k MetadataKAS) String() string { + return Stringify(k) +} + // GetMetadata gets a GitLab server instance meteadata. // // GitLab API docs: https://docs.gitlab.com/api/metadata/ diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/milestones.go b/vendor/gitlab.com/gitlab-org/api/client-go/milestones.go index 3bcf0657b..024101efa 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/milestones.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/milestones.go @@ -25,12 +25,12 @@ import ( type ( MilestonesServiceInterface interface { ListMilestones(pid any, opt *ListMilestonesOptions, options ...RequestOptionFunc) ([]*Milestone, *Response, error) - GetMilestone(pid any, milestone int, options ...RequestOptionFunc) (*Milestone, *Response, error) + GetMilestone(pid any, milestone int64, options ...RequestOptionFunc) (*Milestone, *Response, error) CreateMilestone(pid any, opt *CreateMilestoneOptions, options ...RequestOptionFunc) (*Milestone, *Response, error) - UpdateMilestone(pid any, milestone int, opt *UpdateMilestoneOptions, options ...RequestOptionFunc) (*Milestone, *Response, error) - DeleteMilestone(pid any, milestone int, options ...RequestOptionFunc) (*Response, error) - GetMilestoneIssues(pid any, milestone int, opt *GetMilestoneIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) - GetMilestoneMergeRequests(pid any, milestone int, opt *GetMilestoneMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) + UpdateMilestone(pid any, milestone int64, opt *UpdateMilestoneOptions, options ...RequestOptionFunc) (*Milestone, *Response, error) + DeleteMilestone(pid any, milestone int64, options ...RequestOptionFunc) (*Response, error) + GetMilestoneIssues(pid any, milestone int64, opt *GetMilestoneIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) + GetMilestoneMergeRequests(pid any, milestone int64, opt *GetMilestoneMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) } // MilestonesService handles communication with the milestone related methods @@ -48,10 +48,10 @@ var _ MilestonesServiceInterface = (*MilestonesService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/milestones/ type Milestone struct { - ID int `json:"id"` - IID int `json:"iid"` - GroupID int `json:"group_id"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + GroupID int64 `json:"group_id"` + ProjectID int64 `json:"project_id"` Title string `json:"title"` Description string `json:"description"` StartDate *ISOTime `json:"start_date"` @@ -73,11 +73,11 @@ func (m Milestone) String() string { // https://docs.gitlab.com/api/milestones/#list-project-milestones type ListMilestonesOptions struct { ListOptions - IIDs *[]int `url:"iids[],omitempty" json:"iids,omitempty"` - Title *string `url:"title,omitempty" json:"title,omitempty"` - State *string `url:"state,omitempty" json:"state,omitempty"` - Search *string `url:"search,omitempty" json:"search,omitempty"` - IncludeAncestors *bool `url:"include_ancestors,omitempty" json:"include_ancestors,omitempty"` + IIDs *[]int64 `url:"iids[],omitempty" json:"iids,omitempty"` + Title *string `url:"title,omitempty" json:"title,omitempty"` + State *string `url:"state,omitempty" json:"state,omitempty"` + Search *string `url:"search,omitempty" json:"search,omitempty"` + IncludeAncestors *bool `url:"include_ancestors,omitempty" json:"include_ancestors,omitempty"` // Deprecated: in GitLab 16,7, use IncludeAncestors instead IncludeParentMilestones *bool `url:"include_parent_milestones,omitempty" json:"include_parent_milestones,omitempty"` @@ -112,7 +112,7 @@ func (s *MilestonesService) ListMilestones(pid any, opt *ListMilestonesOptions, // // GitLab API docs: // https://docs.gitlab.com/api/milestones/#get-single-milestone -func (s *MilestonesService) GetMilestone(pid any, milestone int, options ...RequestOptionFunc) (*Milestone, *Response, error) { +func (s *MilestonesService) GetMilestone(pid any, milestone int64, options ...RequestOptionFunc) (*Milestone, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -185,7 +185,7 @@ type UpdateMilestoneOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/milestones/#edit-milestone -func (s *MilestonesService) UpdateMilestone(pid any, milestone int, opt *UpdateMilestoneOptions, options ...RequestOptionFunc) (*Milestone, *Response, error) { +func (s *MilestonesService) UpdateMilestone(pid any, milestone int64, opt *UpdateMilestoneOptions, options ...RequestOptionFunc) (*Milestone, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -210,7 +210,7 @@ func (s *MilestonesService) UpdateMilestone(pid any, milestone int, opt *UpdateM // // GitLab API docs: // https://docs.gitlab.com/api/milestones/#delete-project-milestone -func (s *MilestonesService) DeleteMilestone(pid any, milestone int, options ...RequestOptionFunc) (*Response, error) { +func (s *MilestonesService) DeleteMilestone(pid any, milestone int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -228,13 +228,15 @@ func (s *MilestonesService) DeleteMilestone(pid any, milestone int, options ...R // // GitLab API docs: // https://docs.gitlab.com/api/milestones/#get-all-issues-assigned-to-a-single-milestone -type GetMilestoneIssuesOptions ListOptions +type GetMilestoneIssuesOptions struct { + ListOptions +} // GetMilestoneIssues gets all issues assigned to a single project milestone. // // GitLab API docs: // https://docs.gitlab.com/api/milestones/#get-all-issues-assigned-to-a-single-milestone -func (s *MilestonesService) GetMilestoneIssues(pid any, milestone int, opt *GetMilestoneIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { +func (s *MilestonesService) GetMilestoneIssues(pid any, milestone int64, opt *GetMilestoneIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -260,14 +262,16 @@ func (s *MilestonesService) GetMilestoneIssues(pid any, milestone int, opt *GetM // // GitLab API docs: // https://docs.gitlab.com/api/milestones/#get-all-merge-requests-assigned-to-a-single-milestone -type GetMilestoneMergeRequestsOptions ListOptions +type GetMilestoneMergeRequestsOptions struct { + ListOptions +} // GetMilestoneMergeRequests gets all merge requests assigned to a single // project milestone. // // GitLab API docs: // https://docs.gitlab.com/api/milestones/#get-all-merge-requests-assigned-to-a-single-milestone -func (s *MilestonesService) GetMilestoneMergeRequests(pid any, milestone int, opt *GetMilestoneMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { +func (s *MilestonesService) GetMilestoneMergeRequests(pid any, milestone int64, opt *GetMilestoneMergeRequestsOptions, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/namespaces.go b/vendor/gitlab.com/gitlab-org/api/client-go/namespaces.go index b4768551c..c69f6a1de 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/namespaces.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/namespaces.go @@ -44,21 +44,21 @@ var _ NamespacesServiceInterface = (*NamespacesService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/namespaces/ type Namespace struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Path string `json:"path"` Kind string `json:"kind"` FullPath string `json:"full_path"` - ParentID int `json:"parent_id"` + ParentID int64 `json:"parent_id"` AvatarURL *string `json:"avatar_url"` WebURL string `json:"web_url"` - MembersCountWithDescendants int `json:"members_count_with_descendants"` - BillableMembersCount int `json:"billable_members_count"` + MembersCountWithDescendants int64 `json:"members_count_with_descendants"` + BillableMembersCount int64 `json:"billable_members_count"` Plan string `json:"plan"` TrialEndsOn *ISOTime `json:"trial_ends_on"` Trial bool `json:"trial"` - MaxSeatsUsed *int `json:"max_seats_used"` - SeatsInUse *int `json:"seats_in_use"` + MaxSeatsUsed *int64 `json:"max_seats_used"` + SeatsInUse *int64 `json:"seats_in_use"` } func (n Namespace) String() string { @@ -157,7 +157,7 @@ type NamespaceExistance struct { // GitLab API docs: // https://docs.gitlab.com/api/namespaces/#verify-namespace-availability type NamespaceExistsOptions struct { - ParentID *int `url:"parent_id,omitempty" json:"parent_id,omitempty"` + ParentID *int64 `url:"parent_id,omitempty" json:"parent_id,omitempty"` } // NamespaceExists checks the existence of a namespace. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/notes.go b/vendor/gitlab.com/gitlab-org/api/client-go/notes.go index b54b95019..1dc084997 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/notes.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/notes.go @@ -24,26 +24,26 @@ import ( type ( NotesServiceInterface interface { - ListIssueNotes(pid any, issue int, opt *ListIssueNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) - GetIssueNote(pid any, issue, note int, options ...RequestOptionFunc) (*Note, *Response, error) - CreateIssueNote(pid any, issue int, opt *CreateIssueNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - UpdateIssueNote(pid any, issue, note int, opt *UpdateIssueNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - DeleteIssueNote(pid any, issue, note int, options ...RequestOptionFunc) (*Response, error) - ListSnippetNotes(pid any, snippet int, opt *ListSnippetNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) - GetSnippetNote(pid any, snippet, note int, options ...RequestOptionFunc) (*Note, *Response, error) - CreateSnippetNote(pid any, snippet int, opt *CreateSnippetNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - UpdateSnippetNote(pid any, snippet, note int, opt *UpdateSnippetNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - DeleteSnippetNote(pid any, snippet, note int, options ...RequestOptionFunc) (*Response, error) - ListMergeRequestNotes(pid any, mergeRequest int, opt *ListMergeRequestNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) - GetMergeRequestNote(pid any, mergeRequest, note int, options ...RequestOptionFunc) (*Note, *Response, error) - CreateMergeRequestNote(pid any, mergeRequest int, opt *CreateMergeRequestNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - UpdateMergeRequestNote(pid any, mergeRequest, note int, opt *UpdateMergeRequestNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - DeleteMergeRequestNote(pid any, mergeRequest, note int, options ...RequestOptionFunc) (*Response, error) - ListEpicNotes(gid any, epic int, opt *ListEpicNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) - GetEpicNote(gid any, epic, note int, options ...RequestOptionFunc) (*Note, *Response, error) - CreateEpicNote(gid any, epic int, opt *CreateEpicNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - UpdateEpicNote(gid any, epic, note int, opt *UpdateEpicNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - DeleteEpicNote(gid any, epic, note int, options ...RequestOptionFunc) (*Response, error) + ListIssueNotes(pid any, issue int64, opt *ListIssueNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) + GetIssueNote(pid any, issue, note int64, options ...RequestOptionFunc) (*Note, *Response, error) + CreateIssueNote(pid any, issue int64, opt *CreateIssueNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateIssueNote(pid any, issue, note int64, opt *UpdateIssueNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + DeleteIssueNote(pid any, issue, note int64, options ...RequestOptionFunc) (*Response, error) + ListSnippetNotes(pid any, snippet int64, opt *ListSnippetNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) + GetSnippetNote(pid any, snippet, note int64, options ...RequestOptionFunc) (*Note, *Response, error) + CreateSnippetNote(pid any, snippet int64, opt *CreateSnippetNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateSnippetNote(pid any, snippet, note int64, opt *UpdateSnippetNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + DeleteSnippetNote(pid any, snippet, note int64, options ...RequestOptionFunc) (*Response, error) + ListMergeRequestNotes(pid any, mergeRequest int64, opt *ListMergeRequestNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) + GetMergeRequestNote(pid any, mergeRequest, note int64, options ...RequestOptionFunc) (*Note, *Response, error) + CreateMergeRequestNote(pid any, mergeRequest int64, opt *CreateMergeRequestNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateMergeRequestNote(pid any, mergeRequest, note int64, opt *UpdateMergeRequestNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + DeleteMergeRequestNote(pid any, mergeRequest, note int64, options ...RequestOptionFunc) (*Response, error) + ListEpicNotes(gid any, epic int64, opt *ListEpicNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) + GetEpicNote(gid any, epic, note int64, options ...RequestOptionFunc) (*Note, *Response, error) + CreateEpicNote(gid any, epic int64, opt *CreateEpicNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateEpicNote(gid any, epic, note int64, opt *UpdateEpicNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + DeleteEpicNote(gid any, epic, note int64, options ...RequestOptionFunc) (*Response, error) } // NotesService handles communication with the notes related methods @@ -63,44 +63,50 @@ var _ NotesServiceInterface = (*NotesService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/notes/ type Note struct { - ID int `json:"id"` - Type NoteTypeValue `json:"type"` - Body string `json:"body"` - Attachment string `json:"attachment"` - Title string `json:"title"` - FileName string `json:"file_name"` - Author NoteAuthor `json:"author"` - System bool `json:"system"` - CreatedAt *time.Time `json:"created_at"` - UpdatedAt *time.Time `json:"updated_at"` - ExpiresAt *time.Time `json:"expires_at"` - CommitID string `json:"commit_id"` - Position *NotePosition `json:"position"` - NoteableID int `json:"noteable_id"` - NoteableType string `json:"noteable_type"` - ProjectID int `json:"project_id"` - NoteableIID int `json:"noteable_iid"` - Resolvable bool `json:"resolvable"` - Resolved bool `json:"resolved"` - ResolvedAt *time.Time `json:"resolved_at"` - ResolvedBy struct { - ID int `json:"id"` - Username string `json:"username"` - Email string `json:"email"` - Name string `json:"name"` - State string `json:"state"` - AvatarURL string `json:"avatar_url"` - WebURL string `json:"web_url"` - } `json:"resolved_by"` - Internal bool `json:"internal"` + ID int64 `json:"id"` + Type NoteTypeValue `json:"type"` + Body string `json:"body"` + Attachment string `json:"attachment"` + Title string `json:"title"` + FileName string `json:"file_name"` + Author NoteAuthor `json:"author"` + System bool `json:"system"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` + ExpiresAt *time.Time `json:"expires_at"` + CommitID string `json:"commit_id"` + Position *NotePosition `json:"position"` + NoteableID int64 `json:"noteable_id"` + NoteableType string `json:"noteable_type"` + ProjectID int64 `json:"project_id"` + NoteableIID int64 `json:"noteable_iid"` + Resolvable bool `json:"resolvable"` + Resolved bool `json:"resolved"` + ResolvedAt *time.Time `json:"resolved_at"` + ResolvedBy NoteResolvedBy `json:"resolved_by"` + Internal bool `json:"internal"` // Deprecated: use Internal instead Confidential bool `json:"confidential"` } +// NoteResolvedBy represents the resolver of a GitLab note. +// +// GitLab API docs: +// https://docs.gitlab.com/api/notes/ +type NoteResolvedBy struct { + ID int64 `json:"id"` + Username string `json:"username"` + Email string `json:"email"` + Name string `json:"name"` + State string `json:"state"` + AvatarURL string `json:"avatar_url"` + WebURL string `json:"web_url"` +} + // NoteAuthor represents the author of a note. type NoteAuthor struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Email string `json:"email"` Name string `json:"name"` @@ -116,9 +122,9 @@ type NotePosition struct { HeadSHA string `json:"head_sha"` PositionType string `json:"position_type"` NewPath string `json:"new_path,omitempty"` - NewLine int `json:"new_line,omitempty"` + NewLine int64 `json:"new_line,omitempty"` OldPath string `json:"old_path,omitempty"` - OldLine int `json:"old_line,omitempty"` + OldLine int64 `json:"old_line,omitempty"` LineRange *LineRange `json:"line_range,omitempty"` } @@ -132,8 +138,8 @@ type LineRange struct { type LinePosition struct { LineCode string `json:"line_code"` Type string `json:"type"` - OldLine int `json:"old_line"` - NewLine int `json:"new_line"` + OldLine int64 `json:"old_line"` + NewLine int64 `json:"new_line"` } func (n Note) String() string { @@ -154,7 +160,7 @@ type ListIssueNotesOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#list-project-issue-notes -func (s *NotesService) ListIssueNotes(pid any, issue int, opt *ListIssueNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) { +func (s *NotesService) ListIssueNotes(pid any, issue int64, opt *ListIssueNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -179,7 +185,7 @@ func (s *NotesService) ListIssueNotes(pid any, issue int, opt *ListIssueNotesOpt // // GitLab API docs: // https://docs.gitlab.com/api/notes/#get-single-issue-note -func (s *NotesService) GetIssueNote(pid any, issue, note int, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) GetIssueNote(pid any, issue, note int64, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -215,7 +221,7 @@ type CreateIssueNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#create-new-issue-note -func (s *NotesService) CreateIssueNote(pid any, issue int, opt *CreateIssueNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) CreateIssueNote(pid any, issue int64, opt *CreateIssueNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -249,7 +255,7 @@ type UpdateIssueNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#modify-existing-issue-note -func (s *NotesService) UpdateIssueNote(pid any, issue, note int, opt *UpdateIssueNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) UpdateIssueNote(pid any, issue, note int64, opt *UpdateIssueNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -274,7 +280,7 @@ func (s *NotesService) UpdateIssueNote(pid any, issue, note int, opt *UpdateIssu // // GitLab API docs: // https://docs.gitlab.com/api/notes/#delete-an-issue-note -func (s *NotesService) DeleteIssueNote(pid any, issue, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *NotesService) DeleteIssueNote(pid any, issue, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -304,7 +310,7 @@ type ListSnippetNotesOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#list-all-snippet-notes -func (s *NotesService) ListSnippetNotes(pid any, snippet int, opt *ListSnippetNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) { +func (s *NotesService) ListSnippetNotes(pid any, snippet int64, opt *ListSnippetNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -329,7 +335,7 @@ func (s *NotesService) ListSnippetNotes(pid any, snippet int, opt *ListSnippetNo // // GitLab API docs: // https://docs.gitlab.com/api/notes/#get-single-snippet-note -func (s *NotesService) GetSnippetNote(pid any, snippet, note int, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) GetSnippetNote(pid any, snippet, note int64, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -365,7 +371,7 @@ type CreateSnippetNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#create-new-snippet-note -func (s *NotesService) CreateSnippetNote(pid any, snippet int, opt *CreateSnippetNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) CreateSnippetNote(pid any, snippet int64, opt *CreateSnippetNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -399,7 +405,7 @@ type UpdateSnippetNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#modify-existing-snippet-note -func (s *NotesService) UpdateSnippetNote(pid any, snippet, note int, opt *UpdateSnippetNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) UpdateSnippetNote(pid any, snippet, note int64, opt *UpdateSnippetNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -424,7 +430,7 @@ func (s *NotesService) UpdateSnippetNote(pid any, snippet, note int, opt *Update // // GitLab API docs: // https://docs.gitlab.com/api/notes/#delete-a-snippet-note -func (s *NotesService) DeleteSnippetNote(pid any, snippet, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *NotesService) DeleteSnippetNote(pid any, snippet, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -454,7 +460,7 @@ type ListMergeRequestNotesOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#list-all-merge-request-notes -func (s *NotesService) ListMergeRequestNotes(pid any, mergeRequest int, opt *ListMergeRequestNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) { +func (s *NotesService) ListMergeRequestNotes(pid any, mergeRequest int64, opt *ListMergeRequestNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -479,7 +485,7 @@ func (s *NotesService) ListMergeRequestNotes(pid any, mergeRequest int, opt *Lis // // GitLab API docs: // https://docs.gitlab.com/api/notes/#get-single-merge-request-note -func (s *NotesService) GetMergeRequestNote(pid any, mergeRequest, note int, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) GetMergeRequestNote(pid any, mergeRequest, note int64, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -516,7 +522,7 @@ type CreateMergeRequestNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#create-new-merge-request-note -func (s *NotesService) CreateMergeRequestNote(pid any, mergeRequest int, opt *CreateMergeRequestNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) CreateMergeRequestNote(pid any, mergeRequest int64, opt *CreateMergeRequestNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -550,7 +556,7 @@ type UpdateMergeRequestNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#modify-existing-merge-request-note -func (s *NotesService) UpdateMergeRequestNote(pid any, mergeRequest, note int, opt *UpdateMergeRequestNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) UpdateMergeRequestNote(pid any, mergeRequest, note int64, opt *UpdateMergeRequestNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -575,7 +581,7 @@ func (s *NotesService) UpdateMergeRequestNote(pid any, mergeRequest, note int, o // // GitLab API docs: // https://docs.gitlab.com/api/notes/#delete-a-merge-request-note -func (s *NotesService) DeleteMergeRequestNote(pid any, mergeRequest, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *NotesService) DeleteMergeRequestNote(pid any, mergeRequest, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -607,7 +613,7 @@ type ListEpicNotesOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#list-all-epic-notes -func (s *NotesService) ListEpicNotes(gid any, epic int, opt *ListEpicNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) { +func (s *NotesService) ListEpicNotes(gid any, epic int64, opt *ListEpicNotesOptions, options ...RequestOptionFunc) ([]*Note, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -633,7 +639,7 @@ func (s *NotesService) ListEpicNotes(gid any, epic int, opt *ListEpicNotesOption // // GitLab API docs: // https://docs.gitlab.com/api/notes/#get-single-epic-note -func (s *NotesService) GetEpicNote(gid any, epic, note int, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) GetEpicNote(gid any, epic, note int64, options ...RequestOptionFunc) (*Note, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -668,7 +674,7 @@ type CreateEpicNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/notes/#create-new-epic-note -func (s *NotesService) CreateEpicNote(gid any, epic int, opt *CreateEpicNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) CreateEpicNote(gid any, epic int64, opt *CreateEpicNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -702,7 +708,7 @@ type UpdateEpicNoteOptions struct { // Will be removed in v5 of the API, use Work Items API instead // // https://docs.gitlab.com/api/notes/#modify-existing-epic-note -func (s *NotesService) UpdateEpicNote(gid any, epic, note int, opt *UpdateEpicNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { +func (s *NotesService) UpdateEpicNote(gid any, epic, note int64, opt *UpdateEpicNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -727,7 +733,7 @@ func (s *NotesService) UpdateEpicNote(gid any, epic, note int, opt *UpdateEpicNo // Will be removed in v5 of the API, use Work Items API instead // // https://docs.gitlab.com/api/notes/#delete-an-epic-note -func (s *NotesService) DeleteEpicNote(gid any, epic, note int, options ...RequestOptionFunc) (*Response, error) { +func (s *NotesService) DeleteEpicNote(gid any, epic, note int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/packages.go b/vendor/gitlab.com/gitlab-org/api/client-go/packages.go index f9f3b59af..7a08072f3 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/packages.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/packages.go @@ -26,9 +26,9 @@ type ( PackagesServiceInterface interface { ListProjectPackages(pid any, opt *ListProjectPackagesOptions, options ...RequestOptionFunc) ([]*Package, *Response, error) ListGroupPackages(gid any, opt *ListGroupPackagesOptions, options ...RequestOptionFunc) ([]*GroupPackage, *Response, error) - ListPackageFiles(pid any, pkg int, opt *ListPackageFilesOptions, options ...RequestOptionFunc) ([]*PackageFile, *Response, error) - DeleteProjectPackage(pid any, pkg int, options ...RequestOptionFunc) (*Response, error) - DeletePackageFile(pid any, pkg, file int, options ...RequestOptionFunc) (*Response, error) + ListPackageFiles(pid any, pkg int64, opt *ListPackageFilesOptions, options ...RequestOptionFunc) ([]*PackageFile, *Response, error) + DeleteProjectPackage(pid any, pkg int64, options ...RequestOptionFunc) (*Response, error) + DeletePackageFile(pid any, pkg, file int64, options ...RequestOptionFunc) (*Response, error) } // PackagesService handles communication with the packages related methods @@ -46,7 +46,7 @@ var _ PackagesServiceInterface = (*PackagesService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/packages/ type Package struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Version string `json:"version"` PackageType string `json:"package_type"` @@ -66,7 +66,7 @@ func (s Package) String() string { // GitLab API docs: https://docs.gitlab.com/api/packages/ type GroupPackage struct { Package - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` ProjectPath string `json:"project_path"` } @@ -86,8 +86,8 @@ func (s PackageLinks) String() string { // PackageTag holds label information about the package type PackageTag struct { - ID int `json:"id"` - PackageID int `json:"package_id"` + ID int64 `json:"id"` + PackageID int64 `json:"package_id"` Name string `json:"name"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` @@ -101,11 +101,11 @@ func (s PackageTag) String() string { // // GitLab API docs: https://docs.gitlab.com/api/packages/ type PackageFile struct { - ID int `json:"id"` - PackageID int `json:"package_id"` + ID int64 `json:"id"` + PackageID int64 `json:"package_id"` CreatedAt *time.Time `json:"created_at"` FileName string `json:"file_name"` - Size int `json:"size"` + Size int64 `json:"size"` FileMD5 string `json:"file_md5"` FileSHA1 string `json:"file_sha1"` FileSHA256 string `json:"file_sha256"` @@ -203,13 +203,15 @@ func (s *PackagesService) ListGroupPackages(gid any, opt *ListGroupPackagesOptio // // GitLab API docs: // https://docs.gitlab.com/api/packages/#list-package-files -type ListPackageFilesOptions ListOptions +type ListPackageFilesOptions struct { + ListOptions +} // ListPackageFiles gets a list of files that are within a package // // GitLab API docs: // https://docs.gitlab.com/api/packages/#list-package-files -func (s *PackagesService) ListPackageFiles(pid any, pkg int, opt *ListPackageFilesOptions, options ...RequestOptionFunc) ([]*PackageFile, *Response, error) { +func (s *PackagesService) ListPackageFiles(pid any, pkg int64, opt *ListPackageFilesOptions, options ...RequestOptionFunc) ([]*PackageFile, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -238,7 +240,7 @@ func (s *PackagesService) ListPackageFiles(pid any, pkg int, opt *ListPackageFil // // GitLab API docs: // https://docs.gitlab.com/api/packages/#delete-a-project-package -func (s *PackagesService) DeleteProjectPackage(pid any, pkg int, options ...RequestOptionFunc) (*Response, error) { +func (s *PackagesService) DeleteProjectPackage(pid any, pkg int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -257,7 +259,7 @@ func (s *PackagesService) DeleteProjectPackage(pid any, pkg int, options ...Requ // // GitLab API docs: // https://docs.gitlab.com/api/packages/#delete-a-package-file -func (s *PackagesService) DeletePackageFile(pid any, pkg, file int, options ...RequestOptionFunc) (*Response, error) { +func (s *PackagesService) DeletePackageFile(pid any, pkg, file int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/pages_domains.go b/vendor/gitlab.com/gitlab-org/api/client-go/pages_domains.go index de18e4830..6d18c5f8d 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/pages_domains.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/pages_domains.go @@ -47,27 +47,34 @@ var _ PagesDomainsServiceInterface = (*PagesDomainsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/pages_domains/ type PagesDomain struct { - Domain string `json:"domain"` - AutoSslEnabled bool `json:"auto_ssl_enabled"` - URL string `json:"url"` - ProjectID int `json:"project_id"` - Verified bool `json:"verified"` - VerificationCode string `json:"verification_code"` - EnabledUntil *time.Time `json:"enabled_until"` - Certificate struct { - Subject string `json:"subject"` - Expired bool `json:"expired"` - Expiration *time.Time `json:"expiration"` - Certificate string `json:"certificate"` - CertificateText string `json:"certificate_text"` - } `json:"certificate"` + Domain string `json:"domain"` + AutoSslEnabled bool `json:"auto_ssl_enabled"` + URL string `json:"url"` + ProjectID int64 `json:"project_id"` + Verified bool `json:"verified"` + VerificationCode string `json:"verification_code"` + EnabledUntil *time.Time `json:"enabled_until"` + Certificate PagesDomainCertificate `json:"certificate"` +} + +// PagesDomainCertificate represents a pages domain certificate. +// +// GitLab API docs: https://docs.gitlab.com/api/pages_domains/ +type PagesDomainCertificate struct { + Subject string `json:"subject"` + Expired bool `json:"expired"` + Expiration *time.Time `json:"expiration"` + Certificate string `json:"certificate"` + CertificateText string `json:"certificate_text"` } // ListPagesDomainsOptions represents the available ListPagesDomains() options. // // GitLab API docs: // https://docs.gitlab.com/api/pages_domains/#list-pages-domains -type ListPagesDomainsOptions ListOptions +type ListPagesDomainsOptions struct { + ListOptions +} // ListPagesDomains gets a list of project pages domains. // diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/personal_access_tokens.go b/vendor/gitlab.com/gitlab-org/api/client-go/personal_access_tokens.go index 9dcbe6872..c87fd3426 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/personal_access_tokens.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/personal_access_tokens.go @@ -25,13 +25,14 @@ import ( type ( PersonalAccessTokensServiceInterface interface { ListPersonalAccessTokens(opt *ListPersonalAccessTokensOptions, options ...RequestOptionFunc) ([]*PersonalAccessToken, *Response, error) - GetSinglePersonalAccessTokenByID(token int, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) + GetSinglePersonalAccessTokenByID(token int64, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) GetSinglePersonalAccessToken(options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) - RotatePersonalAccessToken(token int, opt *RotatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) - RotatePersonalAccessTokenByID(token int, opt *RotatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) + RotatePersonalAccessToken(token int64, opt *RotatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) + RotatePersonalAccessTokenByID(token int64, opt *RotatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) RotatePersonalAccessTokenSelf(opt *RotatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) - RevokePersonalAccessToken(token int, options ...RequestOptionFunc) (*Response, error) - RevokePersonalAccessTokenByID(token int, options ...RequestOptionFunc) (*Response, error) + // Deprecated: to be removed in 2.0; use RevokePersonalAccessTokenByID instead + RevokePersonalAccessToken(token int64, options ...RequestOptionFunc) (*Response, error) + RevokePersonalAccessTokenByID(token int64, options ...RequestOptionFunc) (*Response, error) RevokePersonalAccessTokenSelf(options ...RequestOptionFunc) (*Response, error) } @@ -50,13 +51,13 @@ var _ PersonalAccessTokensServiceInterface = (*PersonalAccessTokensService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/personal_access_tokens/ type PersonalAccessToken struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Revoked bool `json:"revoked"` CreatedAt *time.Time `json:"created_at"` Description string `json:"description"` Scopes []string `json:"scopes"` - UserID int `json:"user_id"` + UserID int64 `json:"user_id"` LastUsedAt *time.Time `json:"last_used_at,omitempty"` Active bool `json:"active"` ExpiresAt *ISOTime `json:"expires_at"` @@ -92,7 +93,7 @@ type ListPersonalAccessTokensOptions struct { Search *string `url:"search,omitempty" json:"search,omitempty"` Sort *string `url:"sort,omitempty" json:"sort,omitempty"` State *string `url:"state,omitempty" json:"state,omitempty"` - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` } // ListPersonalAccessTokens gets a list of all personal access tokens. @@ -118,7 +119,7 @@ func (s *PersonalAccessTokensService) ListPersonalAccessTokens(opt *ListPersonal // // GitLab API docs: // https://docs.gitlab.com/api/personal_access_tokens/#get-details-on-a-personal-access-token -func (s *PersonalAccessTokensService) GetSinglePersonalAccessTokenByID(token int, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { +func (s *PersonalAccessTokensService) GetSinglePersonalAccessTokenByID(token int64, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { u := fmt.Sprintf("personal_access_tokens/%d", token) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) if err != nil { @@ -165,7 +166,7 @@ type RotatePersonalAccessTokenOptions struct { } // RotatePersonalAccessToken is a backwards-compat shim for RotatePersonalAccessTokenByID. -func (s *PersonalAccessTokensService) RotatePersonalAccessToken(token int, opt *RotatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { +func (s *PersonalAccessTokensService) RotatePersonalAccessToken(token int64, opt *RotatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { return s.RotatePersonalAccessTokenByID(token, opt, options...) } @@ -174,7 +175,7 @@ func (s *PersonalAccessTokensService) RotatePersonalAccessToken(token int, opt * // // GitLab API docs: // https://docs.gitlab.com/api/personal_access_tokens/#rotate-a-personal-access-token -func (s *PersonalAccessTokensService) RotatePersonalAccessTokenByID(token int, opt *RotatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { +func (s *PersonalAccessTokensService) RotatePersonalAccessTokenByID(token int64, opt *RotatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { u := fmt.Sprintf("personal_access_tokens/%d/rotate", token) req, err := s.client.NewRequest(http.MethodPost, u, opt, options) @@ -214,7 +215,8 @@ func (s *PersonalAccessTokensService) RotatePersonalAccessTokenSelf(opt *RotateP } // RevokePersonalAccessToken is a backwards-compat shim for RevokePersonalAccessTokenByID. -func (s *PersonalAccessTokensService) RevokePersonalAccessToken(token int, options ...RequestOptionFunc) (*Response, error) { +// Deprecated: to be removed in 2.0; use RevokePersonalAccessTokenByID instead +func (s *PersonalAccessTokensService) RevokePersonalAccessToken(token int64, options ...RequestOptionFunc) (*Response, error) { return s.RevokePersonalAccessTokenByID(token, options...) } @@ -222,7 +224,7 @@ func (s *PersonalAccessTokensService) RevokePersonalAccessToken(token int, optio // // GitLab API docs: // https://docs.gitlab.com/api/personal_access_tokens/#revoke-a-personal-access-token -func (s *PersonalAccessTokensService) RevokePersonalAccessTokenByID(token int, options ...RequestOptionFunc) (*Response, error) { +func (s *PersonalAccessTokensService) RevokePersonalAccessTokenByID(token int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("personal_access_tokens/%d", token) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/pipeline_schedules.go b/vendor/gitlab.com/gitlab-org/api/client-go/pipeline_schedules.go index e258215f2..a6541d4ff 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/pipeline_schedules.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/pipeline_schedules.go @@ -25,16 +25,16 @@ import ( type ( PipelineSchedulesServiceInterface interface { ListPipelineSchedules(pid any, opt *ListPipelineSchedulesOptions, options ...RequestOptionFunc) ([]*PipelineSchedule, *Response, error) - GetPipelineSchedule(pid any, schedule int, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) - ListPipelinesTriggeredBySchedule(pid any, schedule int, opt *ListPipelinesTriggeredByScheduleOptions, options ...RequestOptionFunc) ([]*Pipeline, *Response, error) + GetPipelineSchedule(pid any, schedule int64, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) + ListPipelinesTriggeredBySchedule(pid any, schedule int64, opt *ListPipelinesTriggeredByScheduleOptions, options ...RequestOptionFunc) ([]*Pipeline, *Response, error) CreatePipelineSchedule(pid any, opt *CreatePipelineScheduleOptions, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) - EditPipelineSchedule(pid any, schedule int, opt *EditPipelineScheduleOptions, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) - TakeOwnershipOfPipelineSchedule(pid any, schedule int, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) - DeletePipelineSchedule(pid any, schedule int, options ...RequestOptionFunc) (*Response, error) - RunPipelineSchedule(pid any, schedule int, options ...RequestOptionFunc) (*Response, error) - CreatePipelineScheduleVariable(pid any, schedule int, opt *CreatePipelineScheduleVariableOptions, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) - EditPipelineScheduleVariable(pid any, schedule int, key string, opt *EditPipelineScheduleVariableOptions, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) - DeletePipelineScheduleVariable(pid any, schedule int, key string, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) + EditPipelineSchedule(pid any, schedule int64, opt *EditPipelineScheduleOptions, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) + TakeOwnershipOfPipelineSchedule(pid any, schedule int64, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) + DeletePipelineSchedule(pid any, schedule int64, options ...RequestOptionFunc) (*Response, error) + RunPipelineSchedule(pid any, schedule int64, options ...RequestOptionFunc) (*Response, error) + CreatePipelineScheduleVariable(pid any, schedule int64, opt *CreatePipelineScheduleVariableOptions, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) + EditPipelineScheduleVariable(pid any, schedule int64, key string, opt *EditPipelineScheduleVariableOptions, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) + DeletePipelineScheduleVariable(pid any, schedule int64, key string, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) } // PipelineSchedulesService handles communication with the pipeline @@ -53,7 +53,7 @@ var _ PipelineSchedulesServiceInterface = (*PipelineSchedulesService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/ type PipelineSchedule struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` Ref string `json:"ref"` Cron string `json:"cron"` @@ -71,7 +71,7 @@ type PipelineSchedule struct { // LastPipeline represents the last pipeline ran by schedule // this will be returned only for individual schedule get operation type LastPipeline struct { - ID int `json:"id"` + ID int64 `json:"id"` SHA string `json:"sha"` Ref string `json:"ref"` Status string `json:"status"` @@ -116,7 +116,7 @@ func (s *PipelineSchedulesService) ListPipelineSchedules(pid any, opt *ListPipel // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/#get-a-single-pipeline-schedule -func (s *PipelineSchedulesService) GetPipelineSchedule(pid any, schedule int, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) { +func (s *PipelineSchedulesService) GetPipelineSchedule(pid any, schedule int64, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -142,14 +142,16 @@ func (s *PipelineSchedulesService) GetPipelineSchedule(pid any, schedule int, op // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/#get-all-pipelines-triggered-by-a-pipeline-schedule -type ListPipelinesTriggeredByScheduleOptions ListOptions +type ListPipelinesTriggeredByScheduleOptions struct { + ListOptions +} // ListPipelinesTriggeredBySchedule gets all pipelines triggered by a pipeline // schedule. // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/#get-all-pipelines-triggered-by-a-pipeline-schedule -func (s *PipelineSchedulesService) ListPipelinesTriggeredBySchedule(pid any, schedule int, opt *ListPipelinesTriggeredByScheduleOptions, options ...RequestOptionFunc) ([]*Pipeline, *Response, error) { +func (s *PipelineSchedulesService) ListPipelinesTriggeredBySchedule(pid any, schedule int64, opt *ListPipelinesTriggeredByScheduleOptions, options ...RequestOptionFunc) ([]*Pipeline, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -227,7 +229,7 @@ type EditPipelineScheduleOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/#edit-a-pipeline-schedule -func (s *PipelineSchedulesService) EditPipelineSchedule(pid any, schedule int, opt *EditPipelineScheduleOptions, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) { +func (s *PipelineSchedulesService) EditPipelineSchedule(pid any, schedule int64, opt *EditPipelineScheduleOptions, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -253,7 +255,7 @@ func (s *PipelineSchedulesService) EditPipelineSchedule(pid any, schedule int, o // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/#take-ownership-of-a-pipeline-schedule -func (s *PipelineSchedulesService) TakeOwnershipOfPipelineSchedule(pid any, schedule int, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) { +func (s *PipelineSchedulesService) TakeOwnershipOfPipelineSchedule(pid any, schedule int64, options ...RequestOptionFunc) (*PipelineSchedule, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -278,7 +280,7 @@ func (s *PipelineSchedulesService) TakeOwnershipOfPipelineSchedule(pid any, sche // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/#delete-a-pipeline-schedule -func (s *PipelineSchedulesService) DeletePipelineSchedule(pid any, schedule int, options ...RequestOptionFunc) (*Response, error) { +func (s *PipelineSchedulesService) DeletePipelineSchedule(pid any, schedule int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -297,7 +299,7 @@ func (s *PipelineSchedulesService) DeletePipelineSchedule(pid any, schedule int, // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/#run-a-scheduled-pipeline-immediately -func (s *PipelineSchedulesService) RunPipelineSchedule(pid any, schedule int, options ...RequestOptionFunc) (*Response, error) { +func (s *PipelineSchedulesService) RunPipelineSchedule(pid any, schedule int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -327,7 +329,7 @@ type CreatePipelineScheduleVariableOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/#create-a-new-pipeline-schedule -func (s *PipelineSchedulesService) CreatePipelineScheduleVariable(pid any, schedule int, opt *CreatePipelineScheduleVariableOptions, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) { +func (s *PipelineSchedulesService) CreatePipelineScheduleVariable(pid any, schedule int64, opt *CreatePipelineScheduleVariableOptions, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -362,7 +364,7 @@ type EditPipelineScheduleVariableOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/#edit-a-pipeline-schedule-variable -func (s *PipelineSchedulesService) EditPipelineScheduleVariable(pid any, schedule int, key string, opt *EditPipelineScheduleVariableOptions, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) { +func (s *PipelineSchedulesService) EditPipelineScheduleVariable(pid any, schedule int64, key string, opt *EditPipelineScheduleVariableOptions, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -387,7 +389,7 @@ func (s *PipelineSchedulesService) EditPipelineScheduleVariable(pid any, schedul // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_schedules/#delete-a-pipeline-schedule-variable -func (s *PipelineSchedulesService) DeletePipelineScheduleVariable(pid any, schedule int, key string, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) { +func (s *PipelineSchedulesService) DeletePipelineScheduleVariable(pid any, schedule int64, key string, options ...RequestOptionFunc) (*PipelineVariable, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/pipeline_triggers.go b/vendor/gitlab.com/gitlab-org/api/client-go/pipeline_triggers.go index 97835de39..a065cbc65 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/pipeline_triggers.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/pipeline_triggers.go @@ -25,10 +25,10 @@ import ( type ( PipelineTriggersServiceInterface interface { ListPipelineTriggers(pid any, opt *ListPipelineTriggersOptions, options ...RequestOptionFunc) ([]*PipelineTrigger, *Response, error) - GetPipelineTrigger(pid any, trigger int, options ...RequestOptionFunc) (*PipelineTrigger, *Response, error) + GetPipelineTrigger(pid any, trigger int64, options ...RequestOptionFunc) (*PipelineTrigger, *Response, error) AddPipelineTrigger(pid any, opt *AddPipelineTriggerOptions, options ...RequestOptionFunc) (*PipelineTrigger, *Response, error) - EditPipelineTrigger(pid any, trigger int, opt *EditPipelineTriggerOptions, options ...RequestOptionFunc) (*PipelineTrigger, *Response, error) - DeletePipelineTrigger(pid any, trigger int, options ...RequestOptionFunc) (*Response, error) + EditPipelineTrigger(pid any, trigger int64, opt *EditPipelineTriggerOptions, options ...RequestOptionFunc) (*PipelineTrigger, *Response, error) + DeletePipelineTrigger(pid any, trigger int64, options ...RequestOptionFunc) (*Response, error) RunPipelineTrigger(pid any, opt *RunPipelineTriggerOptions, options ...RequestOptionFunc) (*Pipeline, *Response, error) } @@ -48,7 +48,7 @@ var _ PipelineTriggersServiceInterface = (*PipelineTriggersService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/pipeline_triggers/ type PipelineTrigger struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` CreatedAt *time.Time `json:"created_at"` DeletedAt *time.Time `json:"deleted_at"` @@ -62,7 +62,9 @@ type PipelineTrigger struct { // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_triggers/#list-project-trigger-tokens -type ListPipelineTriggersOptions ListOptions +type ListPipelineTriggersOptions struct { + ListOptions +} // ListPipelineTriggers gets a list of project triggers. // @@ -93,7 +95,7 @@ func (s *PipelineTriggersService) ListPipelineTriggers(pid any, opt *ListPipelin // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_triggers/#get-trigger-token-details -func (s *PipelineTriggersService) GetPipelineTrigger(pid any, trigger int, options ...RequestOptionFunc) (*PipelineTrigger, *Response, error) { +func (s *PipelineTriggersService) GetPipelineTrigger(pid any, trigger int64, options ...RequestOptionFunc) (*PipelineTrigger, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -159,7 +161,7 @@ type EditPipelineTriggerOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_triggers/#update-a-pipeline-trigger-token -func (s *PipelineTriggersService) EditPipelineTrigger(pid any, trigger int, opt *EditPipelineTriggerOptions, options ...RequestOptionFunc) (*PipelineTrigger, *Response, error) { +func (s *PipelineTriggersService) EditPipelineTrigger(pid any, trigger int64, opt *EditPipelineTriggerOptions, options ...RequestOptionFunc) (*PipelineTrigger, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -184,7 +186,7 @@ func (s *PipelineTriggersService) EditPipelineTrigger(pid any, trigger int, opt // // GitLab API docs: // https://docs.gitlab.com/api/pipeline_triggers/#remove-a-pipeline-trigger-token -func (s *PipelineTriggersService) DeletePipelineTrigger(pid any, trigger int, options ...RequestOptionFunc) (*Response, error) { +func (s *PipelineTriggersService) DeletePipelineTrigger(pid any, trigger int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/pipelines.go b/vendor/gitlab.com/gitlab-org/api/client-go/pipelines.go index 485bdffbf..6d076e439 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/pipelines.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/pipelines.go @@ -21,8 +21,6 @@ import ( "fmt" "net/http" "time" - - "golang.org/x/exp/constraints" ) type PipelineSource string @@ -50,16 +48,16 @@ const ( type ( PipelinesServiceInterface interface { ListProjectPipelines(pid any, opt *ListProjectPipelinesOptions, options ...RequestOptionFunc) ([]*PipelineInfo, *Response, error) - GetPipeline(pid any, pipeline int, options ...RequestOptionFunc) (*Pipeline, *Response, error) - GetPipelineVariables(pid any, pipeline int, options ...RequestOptionFunc) ([]*PipelineVariable, *Response, error) - GetPipelineTestReport(pid any, pipeline int, options ...RequestOptionFunc) (*PipelineTestReport, *Response, error) - GetPipelineTestReportSummary(pid any, pipeline int, options ...RequestOptionFunc) (*PipelineTestReportSummary, *Response, error) + GetPipeline(pid any, pipeline int64, options ...RequestOptionFunc) (*Pipeline, *Response, error) + GetPipelineVariables(pid any, pipeline int64, options ...RequestOptionFunc) ([]*PipelineVariable, *Response, error) + GetPipelineTestReport(pid any, pipeline int64, options ...RequestOptionFunc) (*PipelineTestReport, *Response, error) + GetPipelineTestReportSummary(pid any, pipeline int64, options ...RequestOptionFunc) (*PipelineTestReportSummary, *Response, error) GetLatestPipeline(pid any, opt *GetLatestPipelineOptions, options ...RequestOptionFunc) (*Pipeline, *Response, error) CreatePipeline(pid any, opt *CreatePipelineOptions, options ...RequestOptionFunc) (*Pipeline, *Response, error) - RetryPipelineBuild(pid any, pipeline int, options ...RequestOptionFunc) (*Pipeline, *Response, error) - CancelPipelineBuild(pid any, pipeline int, options ...RequestOptionFunc) (*Pipeline, *Response, error) - DeletePipeline(pid any, pipeline int, options ...RequestOptionFunc) (*Response, error) - UpdatePipelineMetadata(pid any, pipeline int, opt *UpdatePipelineMetadataOptions, options ...RequestOptionFunc) (*Pipeline, *Response, error) + RetryPipelineBuild(pid any, pipeline int64, options ...RequestOptionFunc) (*Pipeline, *Response, error) + CancelPipelineBuild(pid any, pipeline int64, options ...RequestOptionFunc) (*Pipeline, *Response, error) + DeletePipeline(pid any, pipeline int64, options ...RequestOptionFunc) (*Response, error) + UpdatePipelineMetadata(pid any, pipeline int64, opt *UpdatePipelineMetadataOptions, options ...RequestOptionFunc) (*Pipeline, *Response, error) } // PipelinesService handles communication with the repositories related @@ -94,9 +92,9 @@ type PipelineInput struct { // // GitLab API docs: https://docs.gitlab.com/api/pipelines/ type Pipeline struct { - ID int `json:"id"` - IID int `json:"iid"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + ProjectID int64 `json:"project_id"` Status string `json:"status"` Source PipelineSource `json:"source"` Ref string `json:"ref"` @@ -111,40 +109,51 @@ type Pipeline struct { StartedAt *time.Time `json:"started_at"` FinishedAt *time.Time `json:"finished_at"` CommittedAt *time.Time `json:"committed_at"` - Duration int `json:"duration"` - QueuedDuration int `json:"queued_duration"` + Duration int64 `json:"duration"` + QueuedDuration int64 `json:"queued_duration"` Coverage string `json:"coverage"` WebURL string `json:"web_url"` DetailedStatus *DetailedStatus `json:"detailed_status"` } +func (p Pipeline) String() string { + return Stringify(p) +} + // DetailedStatus contains detailed information about the status of a pipeline. type DetailedStatus struct { - Icon string `json:"icon"` - Text string `json:"text"` - Label string `json:"label"` - Group string `json:"group"` - Tooltip string `json:"tooltip"` - HasDetails bool `json:"has_details"` - DetailsPath string `json:"details_path"` - Illustration struct { - Image string `json:"image"` - } `json:"illustration"` - Favicon string `json:"favicon"` + Icon string `json:"icon"` + Text string `json:"text"` + Label string `json:"label"` + Group string `json:"group"` + Tooltip string `json:"tooltip"` + HasDetails bool `json:"has_details"` + DetailsPath string `json:"details_path"` + Illustration DetailedStatusIllustration `json:"illustration"` + Favicon string `json:"favicon"` } -func (p Pipeline) String() string { - return Stringify(p) +func (s DetailedStatus) String() string { + return Stringify(s) +} + +// DetailedStatusIllustration contains detailed information about the status illustration of a pipeline. +type DetailedStatusIllustration struct { + Image string `json:"image"` +} + +func (i DetailedStatusIllustration) String() string { + return Stringify(i) } // PipelineTestReport contains a detailed report of a test run. type PipelineTestReport struct { TotalTime float64 `json:"total_time"` - TotalCount int `json:"total_count"` - SuccessCount int `json:"success_count"` - FailedCount int `json:"failed_count"` - SkippedCount int `json:"skipped_count"` - ErrorCount int `json:"error_count"` + TotalCount int64 `json:"total_count"` + SuccessCount int64 `json:"success_count"` + FailedCount int64 `json:"failed_count"` + SkippedCount int64 `json:"skipped_count"` + ErrorCount int64 `json:"error_count"` TestSuites []*PipelineTestSuites `json:"test_suites"` } @@ -152,11 +161,11 @@ type PipelineTestReport struct { type PipelineTestSuites struct { Name string `json:"name"` TotalTime float64 `json:"total_time"` - TotalCount int `json:"total_count"` - SuccessCount int `json:"success_count"` - FailedCount int `json:"failed_count"` - SkippedCount int `json:"skipped_count"` - ErrorCount int `json:"error_count"` + TotalCount int64 `json:"total_count"` + SuccessCount int64 `json:"success_count"` + FailedCount int64 `json:"failed_count"` + SkippedCount int64 `json:"skipped_count"` + ErrorCount int64 `json:"error_count"` TestCases []*PipelineTestCases `json:"test_cases"` } @@ -183,11 +192,11 @@ type PipelineTestReportSummary struct { type PipelineTotalSummary struct { // Documentation examples only show whole numbers, but the test specs for GitLab show decimals, so `float64` is the better attribute here. Time float64 `json:"time"` - Count int `json:"count"` - Success int `json:"success"` - Failed int `json:"failed"` - Skipped int `json:"skipped"` - Error int `json:"error"` + Count int64 `json:"count"` + Success int64 `json:"success"` + Failed int64 `json:"failed"` + Skipped int64 `json:"skipped"` + Error int64 `json:"error"` SuiteError *string `json:"suite_error"` } @@ -195,18 +204,18 @@ type PipelineTotalSummary struct { type PipelineTestSuiteSummary struct { Name string `json:"name"` TotalTime float64 `json:"total_time"` - TotalCount int `json:"total_count"` - SuccessCount int `json:"success_count"` - FailedCount int `json:"failed_count"` - SkippedCount int `json:"skipped_count"` - ErrorCount int `json:"error_count"` - BuildIDs []int `json:"build_ids"` + TotalCount int64 `json:"total_count"` + SuccessCount int64 `json:"success_count"` + FailedCount int64 `json:"failed_count"` + SkippedCount int64 `json:"skipped_count"` + ErrorCount int64 `json:"error_count"` + BuildIDs []int64 `json:"build_ids"` SuiteError *string `json:"suite_error"` } // RecentFailures contains failures count for the project's default branch. type RecentFailures struct { - Count int `json:"count"` + Count int64 `json:"count"` BaseBranch string `json:"base_branch"` } @@ -217,9 +226,9 @@ func (p PipelineTestReport) String() string { // PipelineInfo shows the basic entities of a pipeline, mostly used as fields // on other assets, like Commit. type PipelineInfo struct { - ID int `json:"id"` - IID int `json:"iid"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + ProjectID int64 `json:"project_id"` Status string `json:"status"` Source string `json:"source"` Ref string `json:"ref"` @@ -286,7 +295,7 @@ func (s *PipelinesService) ListProjectPipelines(pid any, opt *ListProjectPipelin // // GitLab API docs: // https://docs.gitlab.com/api/pipelines/#get-a-single-pipeline -func (s *PipelinesService) GetPipeline(pid any, pipeline int, options ...RequestOptionFunc) (*Pipeline, *Response, error) { +func (s *PipelinesService) GetPipeline(pid any, pipeline int64, options ...RequestOptionFunc) (*Pipeline, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -311,7 +320,7 @@ func (s *PipelinesService) GetPipeline(pid any, pipeline int, options ...Request // // GitLab API docs: // https://docs.gitlab.com/api/pipelines/#get-variables-of-a-pipeline -func (s *PipelinesService) GetPipelineVariables(pid any, pipeline int, options ...RequestOptionFunc) ([]*PipelineVariable, *Response, error) { +func (s *PipelinesService) GetPipelineVariables(pid any, pipeline int64, options ...RequestOptionFunc) ([]*PipelineVariable, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -336,7 +345,7 @@ func (s *PipelinesService) GetPipelineVariables(pid any, pipeline int, options . // // GitLab API docs: // https://docs.gitlab.com/api/pipelines/#get-a-pipelines-test-report -func (s *PipelinesService) GetPipelineTestReport(pid any, pipeline int, options ...RequestOptionFunc) (*PipelineTestReport, *Response, error) { +func (s *PipelinesService) GetPipelineTestReport(pid any, pipeline int64, options ...RequestOptionFunc) (*PipelineTestReport, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -361,7 +370,7 @@ func (s *PipelinesService) GetPipelineTestReport(pid any, pipeline int, options // // GitLab API docs: // https://docs.gitlab.com/api/pipelines/#get-a-test-report-summary-for-a-pipeline -func (s *PipelinesService) GetPipelineTestReportSummary(pid any, pipeline int, options ...RequestOptionFunc) (*PipelineTestReportSummary, *Response, error) { +func (s *PipelinesService) GetPipelineTestReportSummary(pid any, pipeline int64, options ...RequestOptionFunc) (*PipelineTestReportSummary, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -469,10 +478,26 @@ type PipelineInputValueInterface interface { pipelineInputValue() } +type constraintSigned interface { + ~int | ~int8 | ~int16 | ~int32 | ~int64 +} + +type constraintUnsigned interface { + ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr +} + +type constraintInteger interface { + constraintSigned | constraintUnsigned +} + +type constraintFloat interface { + ~float32 | ~float64 +} + // PipelineInputValueType is a type constraint for valid pipeline input value types. // This constraint ensures only supported GitLab pipeline input types can be used. type PipelineInputValueType interface { - ~string | constraints.Integer | constraints.Float | ~bool | []string + ~string | constraintInteger | constraintFloat | ~bool | []string } // PipelineInputValue wraps a pipeline input value with compile-time type safety. @@ -527,7 +552,7 @@ func (s *PipelinesService) CreatePipeline(pid any, opt *CreatePipelineOptions, o // // GitLab API docs: // https://docs.gitlab.com/api/pipelines/#retry-jobs-in-a-pipeline -func (s *PipelinesService) RetryPipelineBuild(pid any, pipeline int, options ...RequestOptionFunc) (*Pipeline, *Response, error) { +func (s *PipelinesService) RetryPipelineBuild(pid any, pipeline int64, options ...RequestOptionFunc) (*Pipeline, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -552,7 +577,7 @@ func (s *PipelinesService) RetryPipelineBuild(pid any, pipeline int, options ... // // GitLab API docs: // https://docs.gitlab.com/api/pipelines/#cancel-a-pipelines-jobs -func (s *PipelinesService) CancelPipelineBuild(pid any, pipeline int, options ...RequestOptionFunc) (*Pipeline, *Response, error) { +func (s *PipelinesService) CancelPipelineBuild(pid any, pipeline int64, options ...RequestOptionFunc) (*Pipeline, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -577,7 +602,7 @@ func (s *PipelinesService) CancelPipelineBuild(pid any, pipeline int, options .. // // GitLab API docs: // https://docs.gitlab.com/api/pipelines/#delete-a-pipeline -func (s *PipelinesService) DeletePipeline(pid any, pipeline int, options ...RequestOptionFunc) (*Response, error) { +func (s *PipelinesService) DeletePipeline(pid any, pipeline int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -606,7 +631,7 @@ type UpdatePipelineMetadataOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/pipelines/#update-pipeline-metadata -func (s *PipelinesService) UpdatePipelineMetadata(pid any, pipeline int, opt *UpdatePipelineMetadataOptions, options ...RequestOptionFunc) (*Pipeline, *Response, error) { +func (s *PipelinesService) UpdatePipelineMetadata(pid any, pipeline int64, opt *UpdatePipelineMetadataOptions, options ...RequestOptionFunc) (*Pipeline, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/plan_limits.go b/vendor/gitlab.com/gitlab-org/api/client-go/plan_limits.go index 53e9c9fd5..018eff593 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/plan_limits.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/plan_limits.go @@ -39,14 +39,14 @@ var _ PlanLimitsServiceInterface = (*PlanLimitsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/plan_limits/ type PlanLimit struct { - ConanMaxFileSize int `json:"conan_max_file_size,omitempty"` - GenericPackagesMaxFileSize int `json:"generic_packages_max_file_size,omitempty"` - HelmMaxFileSize int `json:"helm_max_file_size,omitempty"` - MavenMaxFileSize int `json:"maven_max_file_size,omitempty"` - NPMMaxFileSize int `json:"npm_max_file_size,omitempty"` - NugetMaxFileSize int `json:"nuget_max_file_size,omitempty"` - PyPiMaxFileSize int `json:"pypi_max_file_size,omitempty"` - TerraformModuleMaxFileSize int `json:"terraform_module_max_file_size,omitempty"` + ConanMaxFileSize int64 `json:"conan_max_file_size,omitempty"` + GenericPackagesMaxFileSize int64 `json:"generic_packages_max_file_size,omitempty"` + HelmMaxFileSize int64 `json:"helm_max_file_size,omitempty"` + MavenMaxFileSize int64 `json:"maven_max_file_size,omitempty"` + NPMMaxFileSize int64 `json:"npm_max_file_size,omitempty"` + NugetMaxFileSize int64 `json:"nuget_max_file_size,omitempty"` + PyPiMaxFileSize int64 `json:"pypi_max_file_size,omitempty"` + TerraformModuleMaxFileSize int64 `json:"terraform_module_max_file_size,omitempty"` } // GetCurrentPlanLimitsOptions represents the available GetCurrentPlanLimits() @@ -83,14 +83,14 @@ func (s *PlanLimitsService) GetCurrentPlanLimits(opt *GetCurrentPlanLimitsOption // https://docs.gitlab.com/api/plan_limits/#change-plan-limits type ChangePlanLimitOptions struct { PlanName *string `url:"plan_name,omitempty" json:"plan_name,omitempty"` - ConanMaxFileSize *int `url:"conan_max_file_size,omitempty" json:"conan_max_file_size,omitempty"` - GenericPackagesMaxFileSize *int `url:"generic_packages_max_file_size,omitempty" json:"generic_packages_max_file_size,omitempty"` - HelmMaxFileSize *int `url:"helm_max_file_size,omitempty" json:"helm_max_file_size,omitempty"` - MavenMaxFileSize *int `url:"maven_max_file_size,omitempty" json:"maven_max_file_size,omitempty"` - NPMMaxFileSize *int `url:"npm_max_file_size,omitempty" json:"npm_max_file_size,omitempty"` - NugetMaxFileSize *int `url:"nuget_max_file_size,omitempty" json:"nuget_max_file_size,omitempty"` - PyPiMaxFileSize *int `url:"pypi_max_file_size,omitempty" json:"pypi_max_file_size,omitempty"` - TerraformModuleMaxFileSize *int `url:"terraform_module_max_file_size,omitempty" json:"terraform_module_max_file_size,omitempty"` + ConanMaxFileSize *int64 `url:"conan_max_file_size,omitempty" json:"conan_max_file_size,omitempty"` + GenericPackagesMaxFileSize *int64 `url:"generic_packages_max_file_size,omitempty" json:"generic_packages_max_file_size,omitempty"` + HelmMaxFileSize *int64 `url:"helm_max_file_size,omitempty" json:"helm_max_file_size,omitempty"` + MavenMaxFileSize *int64 `url:"maven_max_file_size,omitempty" json:"maven_max_file_size,omitempty"` + NPMMaxFileSize *int64 `url:"npm_max_file_size,omitempty" json:"npm_max_file_size,omitempty"` + NugetMaxFileSize *int64 `url:"nuget_max_file_size,omitempty" json:"nuget_max_file_size,omitempty"` + PyPiMaxFileSize *int64 `url:"pypi_max_file_size,omitempty" json:"pypi_max_file_size,omitempty"` + TerraformModuleMaxFileSize *int64 `url:"terraform_module_max_file_size,omitempty" json:"terraform_module_max_file_size,omitempty"` } // ChangePlanLimits modifies the limits of a plan on the GitLab instance. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_access_tokens.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_access_tokens.go index e98e65855..41c3af62f 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_access_tokens.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_access_tokens.go @@ -24,11 +24,11 @@ import ( type ( ProjectAccessTokensServiceInterface interface { ListProjectAccessTokens(pid any, opt *ListProjectAccessTokensOptions, options ...RequestOptionFunc) ([]*ProjectAccessToken, *Response, error) - GetProjectAccessToken(pid any, id int, options ...RequestOptionFunc) (*ProjectAccessToken, *Response, error) + GetProjectAccessToken(pid any, id int64, options ...RequestOptionFunc) (*ProjectAccessToken, *Response, error) CreateProjectAccessToken(pid any, opt *CreateProjectAccessTokenOptions, options ...RequestOptionFunc) (*ProjectAccessToken, *Response, error) - RotateProjectAccessToken(pid any, id int, opt *RotateProjectAccessTokenOptions, options ...RequestOptionFunc) (*ProjectAccessToken, *Response, error) + RotateProjectAccessToken(pid any, id int64, opt *RotateProjectAccessTokenOptions, options ...RequestOptionFunc) (*ProjectAccessToken, *Response, error) RotateProjectAccessTokenSelf(pid any, opt *RotateProjectAccessTokenOptions, options ...RequestOptionFunc) (*ProjectAccessToken, *Response, error) - RevokeProjectAccessToken(pid any, id int, options ...RequestOptionFunc) (*Response, error) + RevokeProjectAccessToken(pid any, id int64, options ...RequestOptionFunc) (*Response, error) } // ProjectAccessTokensService handles communication with the @@ -93,7 +93,7 @@ func (s *ProjectAccessTokensService) ListProjectAccessTokens(pid any, opt *ListP // // GitLab API docs: // https://docs.gitlab.com/api/project_access_tokens/#get-details-on-a-project-access-token -func (s *ProjectAccessTokensService) GetProjectAccessToken(pid any, id int, options ...RequestOptionFunc) (*ProjectAccessToken, *Response, error) { +func (s *ProjectAccessTokensService) GetProjectAccessToken(pid any, id int64, options ...RequestOptionFunc) (*ProjectAccessToken, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -166,7 +166,7 @@ type RotateProjectAccessTokenOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_access_tokens/#rotate-a-project-access-token -func (s *ProjectAccessTokensService) RotateProjectAccessToken(pid any, id int, opt *RotateProjectAccessTokenOptions, options ...RequestOptionFunc) (*ProjectAccessToken, *Response, error) { +func (s *ProjectAccessTokensService) RotateProjectAccessToken(pid any, id int64, opt *RotateProjectAccessTokenOptions, options ...RequestOptionFunc) (*ProjectAccessToken, *Response, error) { projects, err := parseID(pid) if err != nil { return nil, nil, err @@ -215,7 +215,7 @@ func (s *ProjectAccessTokensService) RotateProjectAccessTokenSelf(pid any, opt * // // GitLab API docs: // https://docs.gitlab.com/api/project_access_tokens/#revoke-a-project-access-token -func (s *ProjectAccessTokensService) RevokeProjectAccessToken(pid any, id int, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectAccessTokensService) RevokeProjectAccessToken(pid any, id int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_aliases.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_aliases.go index a1af481ca..c83230ddb 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_aliases.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_aliases.go @@ -28,8 +28,8 @@ var _ ProjectAliasesServiceInterface = (*ProjectAliasesService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/project_aliases/ type ProjectAlias struct { - ID int `json:"id"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + ProjectID int64 `json:"project_id"` Name string `json:"name"` } @@ -39,7 +39,7 @@ type ProjectAlias struct { // https://docs.gitlab.com/api/project_aliases/#create-a-project-alias type CreateProjectAliasOptions struct { Name *string `json:"name" url:"name,omitempty"` - ProjectID int `json:"project_id" url:"project_id,omitempty"` + ProjectID int64 `json:"project_id" url:"project_id,omitempty"` } // ListProjectAliases gets a list of all project aliases. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_badges.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_badges.go index c65daa389..408426a93 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_badges.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_badges.go @@ -24,10 +24,10 @@ import ( type ( ProjectBadgesServiceInterface interface { ListProjectBadges(pid any, opt *ListProjectBadgesOptions, options ...RequestOptionFunc) ([]*ProjectBadge, *Response, error) - GetProjectBadge(pid any, badge int, options ...RequestOptionFunc) (*ProjectBadge, *Response, error) + GetProjectBadge(pid any, badge int64, options ...RequestOptionFunc) (*ProjectBadge, *Response, error) AddProjectBadge(pid any, opt *AddProjectBadgeOptions, options ...RequestOptionFunc) (*ProjectBadge, *Response, error) - EditProjectBadge(pid any, badge int, opt *EditProjectBadgeOptions, options ...RequestOptionFunc) (*ProjectBadge, *Response, error) - DeleteProjectBadge(pid any, badge int, options ...RequestOptionFunc) (*Response, error) + EditProjectBadge(pid any, badge int64, opt *EditProjectBadgeOptions, options ...RequestOptionFunc) (*ProjectBadge, *Response, error) + DeleteProjectBadge(pid any, badge int64, options ...RequestOptionFunc) (*Response, error) PreviewProjectBadge(pid any, opt *ProjectBadgePreviewOptions, options ...RequestOptionFunc) (*ProjectBadge, *Response, error) } @@ -47,7 +47,7 @@ var _ ProjectBadgesServiceInterface = (*ProjectBadgesService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/project_badges/#list-all-badges-of-a-project type ProjectBadge struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` LinkURL string `json:"link_url"` ImageURL string `json:"image_url"` @@ -96,7 +96,7 @@ func (s *ProjectBadgesService) ListProjectBadges(pid any, opt *ListProjectBadges // // GitLab API docs: // https://docs.gitlab.com/api/project_badges/#get-a-badge-of-a-project -func (s *ProjectBadgesService) GetProjectBadge(pid any, badge int, options ...RequestOptionFunc) (*ProjectBadge, *Response, error) { +func (s *ProjectBadgesService) GetProjectBadge(pid any, badge int64, options ...RequestOptionFunc) (*ProjectBadge, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -166,7 +166,7 @@ type EditProjectBadgeOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_badges/#edit-a-badge-of-a-project -func (s *ProjectBadgesService) EditProjectBadge(pid any, badge int, opt *EditProjectBadgeOptions, options ...RequestOptionFunc) (*ProjectBadge, *Response, error) { +func (s *ProjectBadgesService) EditProjectBadge(pid any, badge int64, opt *EditProjectBadgeOptions, options ...RequestOptionFunc) (*ProjectBadge, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -192,7 +192,7 @@ func (s *ProjectBadgesService) EditProjectBadge(pid any, badge int, opt *EditPro // // GitLab API docs: // https://docs.gitlab.com/api/project_badges/#remove-a-badge-from-a-project -func (s *ProjectBadgesService) DeleteProjectBadge(pid any, badge int, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectBadgesService) DeleteProjectBadge(pid any, badge int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_clusters.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_clusters.go index 0572e1b61..b9a7ce8c0 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_clusters.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_clusters.go @@ -28,13 +28,13 @@ type ( // Deprecated: in GitLab 14.5, to be removed in 19.0 ListClusters(pid any, options ...RequestOptionFunc) ([]*ProjectCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 - GetCluster(pid any, cluster int, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) + GetCluster(pid any, cluster int64, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 AddCluster(pid any, opt *AddClusterOptions, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 - EditCluster(pid any, cluster int, opt *EditClusterOptions, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) + EditCluster(pid any, cluster int64, opt *EditClusterOptions, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) // Deprecated: in GitLab 14.5, to be removed in 19.0 - DeleteCluster(pid any, cluster int, options ...RequestOptionFunc) (*Response, error) + DeleteCluster(pid any, cluster int64, options ...RequestOptionFunc) (*Response, error) } // ProjectClustersService handles communication with the @@ -56,7 +56,7 @@ var _ ProjectClustersServiceInterface = (*ProjectClustersService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/project_clusters/ type ProjectCluster struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Domain string `json:"domain"` CreatedAt *time.Time `json:"created_at"` @@ -88,7 +88,7 @@ type PlatformKubernetes struct { // ManagementProject represents a GitLab Project Cluster management_project. // Deprecated: in GitLab 14.5, to be removed in 19.0 type ManagementProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` Name string `json:"name"` NameWithNamespace string `json:"name_with_namespace"` @@ -128,7 +128,7 @@ func (s *ProjectClustersService) ListClusters(pid any, options ...RequestOptionF // // GitLab API docs: // https://docs.gitlab.com/api/project_clusters/#get-a-single-project-cluster -func (s *ProjectClustersService) GetCluster(pid any, cluster int, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) { +func (s *ProjectClustersService) GetCluster(pid any, cluster int64, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -227,7 +227,7 @@ type EditPlatformKubernetesOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_clusters/#edit-project-cluster -func (s *ProjectClustersService) EditCluster(pid any, cluster int, opt *EditClusterOptions, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) { +func (s *ProjectClustersService) EditCluster(pid any, cluster int64, opt *EditClusterOptions, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -253,7 +253,7 @@ func (s *ProjectClustersService) EditCluster(pid any, cluster int, opt *EditClus // // GitLab API docs: // https://docs.gitlab.com/api/project_clusters/#delete-project-cluster -func (s *ProjectClustersService) DeleteCluster(pid any, cluster int, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectClustersService) DeleteCluster(pid any, cluster int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_feature_flags.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_feature_flags.go index 223ea5960..a0a7d1d1e 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_feature_flags.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_feature_flags.go @@ -44,7 +44,7 @@ type ProjectFeatureFlag struct { // // GitLab API docs: https://docs.gitlab.com/api/feature_flags/ type ProjectFeatureFlagScope struct { - ID int `json:"id"` + ID int64 `json:"id"` EnvironmentScope string `json:"environment_scope"` } @@ -52,7 +52,7 @@ type ProjectFeatureFlagScope struct { // // GitLab API docs: https://docs.gitlab.com/api/feature_flags/ type ProjectFeatureFlagStrategy struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Parameters *ProjectFeatureFlagStrategyParameter `json:"parameters"` Scopes []*ProjectFeatureFlagScope `json:"scopes"` @@ -155,7 +155,7 @@ type CreateProjectFeatureFlagOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/feature_flags/#create-a-feature-flag type FeatureFlagStrategyOptions struct { - ID *int `url:"id,omitempty" json:"id,omitempty"` + ID *int64 `url:"id,omitempty" json:"id,omitempty"` Name *string `url:"name,omitempty" json:"name,omitempty"` Parameters *ProjectFeatureFlagStrategyParameter `url:"parameters,omitempty" json:"parameters,omitempty"` Scopes *[]*ProjectFeatureFlagScope `url:"scopes,omitempty" json:"scopes,omitempty"` @@ -167,7 +167,7 @@ type FeatureFlagStrategyOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/feature_flags/#create-a-feature-flag type ProjectFeatureFlagScopeOptions struct { - ID *int `url:"id,omitempty" json:"id,omitempty"` + ID *int64 `url:"id,omitempty" json:"id,omitempty"` EnvironmentScope *string `url:"id,omitempty" json:"environment_scope,omitempty"` } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_import_export.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_import_export.go index 105ec930c..6a4df5f0d 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_import_export.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_import_export.go @@ -50,7 +50,7 @@ var _ ProjectImportExportServiceInterface = (*ProjectImportExportService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/project_import_export/#import-status type ImportStatus struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` Name string `json:"name"` NameWithNamespace string `json:"name_with_namespace"` @@ -72,35 +72,47 @@ func (s ImportStatus) String() string { // GitLab API docs: // https://docs.gitlab.com/api/project_import_export/#export-status type ExportStatus struct { - ID int `json:"id"` - Description string `json:"description"` - Name string `json:"name"` - NameWithNamespace string `json:"name_with_namespace"` - Path string `json:"path"` - PathWithNamespace string `json:"path_with_namespace"` - CreatedAt *time.Time `json:"created_at"` - ExportStatus string `json:"export_status"` - Message string `json:"message"` - Links struct { - APIURL string `json:"api_url"` - WebURL string `json:"web_url"` - } `json:"_links"` + ID int64 `json:"id"` + Description string `json:"description"` + Name string `json:"name"` + NameWithNamespace string `json:"name_with_namespace"` + Path string `json:"path"` + PathWithNamespace string `json:"path_with_namespace"` + CreatedAt *time.Time `json:"created_at"` + ExportStatus string `json:"export_status"` + Message string `json:"message"` + Links ExportStatusLinks `json:"_links"` } func (s ExportStatus) String() string { return Stringify(s) } +// ExportStatusLinks represents the project export status links. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_import_export/#export-status +type ExportStatusLinks struct { + APIURL string `json:"api_url"` + WebURL string `json:"web_url"` +} + +func (l ExportStatusLinks) String() string { + return Stringify(l) +} + // ScheduleExportOptions represents the available ScheduleExport() options. // // GitLab API docs: // https://docs.gitlab.com/api/project_import_export/#schedule-an-export type ScheduleExportOptions struct { - Description *string `url:"description,omitempty" json:"description,omitempty"` - Upload struct { - URL *string `url:"url,omitempty" json:"url,omitempty"` - HTTPMethod *string `url:"http_method,omitempty" json:"http_method,omitempty"` - } `url:"upload,omitempty" json:"upload,omitempty"` + Description *string `url:"description,omitempty" json:"description,omitempty"` + Upload ScheduleExportUploadOptions `url:"upload,omitempty" json:"upload,omitempty"` +} + +type ScheduleExportUploadOptions struct { + URL *string `url:"url,omitempty" json:"url,omitempty"` + HTTPMethod *string `url:"http_method,omitempty" json:"http_method,omitempty"` } // ScheduleExport schedules a project export. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_iterations.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_iterations.go index 2495e4cfa..0fdaf3a43 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_iterations.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_iterations.go @@ -42,13 +42,13 @@ var _ ProjectIterationsServiceInterface = (*ProjectIterationsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/iterations/ type ProjectIteration struct { - ID int `json:"id"` - IID int `json:"iid"` - Sequence int `json:"sequence"` - GroupID int `json:"group_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + Sequence int64 `json:"sequence"` + GroupID int64 `json:"group_id"` Title string `json:"title"` Description string `json:"description"` - State int `json:"state"` + State int64 `json:"state"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` DueDate *ISOTime `json:"due_date"` diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_markdown_uploads.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_markdown_uploads.go index 88a39320b..312226df7 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_markdown_uploads.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_markdown_uploads.go @@ -26,9 +26,9 @@ type ( ProjectMarkdownUploadsServiceInterface interface { UploadProjectMarkdown(pid any, content io.Reader, filename string, options ...RequestOptionFunc) (*ProjectMarkdownUploadedFile, *Response, error) ListProjectMarkdownUploads(pid any, options ...RequestOptionFunc) ([]*ProjectMarkdownUpload, *Response, error) - DownloadProjectMarkdownUploadByID(pid any, uploadID int, options ...RequestOptionFunc) ([]byte, *Response, error) + DownloadProjectMarkdownUploadByID(pid any, uploadID int64, options ...RequestOptionFunc) ([]byte, *Response, error) DownloadProjectMarkdownUploadBySecretAndFilename(pid any, secret string, filename string, options ...RequestOptionFunc) ([]byte, *Response, error) - DeleteProjectMarkdownUploadByID(pid any, uploadID int, options ...RequestOptionFunc) (*Response, error) + DeleteProjectMarkdownUploadByID(pid any, uploadID int64, options ...RequestOptionFunc) (*Response, error) DeleteProjectMarkdownUploadBySecretAndFilename(pid any, secret string, filename string, options ...RequestOptionFunc) (*Response, error) } @@ -88,15 +88,15 @@ func (s *ProjectMarkdownUploadsService) UploadProjectMarkdown(pid any, content i // GitLab API Docs: // https://docs.gitlab.com/api/project_markdown_uploads/#list-uploads func (s *ProjectMarkdownUploadsService) ListProjectMarkdownUploads(pid any, options ...RequestOptionFunc) ([]*ProjectMarkdownUpload, *Response, error) { - return listMarkdownUploads[ProjectMarkdownUpload](s.client, ProjectResource, pid, nil, options) + return listMarkdownUploads[ProjectMarkdownUpload](s.client, ProjectResource, ProjectID{pid}, nil, options) } // DownloadProjectMarkdownUploadByID downloads a specific upload by ID. // // GitLab API Docs: // https://docs.gitlab.com/api/project_markdown_uploads/#download-an-uploaded-file-by-id -func (s *ProjectMarkdownUploadsService) DownloadProjectMarkdownUploadByID(pid any, uploadID int, options ...RequestOptionFunc) ([]byte, *Response, error) { - buffer, resp, err := downloadMarkdownUploadByID(s.client, ProjectResource, pid, uploadID, options) +func (s *ProjectMarkdownUploadsService) DownloadProjectMarkdownUploadByID(pid any, uploadID int64, options ...RequestOptionFunc) ([]byte, *Response, error) { + buffer, resp, err := downloadMarkdownUploadByID(s.client, ProjectResource, ProjectID{pid}, uploadID, options) if err != nil { return nil, resp, err } @@ -109,7 +109,7 @@ func (s *ProjectMarkdownUploadsService) DownloadProjectMarkdownUploadByID(pid an // GitLab API Docs: // https://docs.gitlab.com/api/project_markdown_uploads/#download-an-uploaded-file-by-secret-and-filename func (s *ProjectMarkdownUploadsService) DownloadProjectMarkdownUploadBySecretAndFilename(pid any, secret string, filename string, options ...RequestOptionFunc) ([]byte, *Response, error) { - buffer, resp, err := downloadMarkdownUploadBySecretAndFilename(s.client, ProjectResource, pid, secret, filename, options) + buffer, resp, err := downloadMarkdownUploadBySecretAndFilename(s.client, ProjectResource, ProjectID{pid}, secret, filename, options) if err != nil { return nil, resp, err } @@ -120,8 +120,8 @@ func (s *ProjectMarkdownUploadsService) DownloadProjectMarkdownUploadBySecretAnd // // GitLab API Docs: // https://docs.gitlab.com/api/project_markdown_uploads/#delete-an-uploaded-file-by-id -func (s *ProjectMarkdownUploadsService) DeleteProjectMarkdownUploadByID(pid any, uploadID int, options ...RequestOptionFunc) (*Response, error) { - return deleteMarkdownUploadByID(s.client, ProjectResource, pid, uploadID, options) +func (s *ProjectMarkdownUploadsService) DeleteProjectMarkdownUploadByID(pid any, uploadID int64, options ...RequestOptionFunc) (*Response, error) { + return deleteMarkdownUploadByID(s.client, ProjectResource, ProjectID{pid}, uploadID, options) } // DeleteProjectMarkdownUploadBySecretAndFilename deletes an upload @@ -130,5 +130,5 @@ func (s *ProjectMarkdownUploadsService) DeleteProjectMarkdownUploadByID(pid any, // GitLab API Docs: // https://docs.gitlab.com/api/project_markdown_uploads/#delete-an-uploaded-file-by-secret-and-filename func (s *ProjectMarkdownUploadsService) DeleteProjectMarkdownUploadBySecretAndFilename(pid any, secret string, filename string, options ...RequestOptionFunc) (*Response, error) { - return deleteMarkdownUploadBySecretAndFilename(s.client, ProjectResource, pid, secret, filename, options) + return deleteMarkdownUploadBySecretAndFilename(s.client, ProjectResource, ProjectID{pid}, secret, filename, options) } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_members.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_members.go index 22257a41d..92907048b 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_members.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_members.go @@ -26,11 +26,11 @@ type ( ProjectMembersServiceInterface interface { ListProjectMembers(pid any, opt *ListProjectMembersOptions, options ...RequestOptionFunc) ([]*ProjectMember, *Response, error) ListAllProjectMembers(pid any, opt *ListProjectMembersOptions, options ...RequestOptionFunc) ([]*ProjectMember, *Response, error) - GetProjectMember(pid any, user int, options ...RequestOptionFunc) (*ProjectMember, *Response, error) - GetInheritedProjectMember(pid any, user int, options ...RequestOptionFunc) (*ProjectMember, *Response, error) + GetProjectMember(pid any, user int64, options ...RequestOptionFunc) (*ProjectMember, *Response, error) + GetInheritedProjectMember(pid any, user int64, options ...RequestOptionFunc) (*ProjectMember, *Response, error) AddProjectMember(pid any, opt *AddProjectMemberOptions, options ...RequestOptionFunc) (*ProjectMember, *Response, error) - EditProjectMember(pid any, user int, opt *EditProjectMemberOptions, options ...RequestOptionFunc) (*ProjectMember, *Response, error) - DeleteProjectMember(pid any, user int, options ...RequestOptionFunc) (*Response, error) + EditProjectMember(pid any, user int64, opt *EditProjectMemberOptions, options ...RequestOptionFunc) (*ProjectMember, *Response, error) + DeleteProjectMember(pid any, user int64, options ...RequestOptionFunc) (*Response, error) } // ProjectMembersService handles communication with the project members @@ -49,7 +49,7 @@ var _ ProjectMembersServiceInterface = (*ProjectMembersService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/members/ type ProjectMember struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Email string `json:"email"` Name string `json:"name"` @@ -65,7 +65,7 @@ type ProjectMember struct { } type MemberCreatedBy struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Name string `json:"name"` State string `json:"state"` @@ -80,9 +80,9 @@ type MemberCreatedBy struct { // https://docs.gitlab.com/api/members/#list-all-members-of-a-group-or-project type ListProjectMembersOptions struct { ListOptions - Query *string `url:"query,omitempty" json:"query,omitempty"` - UserIDs *[]int `url:"user_ids[],omitempty" json:"user_ids,omitempty"` - ShowSeatInfo *bool `url:"show_seat_info,omitempty" json:"show_seat_info,omitempty"` + Query *string `url:"query,omitempty" json:"query,omitempty"` + UserIDs *[]int64 `url:"user_ids[],omitempty" json:"user_ids,omitempty"` + ShowSeatInfo *bool `url:"show_seat_info,omitempty" json:"show_seat_info,omitempty"` } // ListProjectMembers gets a list of a project's team members viewable by the @@ -143,7 +143,7 @@ func (s *ProjectMembersService) ListAllProjectMembers(pid any, opt *ListProjectM // // GitLab API docs: // https://docs.gitlab.com/api/members/#get-a-member-of-a-group-or-project -func (s *ProjectMembersService) GetProjectMember(pid any, user int, options ...RequestOptionFunc) (*ProjectMember, *Response, error) { +func (s *ProjectMembersService) GetProjectMember(pid any, user int64, options ...RequestOptionFunc) (*ProjectMember, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -168,7 +168,7 @@ func (s *ProjectMembersService) GetProjectMember(pid any, user int, options ...R // // GitLab API docs: // https://docs.gitlab.com/api/members/#get-a-member-of-a-group-or-project-including-inherited-and-invited-members -func (s *ProjectMembersService) GetInheritedProjectMember(pid any, user int, options ...RequestOptionFunc) (*ProjectMember, *Response, error) { +func (s *ProjectMembersService) GetInheritedProjectMember(pid any, user int64, options ...RequestOptionFunc) (*ProjectMember, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -198,7 +198,7 @@ type AddProjectMemberOptions struct { Username *string `url:"username,omitempty" json:"username,omitempty"` AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at"` - MemberRoleID *int `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` + MemberRoleID *int64 `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` } // AddProjectMember adds a user to a project team. This is an idempotent @@ -236,14 +236,14 @@ func (s *ProjectMembersService) AddProjectMember(pid any, opt *AddProjectMemberO type EditProjectMemberOptions struct { AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at,omitempty"` - MemberRoleID *int `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` + MemberRoleID *int64 `url:"member_role_id,omitempty" json:"member_role_id,omitempty"` } // EditProjectMember updates a project team member to a specified access level.. // // GitLab API docs: // https://docs.gitlab.com/api/members/#edit-a-member-of-a-group-or-project -func (s *ProjectMembersService) EditProjectMember(pid any, user int, opt *EditProjectMemberOptions, options ...RequestOptionFunc) (*ProjectMember, *Response, error) { +func (s *ProjectMembersService) EditProjectMember(pid any, user int64, opt *EditProjectMemberOptions, options ...RequestOptionFunc) (*ProjectMember, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -268,7 +268,7 @@ func (s *ProjectMembersService) EditProjectMember(pid any, user int, opt *EditPr // // GitLab API docs: // https://docs.gitlab.com/api/members/#remove-a-member-from-a-group-or-project -func (s *ProjectMembersService) DeleteProjectMember(pid any, user int, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectMembersService) DeleteProjectMember(pid any, user int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_mirror.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_mirror.go index c8ef60970..258c5a62f 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_mirror.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_mirror.go @@ -25,11 +25,11 @@ import ( type ( ProjectMirrorServiceInterface interface { ListProjectMirror(pid any, opt *ListProjectMirrorOptions, options ...RequestOptionFunc) ([]*ProjectMirror, *Response, error) - GetProjectMirror(pid any, mirror int, options ...RequestOptionFunc) (*ProjectMirror, *Response, error) - GetProjectMirrorPublicKey(pid any, mirror int, options ...RequestOptionFunc) (*ProjectMirrorPublicKey, *Response, error) + GetProjectMirror(pid any, mirror int64, options ...RequestOptionFunc) (*ProjectMirror, *Response, error) + GetProjectMirrorPublicKey(pid any, mirror int64, options ...RequestOptionFunc) (*ProjectMirrorPublicKey, *Response, error) AddProjectMirror(pid any, opt *AddProjectMirrorOptions, options ...RequestOptionFunc) (*ProjectMirror, *Response, error) - EditProjectMirror(pid any, mirror int, opt *EditProjectMirrorOptions, options ...RequestOptionFunc) (*ProjectMirror, *Response, error) - DeleteProjectMirror(pid any, mirror int, options ...RequestOptionFunc) (*Response, error) + EditProjectMirror(pid any, mirror int64, opt *EditProjectMirrorOptions, options ...RequestOptionFunc) (*ProjectMirror, *Response, error) + DeleteProjectMirror(pid any, mirror int64, options ...RequestOptionFunc) (*Response, error) } // ProjectMirrorService handles communication with the project mirror @@ -48,7 +48,7 @@ var _ ProjectMirrorServiceInterface = (*ProjectMirrorService)(nil) // GitLAb API docs: https://docs.gitlab.com/api/remote_mirrors/ type ProjectMirror struct { Enabled bool `json:"enabled"` - ID int `json:"id"` + ID int64 `json:"id"` LastError string `json:"last_error"` LastSuccessfulUpdateAt *time.Time `json:"last_successful_update_at"` LastUpdateAt *time.Time `json:"last_update_at"` @@ -66,7 +66,9 @@ type ProjectMirrorPublicKey struct { } // ListProjectMirrorOptions represents the available ListProjectMirror() options. -type ListProjectMirrorOptions ListOptions +type ListProjectMirrorOptions struct { + ListOptions +} // ListProjectMirror gets a list of mirrors configured on the project. // @@ -97,7 +99,7 @@ func (s *ProjectMirrorService) ListProjectMirror(pid any, opt *ListProjectMirror // // GitLab API docs: // https://docs.gitlab.com/api/remote_mirrors/#get-a-single-projects-remote-mirror -func (s *ProjectMirrorService) GetProjectMirror(pid any, mirror int, options ...RequestOptionFunc) (*ProjectMirror, *Response, error) { +func (s *ProjectMirrorService) GetProjectMirror(pid any, mirror int64, options ...RequestOptionFunc) (*ProjectMirror, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -122,7 +124,7 @@ func (s *ProjectMirrorService) GetProjectMirror(pid any, mirror int, options ... // // GitLab API docs: // https://docs.gitlab.com/api/remote_mirrors/#get-a-single-projects-remote-mirror-public-key -func (s *ProjectMirrorService) GetProjectMirrorPublicKey(pid any, mirror int, options ...RequestOptionFunc) (*ProjectMirrorPublicKey, *Response, error) { +func (s *ProjectMirrorService) GetProjectMirrorPublicKey(pid any, mirror int64, options ...RequestOptionFunc) (*ProjectMirrorPublicKey, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -199,7 +201,7 @@ type EditProjectMirrorOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/remote_mirrors/#update-a-remote-mirrors-attributes -func (s *ProjectMirrorService) EditProjectMirror(pid any, mirror int, opt *EditProjectMirrorOptions, options ...RequestOptionFunc) (*ProjectMirror, *Response, error) { +func (s *ProjectMirrorService) EditProjectMirror(pid any, mirror int64, opt *EditProjectMirrorOptions, options ...RequestOptionFunc) (*ProjectMirror, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -224,7 +226,7 @@ func (s *ProjectMirrorService) EditProjectMirror(pid any, mirror int, opt *EditP // // GitLab API docs: // https://docs.gitlab.com/api/remote_mirrors/#delete-a-remote-mirror -func (s *ProjectMirrorService) DeleteProjectMirror(pid any, mirror int, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectMirrorService) DeleteProjectMirror(pid any, mirror int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_repository_storage_move.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_repository_storage_move.go index fe23dfbc8..7a94ddced 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_repository_storage_move.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_repository_storage_move.go @@ -25,10 +25,10 @@ import ( type ( ProjectRepositoryStorageMoveServiceInterface interface { RetrieveAllStorageMoves(opts RetrieveAllProjectStorageMovesOptions, options ...RequestOptionFunc) ([]*ProjectRepositoryStorageMove, *Response, error) - RetrieveAllStorageMovesForProject(project int, opts RetrieveAllProjectStorageMovesOptions, options ...RequestOptionFunc) ([]*ProjectRepositoryStorageMove, *Response, error) - GetStorageMove(repositoryStorage int, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) - GetStorageMoveForProject(project int, repositoryStorage int, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) - ScheduleStorageMoveForProject(project int, opts ScheduleStorageMoveForProjectOptions, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) + RetrieveAllStorageMovesForProject(project int64, opts RetrieveAllProjectStorageMovesOptions, options ...RequestOptionFunc) ([]*ProjectRepositoryStorageMove, *Response, error) + GetStorageMove(repositoryStorage int64, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) + GetStorageMoveForProject(project int64, repositoryStorage int64, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) + ScheduleStorageMoveForProject(project int64, opts ScheduleStorageMoveForProjectOptions, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) ScheduleAllStorageMoves(opts ScheduleAllProjectStorageMovesOptions, options ...RequestOptionFunc) (*Response, error) } @@ -49,7 +49,7 @@ var _ ProjectRepositoryStorageMoveServiceInterface = (*ProjectRepositoryStorageM // GitLab API docs: // https://docs.gitlab.com/api/project_repository_storage_moves/ type ProjectRepositoryStorageMove struct { - ID int `json:"id"` + ID int64 `json:"id"` CreatedAt *time.Time `json:"created_at"` State string `json:"state"` SourceStorageName string `json:"source_storage_name"` @@ -58,7 +58,7 @@ type ProjectRepositoryStorageMove struct { } type RepositoryProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` Name string `json:"name"` NameWithNamespace string `json:"name_with_namespace"` @@ -72,7 +72,9 @@ type RepositoryProject struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_repository_storage_moves/#retrieve-all-project-repository-storage-moves -type RetrieveAllProjectStorageMovesOptions ListOptions +type RetrieveAllProjectStorageMovesOptions struct { + ListOptions +} // RetrieveAllStorageMoves retrieves all project repository storage moves // accessible by the authenticated user. @@ -99,7 +101,7 @@ func (p ProjectRepositoryStorageMoveService) RetrieveAllStorageMoves(opts Retrie // // GitLab API docs: // https://docs.gitlab.com/api/project_repository_storage_moves/#retrieve-all-repository-storage-moves-for-a-project -func (p ProjectRepositoryStorageMoveService) RetrieveAllStorageMovesForProject(project int, opts RetrieveAllProjectStorageMovesOptions, options ...RequestOptionFunc) ([]*ProjectRepositoryStorageMove, *Response, error) { +func (p ProjectRepositoryStorageMoveService) RetrieveAllStorageMovesForProject(project int64, opts RetrieveAllProjectStorageMovesOptions, options ...RequestOptionFunc) ([]*ProjectRepositoryStorageMove, *Response, error) { u := fmt.Sprintf("projects/%d/repository_storage_moves", project) req, err := p.client.NewRequest(http.MethodGet, u, opts, options) @@ -120,7 +122,7 @@ func (p ProjectRepositoryStorageMoveService) RetrieveAllStorageMovesForProject(p // // GitLab API docs: // https://docs.gitlab.com/api/project_repository_storage_moves/#get-a-single-project-repository-storage-move -func (p ProjectRepositoryStorageMoveService) GetStorageMove(repositoryStorage int, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) { +func (p ProjectRepositoryStorageMoveService) GetStorageMove(repositoryStorage int64, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) { u := fmt.Sprintf("project_repository_storage_moves/%d", repositoryStorage) req, err := p.client.NewRequest(http.MethodGet, u, nil, options) @@ -141,7 +143,7 @@ func (p ProjectRepositoryStorageMoveService) GetStorageMove(repositoryStorage in // // GitLab API docs: // https://docs.gitlab.com/api/project_repository_storage_moves/#get-a-single-repository-storage-move-for-a-project -func (p ProjectRepositoryStorageMoveService) GetStorageMoveForProject(project int, repositoryStorage int, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) { +func (p ProjectRepositoryStorageMoveService) GetStorageMoveForProject(project int64, repositoryStorage int64, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) { u := fmt.Sprintf("projects/%d/repository_storage_moves/%d", project, repositoryStorage) req, err := p.client.NewRequest(http.MethodGet, u, nil, options) @@ -171,7 +173,7 @@ type ScheduleStorageMoveForProjectOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_repository_storage_moves/#schedule-a-repository-storage-move-for-a-project -func (p ProjectRepositoryStorageMoveService) ScheduleStorageMoveForProject(project int, opts ScheduleStorageMoveForProjectOptions, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) { +func (p ProjectRepositoryStorageMoveService) ScheduleStorageMoveForProject(project int64, opts ScheduleStorageMoveForProjectOptions, options ...RequestOptionFunc) (*ProjectRepositoryStorageMove, *Response, error) { u := fmt.Sprintf("projects/%d/repository_storage_moves", project) req, err := p.client.NewRequest(http.MethodPost, u, opts, options) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_snippets.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_snippets.go index 61c7e59e2..8ba3cb3f1 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_snippets.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_snippets.go @@ -25,11 +25,11 @@ import ( type ( ProjectSnippetsServiceInterface interface { ListSnippets(pid any, opt *ListProjectSnippetsOptions, options ...RequestOptionFunc) ([]*Snippet, *Response, error) - GetSnippet(pid any, snippet int, options ...RequestOptionFunc) (*Snippet, *Response, error) + GetSnippet(pid any, snippet int64, options ...RequestOptionFunc) (*Snippet, *Response, error) CreateSnippet(pid any, opt *CreateProjectSnippetOptions, options ...RequestOptionFunc) (*Snippet, *Response, error) - UpdateSnippet(pid any, snippet int, opt *UpdateProjectSnippetOptions, options ...RequestOptionFunc) (*Snippet, *Response, error) - DeleteSnippet(pid any, snippet int, options ...RequestOptionFunc) (*Response, error) - SnippetContent(pid any, snippet int, options ...RequestOptionFunc) ([]byte, *Response, error) + UpdateSnippet(pid any, snippet int64, opt *UpdateProjectSnippetOptions, options ...RequestOptionFunc) (*Snippet, *Response, error) + DeleteSnippet(pid any, snippet int64, options ...RequestOptionFunc) (*Response, error) + SnippetContent(pid any, snippet int64, options ...RequestOptionFunc) ([]byte, *Response, error) } // ProjectSnippetsService handles communication with the project snippets @@ -46,7 +46,9 @@ var _ ProjectSnippetsServiceInterface = (*ProjectSnippetsService)(nil) // ListProjectSnippetsOptions represents the available ListSnippets() options. // // GitLab API docs: https://docs.gitlab.com/api/project_snippets/#list-snippets -type ListProjectSnippetsOptions ListOptions +type ListProjectSnippetsOptions struct { + ListOptions +} // ListSnippets gets a list of project snippets. // @@ -76,7 +78,7 @@ func (s *ProjectSnippetsService) ListSnippets(pid any, opt *ListProjectSnippetsO // // GitLab API docs: // https://docs.gitlab.com/api/project_snippets/#single-snippet -func (s *ProjectSnippetsService) GetSnippet(pid any, snippet int, options ...RequestOptionFunc) (*Snippet, *Response, error) { +func (s *ProjectSnippetsService) GetSnippet(pid any, snippet int64, options ...RequestOptionFunc) (*Snippet, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -160,7 +162,7 @@ type UpdateProjectSnippetOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_snippets/#update-snippet -func (s *ProjectSnippetsService) UpdateSnippet(pid any, snippet int, opt *UpdateProjectSnippetOptions, options ...RequestOptionFunc) (*Snippet, *Response, error) { +func (s *ProjectSnippetsService) UpdateSnippet(pid any, snippet int64, opt *UpdateProjectSnippetOptions, options ...RequestOptionFunc) (*Snippet, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -187,7 +189,7 @@ func (s *ProjectSnippetsService) UpdateSnippet(pid any, snippet int, opt *Update // // GitLab API docs: // https://docs.gitlab.com/api/project_snippets/#delete-snippet -func (s *ProjectSnippetsService) DeleteSnippet(pid any, snippet int, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectSnippetsService) DeleteSnippet(pid any, snippet int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -206,7 +208,7 @@ func (s *ProjectSnippetsService) DeleteSnippet(pid any, snippet int, options ... // // GitLab API docs: // https://docs.gitlab.com/api/project_snippets/#snippet-content -func (s *ProjectSnippetsService) SnippetContent(pid any, snippet int, options ...RequestOptionFunc) ([]byte, *Response, error) { +func (s *ProjectSnippetsService) SnippetContent(pid any, snippet int64, options ...RequestOptionFunc) ([]byte, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_templates.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_templates.go index 1e7c6489a..ffafb257b 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_templates.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_templates.go @@ -65,7 +65,7 @@ func (s ProjectTemplate) String() string { // https://docs.gitlab.com/api/project_templates/#get-all-templates-of-a-particular-type type ListProjectTemplatesOptions struct { ListOptions - ID *int `url:"id,omitempty" json:"id,omitempty"` + ID *int64 `url:"id,omitempty" json:"id,omitempty"` Type *string `url:"type,omitempty" json:"type,omitempty"` } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_variables.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_variables.go index 870837ec6..ee85aa78c 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_variables.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_variables.go @@ -65,7 +65,7 @@ func (v ProjectVariable) String() string { // VariableFilter filters available for project variable related functions type VariableFilter struct { - EnvironmentScope string `url:"environment_scope, omitempty" json:"environment_scope,omitempty"` + EnvironmentScope string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"` } // ListProjectVariablesOptions represents the available options for listing variables @@ -73,7 +73,9 @@ type VariableFilter struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_level_variables/#list-project-variables -type ListProjectVariablesOptions ListOptions +type ListProjectVariablesOptions struct { + ListOptions +} // ListVariables gets a list of all variables in a project. // diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/project_vulnerabilities.go b/vendor/gitlab.com/gitlab-org/api/client-go/project_vulnerabilities.go index aa85f43ba..b55130e18 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/project_vulnerabilities.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/project_vulnerabilities.go @@ -49,29 +49,29 @@ var _ ProjectVulnerabilitiesServiceInterface = (*ProjectVulnerabilitiesService)( // // GitLab API docs: https://docs.gitlab.com/api/project_vulnerabilities/ type ProjectVulnerability struct { - AuthorID int `json:"author_id"` + AuthorID int64 `json:"author_id"` Confidence string `json:"confidence"` CreatedAt *time.Time `json:"created_at"` Description string `json:"description"` DismissedAt *time.Time `json:"dismissed_at"` - DismissedByID int `json:"dismissed_by_id"` + DismissedByID int64 `json:"dismissed_by_id"` DueDate *time.Time `json:"due_date"` Finding *Finding `json:"finding"` - ID int `json:"id"` + ID int64 `json:"id"` LastEditedAt *time.Time `json:"last_edited_at"` - LastEditedByID int `json:"last_edited_by_id"` + LastEditedByID int64 `json:"last_edited_by_id"` Project *Project `json:"project"` ProjectDefaultBranch string `json:"project_default_branch"` ReportType string `json:"report_type"` ResolvedAt *time.Time `json:"resolved_at"` - ResolvedByID int `json:"resolved_by_id"` + ResolvedByID int64 `json:"resolved_by_id"` ResolvedOnDefaultBranch bool `json:"resolved_on_default_branch"` Severity string `json:"severity"` StartDate *time.Time `json:"start_date"` State string `json:"state"` Title string `json:"title"` UpdatedAt *time.Time `json:"updated_at"` - UpdatedByID int `json:"updated_by_id"` + UpdatedByID int64 `json:"updated_by_id"` } // Finding represents a GitLab project vulnerability finding. @@ -81,20 +81,20 @@ type ProjectVulnerability struct { type Finding struct { Confidence string `json:"confidence"` CreatedAt *time.Time `json:"created_at"` - ID int `json:"id"` + ID int64 `json:"id"` LocationFingerprint string `json:"location_fingerprint"` MetadataVersion string `json:"metadata_version"` Name string `json:"name"` - PrimaryIdentifierID int `json:"primary_identifier_id"` + PrimaryIdentifierID int64 `json:"primary_identifier_id"` ProjectFingerprint string `json:"project_fingerprint"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` RawMetadata string `json:"raw_metadata"` ReportType string `json:"report_type"` - ScannerID int `json:"scanner_id"` + ScannerID int64 `json:"scanner_id"` Severity string `json:"severity"` UpdatedAt *time.Time `json:"updated_at"` UUID string `json:"uuid"` - VulnerabilityID int `json:"vulnerability_id"` + VulnerabilityID int64 `json:"vulnerability_id"` } // ListProjectVulnerabilitiesOptions represents the available @@ -140,7 +140,7 @@ func (s *ProjectVulnerabilitiesService) ListProjectVulnerabilities(pid any, opt // GitLab API docs: // https://docs.gitlab.com/api/project_vulnerabilities/#new-vulnerability type CreateVulnerabilityOptions struct { - FindingID *int `url:"finding_id,omitempty" json:"finding_id,omitempty"` + FindingID *int64 `url:"finding_id,omitempty" json:"finding_id,omitempty"` } // CreateVulnerability creates a new vulnerability on the selected project. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/projects.go b/vendor/gitlab.com/gitlab-org/api/client-go/projects.go index 7d1045b27..2dfbfbeb1 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/projects.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/projects.go @@ -42,29 +42,29 @@ type ( GetProjectLanguages(pid any, options ...RequestOptionFunc) (*ProjectLanguages, *Response, error) GetProject(pid any, opt *GetProjectOptions, options ...RequestOptionFunc) (*Project, *Response, error) CreateProject(opt *CreateProjectOptions, options ...RequestOptionFunc) (*Project, *Response, error) - CreateProjectForUser(user int, opt *CreateProjectForUserOptions, options ...RequestOptionFunc) (*Project, *Response, error) + CreateProjectForUser(user int64, opt *CreateProjectForUserOptions, options ...RequestOptionFunc) (*Project, *Response, error) EditProject(pid any, opt *EditProjectOptions, options ...RequestOptionFunc) (*Project, *Response, error) ForkProject(pid any, opt *ForkProjectOptions, options ...RequestOptionFunc) (*Project, *Response, error) StarProject(pid any, options ...RequestOptionFunc) (*Project, *Response, error) - ListProjectsInvitedGroups(pid any, opt *ListProjectInvidedGroupOptions, options ...RequestOptionFunc) ([]*ProjectGroup, *Response, error) + ListProjectsInvitedGroups(pid any, opt *ListProjectInvitedGroupOptions, options ...RequestOptionFunc) ([]*ProjectGroup, *Response, error) UnstarProject(pid any, options ...RequestOptionFunc) (*Project, *Response, error) ArchiveProject(pid any, options ...RequestOptionFunc) (*Project, *Response, error) UnarchiveProject(pid any, options ...RequestOptionFunc) (*Project, *Response, error) RestoreProject(pid any, options ...RequestOptionFunc) (*Project, *Response, error) DeleteProject(pid any, opt *DeleteProjectOptions, options ...RequestOptionFunc) (*Response, error) ShareProjectWithGroup(pid any, opt *ShareWithGroupOptions, options ...RequestOptionFunc) (*Response, error) - DeleteSharedProjectFromGroup(pid any, groupID int, options ...RequestOptionFunc) (*Response, error) + DeleteSharedProjectFromGroup(pid any, groupID int64, options ...RequestOptionFunc) (*Response, error) ListProjectHooks(pid any, opt *ListProjectHooksOptions, options ...RequestOptionFunc) ([]*ProjectHook, *Response, error) - GetProjectHook(pid any, hook int, options ...RequestOptionFunc) (*ProjectHook, *Response, error) + GetProjectHook(pid any, hook int64, options ...RequestOptionFunc) (*ProjectHook, *Response, error) AddProjectHook(pid any, opt *AddProjectHookOptions, options ...RequestOptionFunc) (*ProjectHook, *Response, error) - EditProjectHook(pid any, hook int, opt *EditProjectHookOptions, options ...RequestOptionFunc) (*ProjectHook, *Response, error) - DeleteProjectHook(pid any, hook int, options ...RequestOptionFunc) (*Response, error) - TriggerTestProjectHook(pid any, hook int, event ProjectHookEvent, options ...RequestOptionFunc) (*Response, error) - SetProjectCustomHeader(pid any, hook int, key string, opt *SetHookCustomHeaderOptions, options ...RequestOptionFunc) (*Response, error) - DeleteProjectCustomHeader(pid any, hook int, key string, options ...RequestOptionFunc) (*Response, error) - SetProjectWebhookURLVariable(pid any, hook int, key string, opt *SetProjectWebhookURLVariableOptions, options ...RequestOptionFunc) (*Response, error) - DeleteProjectWebhookURLVariable(pid any, hook int, key string, options ...RequestOptionFunc) (*Response, error) - CreateProjectForkRelation(pid any, fork int, options ...RequestOptionFunc) (*ProjectForkRelation, *Response, error) + EditProjectHook(pid any, hook int64, opt *EditProjectHookOptions, options ...RequestOptionFunc) (*ProjectHook, *Response, error) + DeleteProjectHook(pid any, hook int64, options ...RequestOptionFunc) (*Response, error) + TriggerTestProjectHook(pid any, hook int64, event ProjectHookEvent, options ...RequestOptionFunc) (*Response, error) + SetProjectCustomHeader(pid any, hook int64, key string, opt *SetHookCustomHeaderOptions, options ...RequestOptionFunc) (*Response, error) + DeleteProjectCustomHeader(pid any, hook int64, key string, options ...RequestOptionFunc) (*Response, error) + SetProjectWebhookURLVariable(pid any, hook int64, key string, opt *SetProjectWebhookURLVariableOptions, options ...RequestOptionFunc) (*Response, error) + DeleteProjectWebhookURLVariable(pid any, hook int64, key string, options ...RequestOptionFunc) (*Response, error) + CreateProjectForkRelation(pid any, fork int64, options ...RequestOptionFunc) (*ProjectForkRelation, *Response, error) DeleteProjectForkRelation(pid any, options ...RequestOptionFunc) (*Response, error) UploadAvatar(pid any, avatar io.Reader, filename string, options ...RequestOptionFunc) (*Project, *Response, error) DownloadAvatar(pid any, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) @@ -76,16 +76,16 @@ type ( GetApprovalConfiguration(pid any, options ...RequestOptionFunc) (*ProjectApprovals, *Response, error) ChangeApprovalConfiguration(pid any, opt *ChangeApprovalConfigurationOptions, options ...RequestOptionFunc) (*ProjectApprovals, *Response, error) GetProjectApprovalRules(pid any, opt *GetProjectApprovalRulesListsOptions, options ...RequestOptionFunc) ([]*ProjectApprovalRule, *Response, error) - GetProjectApprovalRule(pid any, ruleID int, options ...RequestOptionFunc) (*ProjectApprovalRule, *Response, error) + GetProjectApprovalRule(pid any, ruleID int64, options ...RequestOptionFunc) (*ProjectApprovalRule, *Response, error) CreateProjectApprovalRule(pid any, opt *CreateProjectLevelRuleOptions, options ...RequestOptionFunc) (*ProjectApprovalRule, *Response, error) - UpdateProjectApprovalRule(pid any, approvalRule int, opt *UpdateProjectLevelRuleOptions, options ...RequestOptionFunc) (*ProjectApprovalRule, *Response, error) - DeleteProjectApprovalRule(pid any, approvalRule int, options ...RequestOptionFunc) (*Response, error) + UpdateProjectApprovalRule(pid any, approvalRule int64, opt *UpdateProjectLevelRuleOptions, options ...RequestOptionFunc) (*ProjectApprovalRule, *Response, error) + DeleteProjectApprovalRule(pid any, approvalRule int64, options ...RequestOptionFunc) (*Response, error) GetProjectPullMirrorDetails(pid any, options ...RequestOptionFunc) (*ProjectPullMirrorDetails, *Response, error) ConfigureProjectPullMirror(pid any, opt *ConfigureProjectPullMirrorOptions, options ...RequestOptionFunc) (*ProjectPullMirrorDetails, *Response, error) StartMirroringProject(pid any, options ...RequestOptionFunc) (*Response, error) TransferProject(pid any, opt *TransferProjectOptions, options ...RequestOptionFunc) (*Project, *Response, error) StartHousekeepingProject(pid any, options ...RequestOptionFunc) (*Response, error) - GetRepositoryStorage(pid any, options ...RequestOptionFunc) (*ProjectReposityStorage, *Response, error) + GetRepositoryStorage(pid any, options ...RequestOptionFunc) (*ProjectRepositoryStorage, *Response, error) ListProjectStarrers(pid any, opts *ListProjectStarrersOptions, options ...RequestOptionFunc) ([]*ProjectStarrer, *Response, error) } @@ -104,138 +104,133 @@ var _ ProjectsServiceInterface = (*ProjectsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/projects/ type Project struct { - ID int `json:"id"` - Description string `json:"description"` - DefaultBranch string `json:"default_branch"` - Visibility VisibilityValue `json:"visibility"` - SSHURLToRepo string `json:"ssh_url_to_repo"` - HTTPURLToRepo string `json:"http_url_to_repo"` - WebURL string `json:"web_url"` - ReadmeURL string `json:"readme_url"` - Topics []string `json:"topics"` - Owner *User `json:"owner"` - Name string `json:"name"` - NameWithNamespace string `json:"name_with_namespace"` - Path string `json:"path"` - PathWithNamespace string `json:"path_with_namespace"` - OpenIssuesCount int `json:"open_issues_count"` - ResolveOutdatedDiffDiscussions bool `json:"resolve_outdated_diff_discussions"` - ContainerExpirationPolicy *ContainerExpirationPolicy `json:"container_expiration_policy,omitempty"` - ContainerRegistryAccessLevel AccessControlValue `json:"container_registry_access_level"` - ContainerRegistryImagePrefix string `json:"container_registry_image_prefix,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` - LastActivityAt *time.Time `json:"last_activity_at,omitempty"` - CreatorID int `json:"creator_id"` - Namespace *ProjectNamespace `json:"namespace"` - Permissions *Permissions `json:"permissions"` - MarkedForDeletionOn *ISOTime `json:"marked_for_deletion_on"` - EmptyRepo bool `json:"empty_repo"` - Archived bool `json:"archived"` - AvatarURL string `json:"avatar_url"` - LicenseURL string `json:"license_url"` - License *ProjectLicense `json:"license"` - SharedRunnersEnabled bool `json:"shared_runners_enabled"` - GroupRunnersEnabled bool `json:"group_runners_enabled"` - ResourceGroupDefaultProcessMode ResourceGroupProcessMode `json:"resource_group_default_process_mode"` - RunnerTokenExpirationInterval int `json:"runner_token_expiration_interval"` - ForksCount int `json:"forks_count"` - StarCount int `json:"star_count"` - RunnersToken string `json:"runners_token"` - AllowMergeOnSkippedPipeline bool `json:"allow_merge_on_skipped_pipeline"` - AllowPipelineTriggerApproveDeployment bool `json:"allow_pipeline_trigger_approve_deployment"` - OnlyAllowMergeIfPipelineSucceeds bool `json:"only_allow_merge_if_pipeline_succeeds"` - OnlyAllowMergeIfAllDiscussionsAreResolved bool `json:"only_allow_merge_if_all_discussions_are_resolved"` - RemoveSourceBranchAfterMerge bool `json:"remove_source_branch_after_merge"` - PreventMergeWithoutJiraIssue bool `json:"prevent_merge_without_jira_issue"` - PrintingMergeRequestLinkEnabled bool `json:"printing_merge_request_link_enabled"` - LFSEnabled bool `json:"lfs_enabled"` - RepositoryStorage string `json:"repository_storage"` - RequestAccessEnabled bool `json:"request_access_enabled"` - MergeMethod MergeMethodValue `json:"merge_method"` - CanCreateMergeRequestIn bool `json:"can_create_merge_request_in"` - ForkedFromProject *ForkParent `json:"forked_from_project"` - Mirror bool `json:"mirror"` - MirrorUserID int `json:"mirror_user_id"` - MirrorTriggerBuilds bool `json:"mirror_trigger_builds"` - OnlyMirrorProtectedBranches bool `json:"only_mirror_protected_branches"` - MirrorOverwritesDivergedBranches bool `json:"mirror_overwrites_diverged_branches"` - PackagesEnabled bool `json:"packages_enabled"` - ServiceDeskEnabled bool `json:"service_desk_enabled"` - ServiceDeskAddress string `json:"service_desk_address"` - IssuesAccessLevel AccessControlValue `json:"issues_access_level"` - ReleasesAccessLevel AccessControlValue `json:"releases_access_level,omitempty"` - RepositoryAccessLevel AccessControlValue `json:"repository_access_level"` - MergeRequestsAccessLevel AccessControlValue `json:"merge_requests_access_level"` - ForkingAccessLevel AccessControlValue `json:"forking_access_level"` - WikiAccessLevel AccessControlValue `json:"wiki_access_level"` - BuildsAccessLevel AccessControlValue `json:"builds_access_level"` - SnippetsAccessLevel AccessControlValue `json:"snippets_access_level"` - PagesAccessLevel AccessControlValue `json:"pages_access_level"` - OperationsAccessLevel AccessControlValue `json:"operations_access_level"` - AnalyticsAccessLevel AccessControlValue `json:"analytics_access_level"` - EnvironmentsAccessLevel AccessControlValue `json:"environments_access_level"` - FeatureFlagsAccessLevel AccessControlValue `json:"feature_flags_access_level"` - InfrastructureAccessLevel AccessControlValue `json:"infrastructure_access_level"` - MonitorAccessLevel AccessControlValue `json:"monitor_access_level"` - AutocloseReferencedIssues bool `json:"autoclose_referenced_issues"` - SuggestionCommitMessage string `json:"suggestion_commit_message"` - SquashOption SquashOptionValue `json:"squash_option"` - EnforceAuthChecksOnUploads bool `json:"enforce_auth_checks_on_uploads,omitempty"` - SharedWithGroups []struct { - GroupID int `json:"group_id"` - GroupName string `json:"group_name"` - GroupFullPath string `json:"group_full_path"` - GroupAccessLevel int `json:"group_access_level"` - } `json:"shared_with_groups"` - Statistics *Statistics `json:"statistics"` - Links *Links `json:"_links,omitempty"` - ImportURL string `json:"import_url"` - ImportType string `json:"import_type"` - ImportStatus string `json:"import_status"` - ImportError string `json:"import_error"` - CIDefaultGitDepth int `json:"ci_default_git_depth"` - CIDeletePipelinesInSeconds int `json:"ci_delete_pipelines_in_seconds,omitempty"` - CIForwardDeploymentEnabled bool `json:"ci_forward_deployment_enabled"` - CIForwardDeploymentRollbackAllowed bool `json:"ci_forward_deployment_rollback_allowed"` - CIPushRepositoryForJobTokenAllowed bool `json:"ci_push_repository_for_job_token_allowed"` - CIIdTokenSubClaimComponents []string `json:"ci_id_token_sub_claim_components"` - CISeperateCache bool `json:"ci_separated_caches"` - CIJobTokenScopeEnabled bool `json:"ci_job_token_scope_enabled"` - CIOptInJWT bool `json:"ci_opt_in_jwt"` - CIAllowForkPipelinesToRunInParentProject bool `json:"ci_allow_fork_pipelines_to_run_in_parent_project"` - CIRestrictPipelineCancellationRole AccessControlValue `json:"ci_restrict_pipeline_cancellation_role"` - PublicJobs bool `json:"public_jobs"` - BuildTimeout int `json:"build_timeout"` - AutoCancelPendingPipelines string `json:"auto_cancel_pending_pipelines"` - CIConfigPath string `json:"ci_config_path"` - CustomAttributes []*CustomAttribute `json:"custom_attributes"` - ComplianceFrameworks []string `json:"compliance_frameworks"` - BuildCoverageRegex string `json:"build_coverage_regex"` - IssuesTemplate string `json:"issues_template"` - MergeRequestsTemplate string `json:"merge_requests_template"` - IssueBranchTemplate string `json:"issue_branch_template"` - KeepLatestArtifact bool `json:"keep_latest_artifact"` - MergePipelinesEnabled bool `json:"merge_pipelines_enabled"` - MergeTrainsEnabled bool `json:"merge_trains_enabled"` - MergeTrainsSkipTrainAllowed bool `json:"merge_trains_skip_train_allowed"` - CIPipelineVariablesMinimumOverrideRole CIPipelineVariablesMinimumOverrideRoleValue `json:"ci_pipeline_variables_minimum_override_role"` - MergeCommitTemplate string `json:"merge_commit_template"` - SquashCommitTemplate string `json:"squash_commit_template"` - AutoDevopsDeployStrategy string `json:"auto_devops_deploy_strategy"` - AutoDevopsEnabled bool `json:"auto_devops_enabled"` - BuildGitStrategy string `json:"build_git_strategy"` - EmailsEnabled bool `json:"emails_enabled"` - ExternalAuthorizationClassificationLabel string `json:"external_authorization_classification_label"` - RequirementsEnabled bool `json:"requirements_enabled"` - RequirementsAccessLevel AccessControlValue `json:"requirements_access_level"` - SecurityAndComplianceEnabled bool `json:"security_and_compliance_enabled"` - SecurityAndComplianceAccessLevel AccessControlValue `json:"security_and_compliance_access_level"` - MergeRequestDefaultTargetSelf bool `json:"mr_default_target_self"` - ModelExperimentsAccessLevel AccessControlValue `json:"model_experiments_access_level"` - ModelRegistryAccessLevel AccessControlValue `json:"model_registry_access_level"` - PreReceiveSecretDetectionEnabled bool `json:"pre_receive_secret_detection_enabled"` - AutoDuoCodeReviewEnabled bool `json:"auto_duo_code_review_enabled"` + ID int64 `json:"id"` + Description string `json:"description"` + DefaultBranch string `json:"default_branch"` + Visibility VisibilityValue `json:"visibility"` + SSHURLToRepo string `json:"ssh_url_to_repo"` + HTTPURLToRepo string `json:"http_url_to_repo"` + WebURL string `json:"web_url"` + ReadmeURL string `json:"readme_url"` + Topics []string `json:"topics"` + Owner *User `json:"owner"` + Name string `json:"name"` + NameWithNamespace string `json:"name_with_namespace"` + Path string `json:"path"` + PathWithNamespace string `json:"path_with_namespace"` + OpenIssuesCount int64 `json:"open_issues_count"` + ResolveOutdatedDiffDiscussions bool `json:"resolve_outdated_diff_discussions"` + ContainerExpirationPolicy *ContainerExpirationPolicy `json:"container_expiration_policy,omitempty"` + ContainerRegistryAccessLevel AccessControlValue `json:"container_registry_access_level"` + ContainerRegistryImagePrefix string `json:"container_registry_image_prefix,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + LastActivityAt *time.Time `json:"last_activity_at,omitempty"` + CreatorID int64 `json:"creator_id"` + Namespace *ProjectNamespace `json:"namespace"` + Permissions *Permissions `json:"permissions"` + MarkedForDeletionOn *ISOTime `json:"marked_for_deletion_on"` + EmptyRepo bool `json:"empty_repo"` + Archived bool `json:"archived"` + AvatarURL string `json:"avatar_url"` + LicenseURL string `json:"license_url"` + License *ProjectLicense `json:"license"` + SharedRunnersEnabled bool `json:"shared_runners_enabled"` + GroupRunnersEnabled bool `json:"group_runners_enabled"` + ResourceGroupDefaultProcessMode ResourceGroupProcessMode `json:"resource_group_default_process_mode"` + RunnerTokenExpirationInterval int64 `json:"runner_token_expiration_interval"` + ForksCount int64 `json:"forks_count"` + StarCount int64 `json:"star_count"` + RunnersToken string `json:"runners_token"` + AllowMergeOnSkippedPipeline bool `json:"allow_merge_on_skipped_pipeline"` + AllowPipelineTriggerApproveDeployment bool `json:"allow_pipeline_trigger_approve_deployment"` + OnlyAllowMergeIfPipelineSucceeds bool `json:"only_allow_merge_if_pipeline_succeeds"` + OnlyAllowMergeIfAllDiscussionsAreResolved bool `json:"only_allow_merge_if_all_discussions_are_resolved"` + RemoveSourceBranchAfterMerge bool `json:"remove_source_branch_after_merge"` + PreventMergeWithoutJiraIssue bool `json:"prevent_merge_without_jira_issue"` + PrintingMergeRequestLinkEnabled bool `json:"printing_merge_request_link_enabled"` + LFSEnabled bool `json:"lfs_enabled"` + RepositoryStorage string `json:"repository_storage"` + RequestAccessEnabled bool `json:"request_access_enabled"` + MergeMethod MergeMethodValue `json:"merge_method"` + CanCreateMergeRequestIn bool `json:"can_create_merge_request_in"` + ForkedFromProject *ForkParent `json:"forked_from_project"` + Mirror bool `json:"mirror"` + MirrorUserID int64 `json:"mirror_user_id"` + MirrorTriggerBuilds bool `json:"mirror_trigger_builds"` + OnlyMirrorProtectedBranches bool `json:"only_mirror_protected_branches"` + MirrorOverwritesDivergedBranches bool `json:"mirror_overwrites_diverged_branches"` + PackagesEnabled bool `json:"packages_enabled"` + ServiceDeskEnabled bool `json:"service_desk_enabled"` + ServiceDeskAddress string `json:"service_desk_address"` + IssuesAccessLevel AccessControlValue `json:"issues_access_level"` + ReleasesAccessLevel AccessControlValue `json:"releases_access_level,omitempty"` + RepositoryAccessLevel AccessControlValue `json:"repository_access_level"` + MergeRequestsAccessLevel AccessControlValue `json:"merge_requests_access_level"` + ForkingAccessLevel AccessControlValue `json:"forking_access_level"` + WikiAccessLevel AccessControlValue `json:"wiki_access_level"` + BuildsAccessLevel AccessControlValue `json:"builds_access_level"` + SnippetsAccessLevel AccessControlValue `json:"snippets_access_level"` + PagesAccessLevel AccessControlValue `json:"pages_access_level"` + OperationsAccessLevel AccessControlValue `json:"operations_access_level"` + AnalyticsAccessLevel AccessControlValue `json:"analytics_access_level"` + EnvironmentsAccessLevel AccessControlValue `json:"environments_access_level"` + FeatureFlagsAccessLevel AccessControlValue `json:"feature_flags_access_level"` + InfrastructureAccessLevel AccessControlValue `json:"infrastructure_access_level"` + MonitorAccessLevel AccessControlValue `json:"monitor_access_level"` + AutocloseReferencedIssues bool `json:"autoclose_referenced_issues"` + SuggestionCommitMessage string `json:"suggestion_commit_message"` + SquashOption SquashOptionValue `json:"squash_option"` + EnforceAuthChecksOnUploads bool `json:"enforce_auth_checks_on_uploads,omitempty"` + SharedWithGroups []ProjectSharedWithGroup `json:"shared_with_groups"` + Statistics *Statistics `json:"statistics"` + Links *Links `json:"_links,omitempty"` + ImportURL string `json:"import_url"` + ImportType string `json:"import_type"` + ImportStatus string `json:"import_status"` + ImportError string `json:"import_error"` + CIDefaultGitDepth int64 `json:"ci_default_git_depth"` + CIDeletePipelinesInSeconds int64 `json:"ci_delete_pipelines_in_seconds,omitempty"` + CIForwardDeploymentEnabled bool `json:"ci_forward_deployment_enabled"` + CIForwardDeploymentRollbackAllowed bool `json:"ci_forward_deployment_rollback_allowed"` + CIPushRepositoryForJobTokenAllowed bool `json:"ci_push_repository_for_job_token_allowed"` + CIIdTokenSubClaimComponents []string `json:"ci_id_token_sub_claim_components"` + CISeparatedCaches bool `json:"ci_separated_caches"` + CIJobTokenScopeEnabled bool `json:"ci_job_token_scope_enabled"` + CIOptInJWT bool `json:"ci_opt_in_jwt"` + CIAllowForkPipelinesToRunInParentProject bool `json:"ci_allow_fork_pipelines_to_run_in_parent_project"` + CIRestrictPipelineCancellationRole AccessControlValue `json:"ci_restrict_pipeline_cancellation_role"` + PublicJobs bool `json:"public_jobs"` + BuildTimeout int64 `json:"build_timeout"` + AutoCancelPendingPipelines string `json:"auto_cancel_pending_pipelines"` + CIConfigPath string `json:"ci_config_path"` + CustomAttributes []*CustomAttribute `json:"custom_attributes"` + ComplianceFrameworks []string `json:"compliance_frameworks"` + BuildCoverageRegex string `json:"build_coverage_regex"` + IssuesTemplate string `json:"issues_template"` + MergeRequestsTemplate string `json:"merge_requests_template"` + IssueBranchTemplate string `json:"issue_branch_template"` + KeepLatestArtifact bool `json:"keep_latest_artifact"` + MergePipelinesEnabled bool `json:"merge_pipelines_enabled"` + MergeTrainsEnabled bool `json:"merge_trains_enabled"` + MergeTrainsSkipTrainAllowed bool `json:"merge_trains_skip_train_allowed"` + CIPipelineVariablesMinimumOverrideRole CIPipelineVariablesMinimumOverrideRoleValue `json:"ci_pipeline_variables_minimum_override_role"` + MergeCommitTemplate string `json:"merge_commit_template"` + SquashCommitTemplate string `json:"squash_commit_template"` + AutoDevopsDeployStrategy string `json:"auto_devops_deploy_strategy"` + AutoDevopsEnabled bool `json:"auto_devops_enabled"` + BuildGitStrategy string `json:"build_git_strategy"` + EmailsEnabled bool `json:"emails_enabled"` + ExternalAuthorizationClassificationLabel string `json:"external_authorization_classification_label"` + RequirementsEnabled bool `json:"requirements_enabled"` + RequirementsAccessLevel AccessControlValue `json:"requirements_access_level"` + SecurityAndComplianceEnabled bool `json:"security_and_compliance_enabled"` + SecurityAndComplianceAccessLevel AccessControlValue `json:"security_and_compliance_access_level"` + MergeRequestDefaultTargetSelf bool `json:"mr_default_target_self"` + ModelExperimentsAccessLevel AccessControlValue `json:"model_experiments_access_level"` + ModelRegistryAccessLevel AccessControlValue `json:"model_registry_access_level"` + PreReceiveSecretDetectionEnabled bool `json:"pre_receive_secret_detection_enabled"` + AutoDuoCodeReviewEnabled bool `json:"auto_duo_code_review_enabled"` // Deprecated: use Topics instead TagList []string `json:"tag_list"` @@ -244,7 +239,7 @@ type Project struct { // Deprecated: use MergeRequestsAccessLevel instead MergeRequestsEnabled bool `json:"merge_requests_enabled"` // Deprecated: use Merge Request Approvals API instead - ApprovalsBeforeMerge int `json:"approvals_before_merge"` + ApprovalsBeforeMerge int64 `json:"approvals_before_merge"` // Deprecated: use BuildsAccessLevel instead JobsEnabled bool `json:"jobs_enabled"` // Deprecated: use WikiAccessLevel instead @@ -263,9 +258,19 @@ type Project struct { PublicBuilds bool `json:"public_builds"` } +// ProjectSharedWithGroup represents a GitLab project shared group. +// +// GitLab API docs: https://docs.gitlab.com/api/projects/ +type ProjectSharedWithGroup struct { + GroupID int64 `json:"group_id"` + GroupName string `json:"group_name"` + GroupFullPath string `json:"group_full_path"` + GroupAccessLevel int64 `json:"group_access_level"` +} + // BasicProject included in other service responses (such as todos). type BasicProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` Name string `json:"name"` NameWithNamespace string `json:"name_with_namespace"` @@ -277,7 +282,7 @@ type BasicProject struct { // ContainerExpirationPolicy represents the container expiration policy. type ContainerExpirationPolicy struct { Cadence string `json:"cadence"` - KeepN int `json:"keep_n"` + KeepN int64 `json:"keep_n"` OlderThan string `json:"older_than"` NameRegexDelete string `json:"name_regex_delete"` NameRegexKeep string `json:"name_regex_keep"` @@ -290,7 +295,7 @@ type ContainerExpirationPolicy struct { // ForkParent represents the parent project when this is a fork. type ForkParent struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` NameWithNamespace string `json:"name_with_namespace"` Path string `json:"path"` @@ -342,12 +347,12 @@ type ProjectLicense struct { // ProjectNamespace represents a project namespace. type ProjectNamespace struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Path string `json:"path"` Kind string `json:"kind"` FullPath string `json:"full_path"` - ParentID int `json:"parent_id"` + ParentID int64 `json:"parent_id"` AvatarURL string `json:"avatar_url"` WebURL string `json:"web_url"` } @@ -394,12 +399,12 @@ func (s Project) String() string { // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#get-all-approval-rules-for-project type ProjectApprovalRule struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` RuleType string `json:"rule_type"` ReportType string `json:"report_type"` EligibleApprovers []*BasicUser `json:"eligible_approvers"` - ApprovalsRequired int `json:"approvals_required"` + ApprovalsRequired int64 `json:"approvals_required"` Users []*BasicUser `json:"users"` Groups []*Group `json:"groups"` ContainsHiddenGroups bool `json:"contains_hidden_groups"` @@ -418,8 +423,8 @@ type ListProjectsOptions struct { ListOptions Active *bool `url:"active,omitempty" json:"active,omitempty"` Archived *bool `url:"archived,omitempty" json:"archived,omitempty"` - IDAfter *int `url:"id_after,omitempty" json:"id_after,omitempty"` - IDBefore *int `url:"id_before,omitempty" json:"id_before,omitempty"` + IDAfter *int64 `url:"id_after,omitempty" json:"id_after,omitempty"` + IDBefore *int64 `url:"id_before,omitempty" json:"id_before,omitempty"` Imported *bool `url:"imported,omitempty" json:"imported,omitempty"` IncludeHidden *bool `url:"include_hidden,omitempty" json:"include_hidden,omitempty"` IncludePendingDelete *bool `url:"include_pending_delete,omitempty" json:"include_pending_delete,omitempty"` @@ -541,7 +546,7 @@ func (s *ProjectsService) ListUserStarredProjects(uid any, opt *ListProjectsOpti // ProjectUser represents a GitLab project user. type ProjectUser struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Username string `json:"username"` State string `json:"state"` @@ -585,7 +590,7 @@ func (s *ProjectsService) ListProjectsUsers(pid any, opt *ListProjectUserOptions // ProjectGroup represents a GitLab project group. // GitLab API docs: https://docs.gitlab.com/api/projects/#list-groups type ProjectGroup struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` AvatarURL string `json:"avatar_url"` WebURL string `json:"web_url"` @@ -600,8 +605,8 @@ type ListProjectGroupOptions struct { ListOptions Search *string `url:"search,omitempty" json:"search,omitempty"` SharedMinAccessLevel *AccessLevelValue `url:"shared_min_access_level,omitempty" json:"shared_min_access_level,omitempty"` - SharedVisiableOnly *bool `url:"shared_visible_only,omitempty" json:"shared_visible_only,omitempty"` - SkipGroups *[]int `url:"skip_groups,omitempty" json:"skip_groups,omitempty"` + SharedVisibleOnly *bool `url:"shared_visible_only,omitempty" json:"shared_visible_only,omitempty"` + SkipGroups *[]int64 `url:"skip_groups,omitempty" json:"skip_groups,omitempty"` WithShared *bool `url:"with_shared,omitempty" json:"with_shared,omitempty"` } @@ -710,7 +715,7 @@ type CreateProjectOptions struct { Avatar *ProjectAvatar `url:"-" json:"-"` BuildCoverageRegex *string `url:"build_coverage_regex,omitempty" json:"build_coverage_regex,omitempty"` BuildGitStrategy *string `url:"build_git_strategy,omitempty" json:"build_git_strategy,omitempty"` - BuildTimeout *int `url:"build_timeout,omitempty" json:"build_timeout,omitempty"` + BuildTimeout *int64 `url:"build_timeout,omitempty" json:"build_timeout,omitempty"` BuildsAccessLevel *AccessControlValue `url:"builds_access_level,omitempty" json:"builds_access_level,omitempty"` CIConfigPath *string `url:"ci_config_path,omitempty" json:"ci_config_path,omitempty"` ContainerExpirationPolicyAttributes *ContainerExpirationPolicyAttributes `url:"container_expiration_policy_attributes,omitempty" json:"container_expiration_policy_attributes,omitempty"` @@ -721,7 +726,7 @@ type CreateProjectOptions struct { EnforceAuthChecksOnUploads *bool `url:"enforce_auth_checks_on_uploads,omitempty" json:"enforce_auth_checks_on_uploads,omitempty"` ExternalAuthorizationClassificationLabel *string `url:"external_authorization_classification_label,omitempty" json:"external_authorization_classification_label,omitempty"` ForkingAccessLevel *AccessControlValue `url:"forking_access_level,omitempty" json:"forking_access_level,omitempty"` - GroupWithProjectTemplatesID *int `url:"group_with_project_templates_id,omitempty" json:"group_with_project_templates_id,omitempty"` + GroupWithProjectTemplatesID *int64 `url:"group_with_project_templates_id,omitempty" json:"group_with_project_templates_id,omitempty"` ImportURL *string `url:"import_url,omitempty" json:"import_url,omitempty"` InitializeWithReadme *bool `url:"initialize_with_readme,omitempty" json:"initialize_with_readme,omitempty"` IssuesAccessLevel *AccessControlValue `url:"issues_access_level,omitempty" json:"issues_access_level,omitempty"` @@ -738,7 +743,7 @@ type CreateProjectOptions struct { ModelExperimentsAccessLevel *AccessControlValue `url:"model_experiments_access_level,omitempty" json:"model_experiments_access_level,omitempty"` ModelRegistryAccessLevel *AccessControlValue `url:"model_registry_access_level,omitempty" json:"model_registry_access_level,omitempty"` Name *string `url:"name,omitempty" json:"name,omitempty"` - NamespaceID *int `url:"namespace_id,omitempty" json:"namespace_id,omitempty"` + NamespaceID *int64 `url:"namespace_id,omitempty" json:"namespace_id,omitempty"` OnlyAllowMergeIfAllDiscussionsAreResolved *bool `url:"only_allow_merge_if_all_discussions_are_resolved,omitempty" json:"only_allow_merge_if_all_discussions_are_resolved,omitempty"` OnlyAllowMergeIfPipelineSucceeds *bool `url:"only_allow_merge_if_pipeline_succeeds,omitempty" json:"only_allow_merge_if_pipeline_succeeds,omitempty"` OperationsAccessLevel *AccessControlValue `url:"operations_access_level,omitempty" json:"operations_access_level,omitempty"` @@ -767,14 +772,14 @@ type CreateProjectOptions struct { SquashOption *SquashOptionValue `url:"squash_option,omitempty" json:"squash_option,omitempty"` SuggestionCommitMessage *string `url:"suggestion_commit_message,omitempty" json:"suggestion_commit_message,omitempty"` TemplateName *string `url:"template_name,omitempty" json:"template_name,omitempty"` - TemplateProjectID *int `url:"template_project_id,omitempty" json:"template_project_id,omitempty"` + TemplateProjectID *int64 `url:"template_project_id,omitempty" json:"template_project_id,omitempty"` Topics *[]string `url:"topics,omitempty" json:"topics,omitempty"` UseCustomTemplate *bool `url:"use_custom_template,omitempty" json:"use_custom_template,omitempty"` Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"` WikiAccessLevel *AccessControlValue `url:"wiki_access_level,omitempty" json:"wiki_access_level,omitempty"` // Deprecated: use Merge Request Approvals API instead - ApprovalsBeforeMerge *int `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` + ApprovalsBeforeMerge *int64 `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` // Deprecated: use PublicJobs instead PublicBuilds *bool `url:"public_builds,omitempty" json:"public_builds,omitempty"` // Deprecated: No longer supported in recent versions. @@ -809,7 +814,7 @@ type CreateProjectOptions struct { // GitLab API docs: https://docs.gitlab.com/api/projects/#create-a-project type ContainerExpirationPolicyAttributes struct { Cadence *string `url:"cadence,omitempty" json:"cadence,omitempty"` - KeepN *int `url:"keep_n,omitempty" json:"keep_n,omitempty"` + KeepN *int64 `url:"keep_n,omitempty" json:"keep_n,omitempty"` OlderThan *string `url:"older_than,omitempty" json:"older_than,omitempty"` NameRegexDelete *string `url:"name_regex_delete,omitempty" json:"name_regex_delete,omitempty"` NameRegexKeep *string `url:"name_regex_keep,omitempty" json:"name_regex_keep,omitempty"` @@ -887,7 +892,7 @@ type CreateProjectForUserOptions CreateProjectOptions // // GitLab API docs: // https://docs.gitlab.com/api/projects/#create-a-project-for-a-user -func (s *ProjectsService) CreateProjectForUser(user int, opt *CreateProjectForUserOptions, options ...RequestOptionFunc) (*Project, *Response, error) { +func (s *ProjectsService) CreateProjectForUser(user int64, opt *CreateProjectForUserOptions, options ...RequestOptionFunc) (*Project, *Response, error) { if opt.ContainerExpirationPolicyAttributes != nil { // This is needed to satisfy the API. Should be deleted // when NameRegex is removed (it's now deprecated). @@ -940,16 +945,16 @@ type EditProjectOptions struct { Avatar *ProjectAvatar `url:"-" json:"avatar,omitempty"` BuildCoverageRegex *string `url:"build_coverage_regex,omitempty" json:"build_coverage_regex,omitempty"` BuildGitStrategy *string `url:"build_git_strategy,omitempty" json:"build_git_strategy,omitempty"` - BuildTimeout *int `url:"build_timeout,omitempty" json:"build_timeout,omitempty"` + BuildTimeout *int64 `url:"build_timeout,omitempty" json:"build_timeout,omitempty"` BuildsAccessLevel *AccessControlValue `url:"builds_access_level,omitempty" json:"builds_access_level,omitempty"` CIConfigPath *string `url:"ci_config_path,omitempty" json:"ci_config_path,omitempty"` - CIDefaultGitDepth *int `url:"ci_default_git_depth,omitempty" json:"ci_default_git_depth,omitempty"` - CIDeletePipelinesInSeconds *int `url:"ci_delete_pipelines_in_seconds,omitempty" json:"ci_delete_pipelines_in_seconds,omitempty"` + CIDefaultGitDepth *int64 `url:"ci_default_git_depth,omitempty" json:"ci_default_git_depth,omitempty"` + CIDeletePipelinesInSeconds *int64 `url:"ci_delete_pipelines_in_seconds,omitempty" json:"ci_delete_pipelines_in_seconds,omitempty"` CIForwardDeploymentEnabled *bool `url:"ci_forward_deployment_enabled,omitempty" json:"ci_forward_deployment_enabled,omitempty"` CIForwardDeploymentRollbackAllowed *bool `url:"ci_forward_deployment_rollback_allowed,omitempty" json:"ci_forward_deployment_rollback_allowed,omitempty"` CIPushRepositoryForJobTokenAllowed *bool `url:"ci_push_repository_for_job_token_allowed,omitempty" json:"ci_push_repository_for_job_token_allowed,omitempty"` CIIdTokenSubClaimComponents *[]string `url:"ci_id_token_sub_claim_components,omitempty" json:"ci_id_token_sub_claim_components,omitempty"` - CISeperateCache *bool `url:"ci_separated_caches,omitempty" json:"ci_separated_caches,omitempty"` + CISeparatedCaches *bool `url:"ci_separated_caches,omitempty" json:"ci_separated_caches,omitempty"` CIRestrictPipelineCancellationRole *AccessControlValue `url:"ci_restrict_pipeline_cancellation_role,omitempty" json:"ci_restrict_pipeline_cancellation_role,omitempty"` CIPipelineVariablesMinimumOverrideRole *CIPipelineVariablesMinimumOverrideRoleValue `url:"ci_pipeline_variables_minimum_override_role,omitempty" json:"ci_pipeline_variables_minimum_override_role,omitempty"` ContainerExpirationPolicyAttributes *ContainerExpirationPolicyAttributes `url:"container_expiration_policy_attributes,omitempty" json:"container_expiration_policy_attributes,omitempty"` @@ -978,7 +983,7 @@ type EditProjectOptions struct { MirrorBranchRegex *string `url:"mirror_branch_regex,omitempty" json:"mirror_branch_regex,omitempty"` MirrorOverwritesDivergedBranches *bool `url:"mirror_overwrites_diverged_branches,omitempty" json:"mirror_overwrites_diverged_branches,omitempty"` MirrorTriggerBuilds *bool `url:"mirror_trigger_builds,omitempty" json:"mirror_trigger_builds,omitempty"` - MirrorUserID *int `url:"mirror_user_id,omitempty" json:"mirror_user_id,omitempty"` + MirrorUserID *int64 `url:"mirror_user_id,omitempty" json:"mirror_user_id,omitempty"` ModelExperimentsAccessLevel *AccessControlValue `url:"model_experiments_access_level,omitempty" json:"model_experiments_access_level,omitempty"` ModelRegistryAccessLevel *AccessControlValue `url:"model_registry_access_level,omitempty" json:"model_registry_access_level,omitempty"` Name *string `url:"name,omitempty" json:"name,omitempty"` @@ -1018,7 +1023,7 @@ type EditProjectOptions struct { WikiAccessLevel *AccessControlValue `url:"wiki_access_level,omitempty" json:"wiki_access_level,omitempty"` // Deprecated: use Merge Request Approvals API instead - ApprovalsBeforeMerge *int `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` + ApprovalsBeforeMerge *int64 `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` // Deprecated: use PublicJobs instead PublicBuilds *bool `url:"public_builds,omitempty" json:"public_builds,omitempty"` // Deprecated: use CIPipelineVariablesMinimumOverrideRole instead @@ -1094,7 +1099,7 @@ type ForkProjectOptions struct { Description *string `url:"description,omitempty" json:"description,omitempty"` MergeRequestDefaultTargetSelf *bool `url:"mr_default_target_self,omitempty" json:"mr_default_target_self,omitempty"` Name *string `url:"name,omitempty" json:"name,omitempty"` - NamespaceID *int `url:"namespace_id,omitempty" json:"namespace_id,omitempty"` + NamespaceID *int64 `url:"namespace_id,omitempty" json:"namespace_id,omitempty"` NamespacePath *string `url:"namespace_path,omitempty" json:"namespace_path,omitempty"` Path *string `url:"path,omitempty" json:"path,omitempty"` Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"` @@ -1167,16 +1172,11 @@ type ListProjectInvitedGroupOptions struct { WithCustomAttributes *bool `url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"` } -// ListProjectInvidedGroupOptions is kept for backwards compatibility. -// -// Deprecated: use ListProjectInvitedGroupOptions instead. The ListProjectInvidedGroupOptions type will be removed in the next release. -type ListProjectInvidedGroupOptions = ListProjectInvitedGroupOptions - // ListProjectsInvitedGroups lists invited groups of a project // // GitLab API docs: // https://docs.gitlab.com/api/projects/#list-a-projects-invited-groups -func (s *ProjectsService) ListProjectsInvitedGroups(pid any, opt *ListProjectInvidedGroupOptions, options ...RequestOptionFunc) ([]*ProjectGroup, *Response, error) { +func (s *ProjectsService) ListProjectsInvitedGroups(pid any, opt *ListProjectInvitedGroupOptions, options ...RequestOptionFunc) ([]*ProjectGroup, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1334,7 +1334,7 @@ func (s *ProjectsService) DeleteProject(pid any, opt *DeleteProjectOptions, opti type ShareWithGroupOptions struct { ExpiresAt *string `url:"expires_at" json:"expires_at"` GroupAccess *AccessLevelValue `url:"group_access" json:"group_access"` - GroupID *int `url:"group_id" json:"group_id"` + GroupID *int64 `url:"group_id" json:"group_id"` } // ShareProjectWithGroup allows to share a project with a group. @@ -1359,7 +1359,7 @@ func (s *ProjectsService) ShareProjectWithGroup(pid any, opt *ShareWithGroupOpti // // GitLab API docs: // https://docs.gitlab.com/api/projects/#delete-a-shared-project-link-in-a-group -func (s *ProjectsService) DeleteSharedProjectFromGroup(pid any, groupID int, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectsService) DeleteSharedProjectFromGroup(pid any, groupID int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -1394,11 +1394,11 @@ type HookURLVariable struct { // GitLab API docs: // https://docs.gitlab.com/api/project_webhooks/#list-webhooks-for-a-project type ProjectHook struct { - ID int `json:"id"` + ID int64 `json:"id"` URL string `json:"url"` Name string `json:"name"` Description string `json:"description"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` PushEvents bool `json:"push_events"` PushEventsBranchFilter string `json:"push_events_branch_filter"` IssuesEvents bool `json:"issues_events"` @@ -1429,7 +1429,9 @@ type ProjectHook struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_webhooks/#list-webhooks-for-a-project -type ListProjectHooksOptions ListOptions +type ListProjectHooksOptions struct { + ListOptions +} // ListProjectHooks gets a list of project hooks. // @@ -1460,7 +1462,7 @@ func (s *ProjectsService) ListProjectHooks(pid any, opt *ListProjectHooksOptions // // GitLab API docs: // https://docs.gitlab.com/api/project_webhooks/#get-a-project-webhook -func (s *ProjectsService) GetProjectHook(pid any, hook int, options ...RequestOptionFunc) (*ProjectHook, *Response, error) { +func (s *ProjectsService) GetProjectHook(pid any, hook int64, options ...RequestOptionFunc) (*ProjectHook, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1566,7 +1568,7 @@ type EditProjectHookOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_webhooks/#edit-a-project-webhook -func (s *ProjectsService) EditProjectHook(pid any, hook int, opt *EditProjectHookOptions, options ...RequestOptionFunc) (*ProjectHook, *Response, error) { +func (s *ProjectsService) EditProjectHook(pid any, hook int64, opt *EditProjectHookOptions, options ...RequestOptionFunc) (*ProjectHook, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1592,7 +1594,7 @@ func (s *ProjectsService) EditProjectHook(pid any, hook int, opt *EditProjectHoo // // GitLab API docs: // https://docs.gitlab.com/api/project_webhooks/#delete-project-webhook -func (s *ProjectsService) DeleteProjectHook(pid any, hook int, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectsService) DeleteProjectHook(pid any, hook int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -1619,7 +1621,7 @@ func (s *ProjectsService) DeleteProjectHook(pid any, hook int, options ...Reques // // GitLab API docs: // https://docs.gitlab.com/api/project_webhooks/#trigger-a-test-project-webhook -func (s *ProjectsService) TriggerTestProjectHook(pid any, hook int, event ProjectHookEvent, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectsService) TriggerTestProjectHook(pid any, hook int64, event ProjectHookEvent, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -1647,7 +1649,7 @@ type SetHookCustomHeaderOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_webhooks/#set-a-custom-header -func (s *ProjectsService) SetProjectCustomHeader(pid any, hook int, key string, opt *SetHookCustomHeaderOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectsService) SetProjectCustomHeader(pid any, hook int64, key string, opt *SetHookCustomHeaderOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -1666,7 +1668,7 @@ func (s *ProjectsService) SetProjectCustomHeader(pid any, hook int, key string, // // GitLab API docs: // https://docs.gitlab.com/api/project_webhooks/#delete-a-custom-header -func (s *ProjectsService) DeleteProjectCustomHeader(pid any, hook int, key string, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectsService) DeleteProjectCustomHeader(pid any, hook int64, key string, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -1694,7 +1696,7 @@ type SetProjectWebhookURLVariableOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_webhooks/#set-a-url-variable -func (s *ProjectsService) SetProjectWebhookURLVariable(pid any, hook int, key string, opt *SetProjectWebhookURLVariableOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectsService) SetProjectWebhookURLVariable(pid any, hook int64, key string, opt *SetProjectWebhookURLVariableOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -1713,7 +1715,7 @@ func (s *ProjectsService) SetProjectWebhookURLVariable(pid any, hook int, key st // // GitLab API docs: // https://docs.gitlab.com/api/project_webhooks/#delete-a-url-variable -func (s *ProjectsService) DeleteProjectWebhookURLVariable(pid any, hook int, key string, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectsService) DeleteProjectWebhookURLVariable(pid any, hook int64, key string, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -1733,9 +1735,9 @@ func (s *ProjectsService) DeleteProjectWebhookURLVariable(pid any, hook int, key // GitLab API docs: // https://docs.gitlab.com/api/project_forks/#create-a-fork-relationship-between-projects type ProjectForkRelation struct { - ID int `json:"id"` - ForkedToProjectID int `json:"forked_to_project_id"` - ForkedFromProjectID int `json:"forked_from_project_id"` + ID int64 `json:"id"` + ForkedToProjectID int64 `json:"forked_to_project_id"` + ForkedFromProjectID int64 `json:"forked_from_project_id"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` } @@ -1745,7 +1747,7 @@ type ProjectForkRelation struct { // // GitLab API docs: // https://docs.gitlab.com/api/project_forks/#create-a-fork-relationship-between-projects -func (s *ProjectsService) CreateProjectForkRelation(pid any, fork int, options ...RequestOptionFunc) (*ProjectForkRelation, *Response, error) { +func (s *ProjectsService) CreateProjectForkRelation(pid any, fork int64, options ...RequestOptionFunc) (*ProjectForkRelation, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1873,8 +1875,8 @@ func (s *ProjectsService) ListProjectForks(pid any, opt *ListProjectsOptions, op // GitLab API docs: // https://docs.gitlab.com/api/project_push_rules/ type ProjectPushRules struct { - ID int `json:"id"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + ProjectID int64 `json:"project_id"` CommitMessageRegex string `json:"commit_message_regex"` CommitMessageNegativeRegex string `json:"commit_message_negative_regex"` BranchNameRegex string `json:"branch_name_regex"` @@ -1884,7 +1886,7 @@ type ProjectPushRules struct { PreventSecrets bool `json:"prevent_secrets"` AuthorEmailRegex string `json:"author_email_regex"` FileNameRegex string `json:"file_name_regex"` - MaxFileSize int `json:"max_file_size"` + MaxFileSize int64 `json:"max_file_size"` CommitCommitterCheck bool `json:"commit_committer_check"` CommitCommitterNameCheck bool `json:"commit_committer_name_check"` RejectUnsignedCommits bool `json:"reject_unsigned_commits"` @@ -1930,7 +1932,7 @@ type AddProjectPushRuleOptions struct { CommitMessageRegex *string `url:"commit_message_regex,omitempty" json:"commit_message_regex,omitempty"` DenyDeleteTag *bool `url:"deny_delete_tag,omitempty" json:"deny_delete_tag,omitempty"` FileNameRegex *string `url:"file_name_regex,omitempty" json:"file_name_regex,omitempty"` - MaxFileSize *int `url:"max_file_size,omitempty" json:"max_file_size,omitempty"` + MaxFileSize *int64 `url:"max_file_size,omitempty" json:"max_file_size,omitempty"` MemberCheck *bool `url:"member_check,omitempty" json:"member_check,omitempty"` PreventSecrets *bool `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"` RejectUnsignedCommits *bool `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"` @@ -1976,7 +1978,7 @@ type EditProjectPushRuleOptions struct { CommitMessageRegex *string `url:"commit_message_regex,omitempty" json:"commit_message_regex,omitempty"` DenyDeleteTag *bool `url:"deny_delete_tag,omitempty" json:"deny_delete_tag,omitempty"` FileNameRegex *string `url:"file_name_regex,omitempty" json:"file_name_regex,omitempty"` - MaxFileSize *int `url:"max_file_size,omitempty" json:"max_file_size,omitempty"` + MaxFileSize *int64 `url:"max_file_size,omitempty" json:"max_file_size,omitempty"` MemberCheck *bool `url:"member_check,omitempty" json:"member_check,omitempty"` PreventSecrets *bool `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"` RejectUnsignedCommits *bool `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"` @@ -2044,7 +2046,7 @@ type ProjectApprovals struct { SelectiveCodeOwnerRemovals bool `json:"selective_code_owner_removals,omitempty"` // Deprecated: use Merge Request Approvals API instead - ApprovalsBeforeMerge int `json:"approvals_before_merge"` + ApprovalsBeforeMerge int64 `json:"approvals_before_merge"` } // GetApprovalConfiguration get the approval configuration for a project. @@ -2086,7 +2088,7 @@ type ChangeApprovalConfigurationOptions struct { SelectiveCodeOwnerRemovals *bool `url:"selective_code_owner_removals,omitempty" json:"selective_code_owner_removals,omitempty"` // Deprecated: use Merge Request Approvals API instead - ApprovalsBeforeMerge *int `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` + ApprovalsBeforeMerge *int64 `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` } // ChangeApprovalConfiguration updates the approval configuration for a project. @@ -2119,7 +2121,9 @@ func (s *ProjectsService) ChangeApprovalConfiguration(pid any, opt *ChangeApprov // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#get-all-approval-rules-for-project -type GetProjectApprovalRulesListsOptions ListOptions +type GetProjectApprovalRulesListsOptions struct { + ListOptions +} // GetProjectApprovalRules looks up the list of project level approver rules. // @@ -2150,7 +2154,7 @@ func (s *ProjectsService) GetProjectApprovalRules(pid any, opt *GetProjectApprov // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#get-single-approval-rule-for-project -func (s *ProjectsService) GetProjectApprovalRule(pid any, ruleID int, options ...RequestOptionFunc) (*ProjectApprovalRule, *Response, error) { +func (s *ProjectsService) GetProjectApprovalRule(pid any, ruleID int64, options ...RequestOptionFunc) (*ProjectApprovalRule, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -2178,12 +2182,12 @@ func (s *ProjectsService) GetProjectApprovalRule(pid any, ruleID int, options .. // https://docs.gitlab.com/api/merge_request_approvals/#create-project-approval-rule type CreateProjectLevelRuleOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` - ApprovalsRequired *int `url:"approvals_required,omitempty" json:"approvals_required,omitempty"` + ApprovalsRequired *int64 `url:"approvals_required,omitempty" json:"approvals_required,omitempty"` ReportType *string `url:"report_type,omitempty" json:"report_type,omitempty"` RuleType *string `url:"rule_type,omitempty" json:"rule_type,omitempty"` - UserIDs *[]int `url:"user_ids,omitempty" json:"user_ids,omitempty"` - GroupIDs *[]int `url:"group_ids,omitempty" json:"group_ids,omitempty"` - ProtectedBranchIDs *[]int `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` + UserIDs *[]int64 `url:"user_ids,omitempty" json:"user_ids,omitempty"` + GroupIDs *[]int64 `url:"group_ids,omitempty" json:"group_ids,omitempty"` + ProtectedBranchIDs *[]int64 `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` AppliesToAllProtectedBranches *bool `url:"applies_to_all_protected_branches,omitempty" json:"applies_to_all_protected_branches,omitempty"` Usernames *[]string `url:"usernames,omitempty" json:"usernames,omitempty"` } @@ -2220,10 +2224,10 @@ func (s *ProjectsService) CreateProjectApprovalRule(pid any, opt *CreateProjectL // https://docs.gitlab.com/api/merge_request_approvals/#update-project-approval-rule type UpdateProjectLevelRuleOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` - ApprovalsRequired *int `url:"approvals_required,omitempty" json:"approvals_required,omitempty"` - UserIDs *[]int `url:"user_ids,omitempty" json:"user_ids,omitempty"` - GroupIDs *[]int `url:"group_ids,omitempty" json:"group_ids,omitempty"` - ProtectedBranchIDs *[]int `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` + ApprovalsRequired *int64 `url:"approvals_required,omitempty" json:"approvals_required,omitempty"` + UserIDs *[]int64 `url:"user_ids,omitempty" json:"user_ids,omitempty"` + GroupIDs *[]int64 `url:"group_ids,omitempty" json:"group_ids,omitempty"` + ProtectedBranchIDs *[]int64 `url:"protected_branch_ids,omitempty" json:"protected_branch_ids,omitempty"` AppliesToAllProtectedBranches *bool `url:"applies_to_all_protected_branches,omitempty" json:"applies_to_all_protected_branches,omitempty"` Usernames *[]string `url:"usernames,omitempty" json:"usernames,omitempty"` } @@ -2232,7 +2236,7 @@ type UpdateProjectLevelRuleOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#update-project-approval-rule -func (s *ProjectsService) UpdateProjectApprovalRule(pid any, approvalRule int, opt *UpdateProjectLevelRuleOptions, options ...RequestOptionFunc) (*ProjectApprovalRule, *Response, error) { +func (s *ProjectsService) UpdateProjectApprovalRule(pid any, approvalRule int64, opt *UpdateProjectLevelRuleOptions, options ...RequestOptionFunc) (*ProjectApprovalRule, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -2257,7 +2261,7 @@ func (s *ProjectsService) UpdateProjectApprovalRule(pid any, approvalRule int, o // // GitLab API docs: // https://docs.gitlab.com/api/merge_request_approvals/#delete-project-approval-rule -func (s *ProjectsService) DeleteProjectApprovalRule(pid any, approvalRule int, options ...RequestOptionFunc) (*Response, error) { +func (s *ProjectsService) DeleteProjectApprovalRule(pid any, approvalRule int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -2278,13 +2282,18 @@ func (s *ProjectsService) DeleteProjectApprovalRule(pid any, approvalRule int, o // GitLab API docs: // https://docs.gitlab.com/api/project_pull_mirroring/ type ProjectPullMirrorDetails struct { - ID int `json:"id"` - LastError string `json:"last_error"` - LastSuccessfulUpdateAt *time.Time `json:"last_successful_update_at"` - LastUpdateAt *time.Time `json:"last_update_at"` - LastUpdateStartedAt *time.Time `json:"last_update_started_at"` - UpdateStatus string `json:"update_status"` - URL string `json:"url"` + ID int64 `json:"id"` + LastError string `json:"last_error"` + LastSuccessfulUpdateAt *time.Time `json:"last_successful_update_at"` + LastUpdateAt *time.Time `json:"last_update_at"` + LastUpdateStartedAt *time.Time `json:"last_update_started_at"` + UpdateStatus string `json:"update_status"` + URL string `json:"url"` + Enabled bool `json:"enabled"` + MirrorTriggerBuilds bool `json:"mirror_trigger_builds"` + OnlyMirrorProtectedBranches bool `json:"only_mirror_protected_branches"` + MirrorOverwritesDivergedBranches bool `json:"mirror_overwrites_diverged_branches"` + MirrorBranchRegex string `json:"mirror_branch_regex"` } // GetProjectPullMirrorDetails returns the pull mirror details. @@ -2427,22 +2436,17 @@ func (s *ProjectsService) StartHousekeepingProject(pid any, options ...RequestOp // GitLab API docs: // https://docs.gitlab.com/api/projects/#get-the-path-to-repository-storage type ProjectRepositoryStorage struct { - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` DiskPath string `json:"disk_path"` CreatedAt *time.Time `json:"created_at"` RepositoryStorage string `json:"repository_storage"` } -// ProjectReposityStorage is kept for backwards compatibility. -// -// Deprecated: use ProjectRepositoryStorage instead. The ProjectReposityStorage type will be removed in the next release. -type ProjectReposityStorage = ProjectRepositoryStorage - // GetRepositoryStorage Get the path to repository storage. // // GitLab API docs: // https://docs.gitlab.com/api/projects/#get-the-path-to-repository-storage -func (s *ProjectsService) GetRepositoryStorage(pid any, options ...RequestOptionFunc) (*ProjectReposityStorage, *Response, error) { +func (s *ProjectsService) GetRepositoryStorage(pid any, options ...RequestOptionFunc) (*ProjectRepositoryStorage, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -2454,7 +2458,7 @@ func (s *ProjectsService) GetRepositoryStorage(pid any, options ...RequestOption return nil, nil, err } - prs := new(ProjectReposityStorage) + prs := new(ProjectRepositoryStorage) resp, err := s.client.Do(req, prs) if err != nil { return nil, resp, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/protected_branches.go b/vendor/gitlab.com/gitlab-org/api/client-go/protected_branches.go index 0a6fdc83a..bae532cc6 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/protected_branches.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/protected_branches.go @@ -48,7 +48,7 @@ var _ ProtectedBranchesServiceInterface = (*ProtectedBranchesService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/protected_branches/#list-protected-branches type ProtectedBranch struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` PushAccessLevels []*BranchAccessDescription `json:"push_access_levels"` MergeAccessLevels []*BranchAccessDescription `json:"merge_access_levels"` @@ -63,12 +63,12 @@ type ProtectedBranch struct { // GitLab API docs: // https://docs.gitlab.com/api/protected_branches/#list-protected-branches type BranchAccessDescription struct { - ID int `json:"id"` + ID int64 `json:"id"` AccessLevel AccessLevelValue `json:"access_level"` AccessLevelDescription string `json:"access_level_description"` - DeployKeyID int `json:"deploy_key_id"` - UserID int `json:"user_id"` - GroupID int `json:"group_id"` + DeployKeyID int64 `json:"deploy_key_id"` + UserID int64 `json:"user_id"` + GroupID int64 `json:"group_id"` } // ListProtectedBranchesOptions represents the available ListProtectedBranches() @@ -153,10 +153,10 @@ type ProtectRepositoryBranchesOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/protected_branches/#protect-repository-branches type BranchPermissionOptions struct { - ID *int `url:"id,omitempty" json:"id,omitempty"` - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` - DeployKeyID *int `url:"deploy_key_id,omitempty" json:"deploy_key_id,omitempty"` + ID *int64 `url:"id,omitempty" json:"id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` + DeployKeyID *int64 `url:"deploy_key_id,omitempty" json:"deploy_key_id,omitempty"` AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` Destroy *bool `url:"_destroy,omitempty" json:"_destroy,omitempty"` } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/protected_environments.go b/vendor/gitlab.com/gitlab-org/api/client-go/protected_environments.go index 17a440d1a..3ca4b4573 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/protected_environments.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/protected_environments.go @@ -49,7 +49,7 @@ var _ ProtectedEnvironmentsServiceInterface = (*ProtectedEnvironmentsService)(ni type ProtectedEnvironment struct { Name string `json:"name"` DeployAccessLevels []*EnvironmentAccessDescription `json:"deploy_access_levels"` - RequiredApprovalCount int `json:"required_approval_count"` + RequiredApprovalCount int64 `json:"required_approval_count"` ApprovalRules []*EnvironmentApprovalRule `json:"approval_rules"` } @@ -59,12 +59,12 @@ type ProtectedEnvironment struct { // GitLab API docs: // https://docs.gitlab.com/api/protected_environments/ type EnvironmentAccessDescription struct { - ID int `json:"id"` + ID int64 `json:"id"` AccessLevel AccessLevelValue `json:"access_level"` AccessLevelDescription string `json:"access_level_description"` - UserID int `json:"user_id"` - GroupID int `json:"group_id"` - GroupInheritanceType int `json:"group_inheritance_type"` + UserID int64 `json:"user_id"` + GroupID int64 `json:"group_id"` + GroupInheritanceType int64 `json:"group_inheritance_type"` } // EnvironmentApprovalRule represents the approval rules for a protected @@ -73,13 +73,13 @@ type EnvironmentAccessDescription struct { // GitLab API docs: // https://docs.gitlab.com/api/protected_environments/#protect-a-single-environment type EnvironmentApprovalRule struct { - ID int `json:"id"` - UserID int `json:"user_id"` - GroupID int `json:"group_id"` + ID int64 `json:"id"` + UserID int64 `json:"user_id"` + GroupID int64 `json:"group_id"` AccessLevel AccessLevelValue `json:"access_level"` AccessLevelDescription string `json:"access_level_description"` - RequiredApprovalCount int `json:"required_approvals"` - GroupInheritanceType int `json:"group_inheritance_type"` + RequiredApprovalCount int64 `json:"required_approvals"` + GroupInheritanceType int64 `json:"group_inheritance_type"` } // ListProtectedEnvironmentsOptions represents the available @@ -87,7 +87,9 @@ type EnvironmentApprovalRule struct { // // GitLab API docs: // https://docs.gitlab.com/api/protected_environments/#list-protected-environments -type ListProtectedEnvironmentsOptions ListOptions +type ListProtectedEnvironmentsOptions struct { + ListOptions +} // ListProtectedEnvironments returns a list of protected environments from a // project. @@ -149,7 +151,7 @@ func (s *ProtectedEnvironmentsService) GetProtectedEnvironment(pid any, environm type ProtectRepositoryEnvironmentsOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` DeployAccessLevels *[]*EnvironmentAccessOptions `url:"deploy_access_levels,omitempty" json:"deploy_access_levels,omitempty"` - RequiredApprovalCount *int `url:"required_approval_count,omitempty" json:"required_approval_count,omitempty"` + RequiredApprovalCount *int64 `url:"required_approval_count,omitempty" json:"required_approval_count,omitempty"` ApprovalRules *[]*EnvironmentApprovalRuleOptions `url:"approval_rules,omitempty" json:"approval_rules,omitempty"` } @@ -160,9 +162,9 @@ type ProtectRepositoryEnvironmentsOptions struct { // https://docs.gitlab.com/api/protected_environments/#protect-a-single-environment type EnvironmentAccessOptions struct { AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` - GroupInheritanceType *int `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` + GroupInheritanceType *int64 `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` } // EnvironmentApprovalRuleOptions represents the approval rules for a protected @@ -171,12 +173,12 @@ type EnvironmentAccessOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/protected_environments/#protect-a-single-environment type EnvironmentApprovalRuleOptions struct { - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` AccessLevelDescription *string `url:"access_level_description,omitempty" json:"access_level_description,omitempty"` - RequiredApprovalCount *int `url:"required_approvals,omitempty" json:"required_approvals,omitempty"` - GroupInheritanceType *int `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` + RequiredApprovalCount *int64 `url:"required_approvals,omitempty" json:"required_approvals,omitempty"` + GroupInheritanceType *int64 `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` } // ProtectRepositoryEnvironments protects a single repository environment or @@ -213,7 +215,7 @@ func (s *ProtectedEnvironmentsService) ProtectRepositoryEnvironments(pid any, op type UpdateProtectedEnvironmentsOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` DeployAccessLevels *[]*UpdateEnvironmentAccessOptions `url:"deploy_access_levels,omitempty" json:"deploy_access_levels,omitempty"` - RequiredApprovalCount *int `url:"required_approval_count,omitempty" json:"required_approval_count,omitempty"` + RequiredApprovalCount *int64 `url:"required_approval_count,omitempty" json:"required_approval_count,omitempty"` ApprovalRules *[]*UpdateEnvironmentApprovalRuleOptions `url:"approval_rules,omitempty" json:"approval_rules,omitempty"` } @@ -224,10 +226,10 @@ type UpdateProtectedEnvironmentsOptions struct { // https://docs.gitlab.com/api/protected_environments/#update-a-protected-environment type UpdateEnvironmentAccessOptions struct { AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` - ID *int `url:"id,omitempty" json:"id,omitempty"` - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` - GroupInheritanceType *int `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` + ID *int64 `url:"id,omitempty" json:"id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` + GroupInheritanceType *int64 `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` Destroy *bool `url:"_destroy,omitempty" json:"_destroy,omitempty"` } @@ -237,13 +239,13 @@ type UpdateEnvironmentAccessOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/protected_environments/#update-a-protected-environment type UpdateEnvironmentApprovalRuleOptions struct { - ID *int `url:"id,omitempty" json:"id,omitempty"` - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` + ID *int64 `url:"id,omitempty" json:"id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` AccessLevelDescription *string `url:"access_level_description,omitempty" json:"access_level_description,omitempty"` - RequiredApprovalCount *int `url:"required_approvals,omitempty" json:"required_approvals,omitempty"` - GroupInheritanceType *int `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` + RequiredApprovalCount *int64 `url:"required_approvals,omitempty" json:"required_approvals,omitempty"` + GroupInheritanceType *int64 `url:"group_inheritance_type,omitempty" json:"group_inheritance_type,omitempty"` Destroy *bool `url:"_destroy,omitempty" json:"_destroy,omitempty"` } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/protected_packages.go b/vendor/gitlab.com/gitlab-org/api/client-go/protected_packages.go index 890765e68..711427c8e 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/protected_packages.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/protected_packages.go @@ -69,8 +69,8 @@ type ListPackageProtectionRulesOptions struct { type CreatePackageProtectionRulesOptions struct { PackageNamePattern *string `url:"package_name_pattern" json:"package_name_pattern"` PackageType *string `url:"package_type" json:"package_type"` - MinimumAccessLevelForDelete *string `url:"minimum_access_level_for_delete" json:"minimum_access_level_for_delete"` - MinimumAccessLevelForPush *string `url:"minimum_access_level_for_push" json:"minimum_access_level_for_push"` + MinimumAccessLevelForDelete *int64 `url:"minimum_access_level_for_delete" json:"minimum_access_level_for_delete"` + MinimumAccessLevelForPush *int64 `url:"minimum_access_level_for_push" json:"minimum_access_level_for_push"` } // UpdatePackageProtectionRulesOptions represents the available @@ -81,8 +81,8 @@ type CreatePackageProtectionRulesOptions struct { type UpdatePackageProtectionRulesOptions struct { PackageNamePattern *string `url:"package_name_pattern" json:"package_name_pattern"` PackageType *string `url:"package_type" json:"package_type"` - MinimumAccessLevelForDelete *string `url:"minimum_access_level_for_delete" json:"minimum_access_level_for_delete"` - MinimumAccessLevelForPush *string `url:"minimum_access_level_for_push" json:"minimum_access_level_for_push"` + MinimumAccessLevelForDelete *int64 `url:"minimum_access_level_for_delete" json:"minimum_access_level_for_delete"` + MinimumAccessLevelForPush *int64 `url:"minimum_access_level_for_push" json:"minimum_access_level_for_push"` } func (s *ProtectedPackagesService) ListPackageProtectionRules(pid any, opts *ListPackageProtectionRulesOptions, options ...RequestOptionFunc) ([]*PackageProtectionRule, *Response, error) { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/protected_tags.go b/vendor/gitlab.com/gitlab-org/api/client-go/protected_tags.go index 2d776eed9..51328219f 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/protected_tags.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/protected_tags.go @@ -55,9 +55,10 @@ type ProtectedTag struct { // GitLab API docs: // https://docs.gitlab.com/api/protected_tags/ type TagAccessDescription struct { - ID int `json:"id"` - UserID int `json:"user_id"` - GroupID int `json:"group_id"` + ID int64 `json:"id"` + UserID int64 `json:"user_id"` + GroupID int64 `json:"group_id"` + DeployKeyID int64 `json:"deploy_key_id"` AccessLevel AccessLevelValue `json:"access_level"` AccessLevelDescription string `json:"access_level_description"` } @@ -67,7 +68,9 @@ type TagAccessDescription struct { // // GitLab API docs: // https://docs.gitlab.com/api/protected_tags/#list-protected-tags -type ListProtectedTagsOptions ListOptions +type ListProtectedTagsOptions struct { + ListOptions +} // ListProtectedTags returns a list of protected tags from a project. // @@ -135,8 +138,9 @@ type ProtectRepositoryTagsOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/protected_tags/#protect-repository-tags type TagsPermissionOptions struct { - UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` + UserID *int64 `url:"user_id,omitempty" json:"user_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` + DeployKeyID *int64 `url:"deploy_key_id,omitempty" json:"deploy_key_id,omitempty"` AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/releaselinks.go b/vendor/gitlab.com/gitlab-org/api/client-go/releaselinks.go index 804e1ae51..00fb33dc2 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/releaselinks.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/releaselinks.go @@ -24,10 +24,10 @@ import ( type ( ReleaseLinksServiceInterface interface { ListReleaseLinks(pid any, tagName string, opt *ListReleaseLinksOptions, options ...RequestOptionFunc) ([]*ReleaseLink, *Response, error) - GetReleaseLink(pid any, tagName string, link int, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) + GetReleaseLink(pid any, tagName string, link int64, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) CreateReleaseLink(pid any, tagName string, opt *CreateReleaseLinkOptions, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) - UpdateReleaseLink(pid any, tagName string, link int, opt *UpdateReleaseLinkOptions, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) - DeleteReleaseLink(pid any, tagName string, link int, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) + UpdateReleaseLink(pid any, tagName string, link int64, opt *UpdateReleaseLinkOptions, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) + DeleteReleaseLink(pid any, tagName string, link int64, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) } // ReleaseLinksService handles communication with the release link methods @@ -45,7 +45,7 @@ var _ ReleaseLinksServiceInterface = (*ReleaseLinksService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/releases/links/ type ReleaseLink struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` URL string `json:"url"` DirectAssetURL string `json:"direct_asset_url"` @@ -56,7 +56,9 @@ type ReleaseLink struct { // ListReleaseLinksOptions represents ListReleaseLinks() options. // // GitLab API docs: https://docs.gitlab.com/api/releases/links/#list-links-of-a-release -type ListReleaseLinksOptions ListOptions +type ListReleaseLinksOptions struct { + ListOptions +} // ListReleaseLinks gets assets as links from a Release. // @@ -85,7 +87,7 @@ func (s *ReleaseLinksService) ListReleaseLinks(pid any, tagName string, opt *Lis // GetReleaseLink returns a link from release assets. // // GitLab API docs: https://docs.gitlab.com/api/releases/links/#get-a-release-link -func (s *ReleaseLinksService) GetReleaseLink(pid any, tagName string, link int, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) { +func (s *ReleaseLinksService) GetReleaseLink(pid any, tagName string, link int64, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -160,7 +162,7 @@ type UpdateReleaseLinkOptions struct { // UpdateReleaseLink updates an asset link. // // GitLab API docs: https://docs.gitlab.com/api/releases/links/#update-a-release-link -func (s *ReleaseLinksService) UpdateReleaseLink(pid any, tagName string, link int, opt *UpdateReleaseLinkOptions, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) { +func (s *ReleaseLinksService) UpdateReleaseLink(pid any, tagName string, link int64, opt *UpdateReleaseLinkOptions, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -187,7 +189,7 @@ func (s *ReleaseLinksService) UpdateReleaseLink(pid any, tagName string, link in // DeleteReleaseLink deletes a link from release. // // GitLab API docs: https://docs.gitlab.com/api/releases/links/#delete-a-release-link -func (s *ReleaseLinksService) DeleteReleaseLink(pid any, tagName string, link int, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) { +func (s *ReleaseLinksService) DeleteReleaseLink(pid any, tagName string, link int64, options ...RequestOptionFunc) (*ReleaseLink, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/releases.go b/vendor/gitlab.com/gitlab-org/api/client-go/releases.go index 8810690db..be400d30d 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/releases.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/releases.go @@ -48,44 +48,55 @@ var _ ReleasesServiceInterface = (*ReleasesService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/releases/#list-releases type Release struct { - TagName string `json:"tag_name"` - Name string `json:"name"` - Description string `json:"description"` - DescriptionHTML string `json:"description_html"` - CreatedAt *time.Time `json:"created_at"` - ReleasedAt *time.Time `json:"released_at"` - Author struct { - ID int `json:"id"` - Name string `json:"name"` - Username string `json:"username"` - State string `json:"state"` - AvatarURL string `json:"avatar_url"` - WebURL string `json:"web_url"` - } `json:"author"` + TagName string `json:"tag_name"` + Name string `json:"name"` + Description string `json:"description"` + DescriptionHTML string `json:"description_html"` + CreatedAt *time.Time `json:"created_at"` + ReleasedAt *time.Time `json:"released_at"` + Author BasicUser `json:"author"` Commit Commit `json:"commit"` Milestones []*ReleaseMilestone `json:"milestones"` UpcomingRelease bool `json:"upcoming_release"` CommitPath string `json:"commit_path"` TagPath string `json:"tag_path"` - Assets struct { - Count int `json:"count"` - Sources []struct { - Format string `json:"format"` - URL string `json:"url"` - } `json:"sources"` - Links []*ReleaseLink `json:"links"` - EvidenceFilePath string `json:"evidence_file_path"` - } `json:"assets"` - Evidences []*ReleaseEvidence `json:"evidences"` - Links struct { - ClosedIssueURL string `json:"closed_issues_url"` - ClosedMergeRequest string `json:"closed_merge_requests_url"` - EditURL string `json:"edit_url"` - MergedMergeRequest string `json:"merged_merge_requests_url"` - OpenedIssues string `json:"opened_issues_url"` - OpenedMergeRequest string `json:"opened_merge_requests_url"` - Self string `json:"self"` - } `json:"_links"` + Assets ReleaseAssets `json:"assets"` + Evidences []*ReleaseEvidence `json:"evidences"` + Links ReleaseLinks `json:"_links"` +} + +// ReleaseAssets represents a project release assets. +// +// GitLab API docs: +// https://docs.gitlab.com/api/releases/#list-releases +type ReleaseAssets struct { + Count int64 `json:"count"` + Sources []ReleaseAssetsSource `json:"sources"` + Links []*ReleaseLink `json:"links"` + EvidenceFilePath string `json:"evidence_file_path"` +} + +// ReleaseAssetsSource represents a project release assets source. +// +// GitLab API docs: +// https://docs.gitlab.com/api/releases/#list-releases +type ReleaseAssetsSource struct { + Format string `json:"format"` + URL string `json:"url"` +} + +// ReleaseLinks represents a project release links. +// +// GitLab API docs: +// https://docs.gitlab.com/api/releases/#list-releases +type ReleaseLinks struct { + ClosedIssueURL string `json:"closed_issues_url"` + ClosedMergeRequest string `json:"closed_merge_requests_url"` + EditURL string `json:"edit_url"` + MergedMergeRequest string `json:"merged_merge_requests_url"` + OpenedIssues string `json:"opened_issues_url"` + OpenedMergeRequest string `json:"opened_merge_requests_url"` + Self string `json:"self"` } // ReleaseMilestone represents a project release milestone. @@ -93,9 +104,9 @@ type Release struct { // GitLab API docs: // https://docs.gitlab.com/api/releases/#list-releases type ReleaseMilestone struct { - ID int `json:"id"` - IID int `json:"iid"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + ProjectID int64 `json:"project_id"` Title string `json:"title"` Description string `json:"description"` State string `json:"state"` @@ -113,8 +124,8 @@ type ReleaseMilestone struct { // GitLab API docs: // https://docs.gitlab.com/api/releases/#list-releases type ReleaseMilestoneIssueStats struct { - Total int `json:"total"` - Closed int `json:"closed"` + Total int64 `json:"total"` + Closed int64 `json:"closed"` } // ReleaseEvidence represents a project release's evidence. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/repositories.go b/vendor/gitlab.com/gitlab-org/api/client-go/repositories.go index e364db7d0..5d21e577a 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/repositories.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/repositories.go @@ -275,9 +275,9 @@ func (s *RepositoriesService) Compare(pid any, opt *CompareOptions, options ...R type Contributor struct { Name string `json:"name"` Email string `json:"email"` - Commits int `json:"commits"` - Additions int `json:"additions"` - Deletions int `json:"deletions"` + Commits int64 `json:"commits"` + Additions int64 `json:"additions"` + Deletions int64 `json:"deletions"` } func (c Contributor) String() string { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/repository_files.go b/vendor/gitlab.com/gitlab-org/api/client-go/repository_files.go index 32d1a4988..5290b4672 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/repository_files.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/repository_files.go @@ -53,7 +53,7 @@ var _ RepositoryFilesServiceInterface = (*RepositoryFilesService)(nil) type File struct { FileName string `json:"file_name"` FilePath string `json:"file_path"` - Size int `json:"size"` + Size int64 `json:"size"` Encoding string `json:"encoding"` Content string `json:"content"` ExecuteFilemode bool `json:"execute_filemode"` @@ -164,7 +164,7 @@ func getMetaDataFileFromHeaders(resp *Response) (*File, error) { } if sizeString := resp.Header.Get("X-Gitlab-Size"); sizeString != "" { - size, err := strconv.Atoi(sizeString) + size, err := strconv.ParseInt(sizeString, 10, 64) if err != nil { return nil, err } @@ -179,32 +179,42 @@ func getMetaDataFileFromHeaders(resp *Response) (*File, error) { // GitLab API docs: // https://docs.gitlab.com/api/repository_files/#get-file-blame-from-repository type FileBlameRange struct { - Commit struct { - ID string `json:"id"` - ParentIDs []string `json:"parent_ids"` - Message string `json:"message"` - AuthoredDate *time.Time `json:"authored_date"` - AuthorName string `json:"author_name"` - AuthorEmail string `json:"author_email"` - CommittedDate *time.Time `json:"committed_date"` - CommitterName string `json:"committer_name"` - CommitterEmail string `json:"committer_email"` - } `json:"commit"` - Lines []string `json:"lines"` + Commit FileBlameRangeCommit `json:"commit"` + Lines []string `json:"lines"` } func (b FileBlameRange) String() string { return Stringify(b) } +// FileBlameRangeCommit represents one item of blame information's commit. +// +// GitLab API docs: +// https://docs.gitlab.com/api/repository_files/#get-file-blame-from-repository +type FileBlameRangeCommit struct { + ID string `json:"id"` + ParentIDs []string `json:"parent_ids"` + Message string `json:"message"` + AuthoredDate *time.Time `json:"authored_date"` + AuthorName string `json:"author_name"` + AuthorEmail string `json:"author_email"` + CommittedDate *time.Time `json:"committed_date"` + CommitterName string `json:"committer_name"` + CommitterEmail string `json:"committer_email"` +} + +func (c FileBlameRangeCommit) String() string { + return Stringify(c) +} + // GetFileBlameOptions represents the available GetFileBlame() options. // // GitLab API docs: // https://docs.gitlab.com/api/repository_files/#get-file-blame-from-repository type GetFileBlameOptions struct { Ref *string `url:"ref,omitempty" json:"ref,omitempty"` - RangeStart *int `url:"range[start],omitempty" json:"range[start],omitempty"` - RangeEnd *int `url:"range[end],omitempty" json:"range[end],omitempty"` + RangeStart *int64 `url:"range[start],omitempty" json:"range[start],omitempty"` + RangeEnd *int64 `url:"range[end],omitempty" json:"range[end],omitempty"` } // GetFileBlame allows you to receive blame information. Each blame range diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/request_handler.go b/vendor/gitlab.com/gitlab-org/api/client-go/request_handler.go index a87a55040..09827350a 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/request_handler.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/request_handler.go @@ -62,6 +62,14 @@ func (i UserID) forPath() (string, error) { return PathEscape(id), nil } +type NoEscape struct { + Value string +} + +func (n NoEscape) forPath() (string, error) { + return n.Value, nil +} + type doConfig struct { method string path string @@ -84,11 +92,11 @@ func withPath(path string, args ...any) doOption { for i, a := range args { switch v := a.(type) { case Pather: - project, err := v.forPath() + path, err := v.forPath() if err != nil { return err } - as[i] = project + as[i] = path case string: as[i] = PathEscape(v) default: diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/request_options.go b/vendor/gitlab.com/gitlab-org/api/client-go/request_options.go index 166c1d92c..9e5e9dace 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/request_options.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/request_options.go @@ -90,24 +90,24 @@ func WithKeysetPaginationParameters(nextLink string) RequestOptionFunc { // WithOffsetPaginationParameters takes a page number and modifies the request // to use that page for offset-based pagination, overriding any existing page value. -func WithOffsetPaginationParameters(page int) RequestOptionFunc { +func WithOffsetPaginationParameters(page int64) RequestOptionFunc { return func(req *retryablehttp.Request) error { q := req.URL.Query() q.Del("page") - q.Add("page", strconv.Itoa(page)) + q.Add("page", strconv.FormatInt(page, 10)) req.URL.RawQuery = q.Encode() return nil } } -// WithSudo takes either a username or user ID and sets the SUDO request header. +// WithSudo takes either a username or user ID and sets the Sudo request header. func WithSudo(uid any) RequestOptionFunc { return func(req *retryablehttp.Request) error { user, err := parseID(uid) if err != nil { return err } - req.Header.Set("SUDO", user) + req.Header.Set("Sudo", user) return nil } } @@ -117,11 +117,11 @@ func WithToken(authType AuthType, token string) RequestOptionFunc { return func(req *retryablehttp.Request) error { switch authType { case JobToken: - req.Header.Set("JOB-TOKEN", token) + req.Header.Set("Job-Token", token) case OAuthToken: req.Header.Set("Authorization", "Bearer "+token) case PrivateToken: - req.Header.Set("PRIVATE-TOKEN", token) + req.Header.Set("Private-Token", token) } return nil } diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/resource_group.go b/vendor/gitlab.com/gitlab-org/api/client-go/resource_group.go index 6b851143f..d3b8a76ba 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/resource_group.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/resource_group.go @@ -47,7 +47,7 @@ var _ ResourceGroupServiceInterface = (*ResourceGroupService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/resource_groups/ type ResourceGroup struct { - ID int `json:"id"` + ID int64 `json:"id"` Key string `json:"key"` ProcessMode string `json:"process_mode"` CreatedAt *time.Time `json:"created_at"` diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/resource_iteration_events.go b/vendor/gitlab.com/gitlab-org/api/client-go/resource_iteration_events.go index bb52fc0ee..d460ad4c1 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/resource_iteration_events.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/resource_iteration_events.go @@ -24,8 +24,8 @@ import ( type ( ResourceIterationEventsServiceInterface interface { - ListIssueIterationEvents(pid any, issue int, opt *ListIterationEventsOptions, options ...RequestOptionFunc) ([]*IterationEvent, *Response, error) - GetIssueIterationEvent(pid any, issue int, event int, options ...RequestOptionFunc) (*IterationEvent, *Response, error) + ListIssueIterationEvents(pid any, issue int64, opt *ListIterationEventsOptions, options ...RequestOptionFunc) ([]*IterationEvent, *Response, error) + GetIssueIterationEvent(pid any, issue int64, event int64, options ...RequestOptionFunc) (*IterationEvent, *Response, error) } // ResourceIterationEventsService handles communication with the event related @@ -43,11 +43,11 @@ var _ ResourceIterationEventsServiceInterface = (*ResourceIterationEventsService // // GitLab API docs: https://docs.gitlab.com/api/resource_iteration_events/ type IterationEvent struct { - ID int `json:"id"` + ID int64 `json:"id"` User *BasicUser `json:"user"` CreatedAt *time.Time `json:"created_at"` ResourceType string `json:"resource_type"` - ResourceID int `json:"resource_id"` + ResourceID int64 `json:"resource_id"` Iteration *Iteration `json:"iteration"` Action string `json:"action"` } @@ -56,13 +56,13 @@ type IterationEvent struct { // // GitLab API docs: https://docs.gitlab.com/api/resource_iteration_events/ type Iteration struct { - ID int `json:"id"` - IID int `json:"iid"` - Sequence int `json:"sequence"` - GroupID int `json:"group_id"` + ID int64 `json:"id"` + IID int64 `json:"iid"` + Sequence int64 `json:"sequence"` + GroupID int64 `json:"group_id"` Title string `json:"title"` Description string `json:"description"` - State int `json:"state"` + State int64 `json:"state"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` DueDate *ISOTime `json:"due_date"` @@ -84,7 +84,7 @@ type ListIterationEventsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/resource_iteration_events/#list-project-issue-iteration-events -func (s *ResourceIterationEventsService) ListIssueIterationEvents(pid any, issue int, opt *ListIterationEventsOptions, options ...RequestOptionFunc) ([]*IterationEvent, *Response, error) { +func (s *ResourceIterationEventsService) ListIssueIterationEvents(pid any, issue int64, opt *ListIterationEventsOptions, options ...RequestOptionFunc) ([]*IterationEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -109,7 +109,7 @@ func (s *ResourceIterationEventsService) ListIssueIterationEvents(pid any, issue // // GitLab API docs: // https://docs.gitlab.com/api/resource_iteration_events/#get-single-issue-iteration-event -func (s *ResourceIterationEventsService) GetIssueIterationEvent(pid any, issue int, event int, options ...RequestOptionFunc) (*IterationEvent, *Response, error) { +func (s *ResourceIterationEventsService) GetIssueIterationEvent(pid any, issue int64, event int64, options ...RequestOptionFunc) (*IterationEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/resource_label_events.go b/vendor/gitlab.com/gitlab-org/api/client-go/resource_label_events.go index f37296748..cd8e9bf07 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/resource_label_events.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/resource_label_events.go @@ -24,15 +24,15 @@ import ( type ( ResourceLabelEventsServiceInterface interface { - ListIssueLabelEvents(pid any, issue int, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) - GetIssueLabelEvent(pid any, issue int, event int, options ...RequestOptionFunc) (*LabelEvent, *Response, error) - ListMergeRequestsLabelEvents(pid any, request int, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) - GetMergeRequestLabelEvent(pid any, request int, event int, options ...RequestOptionFunc) (*LabelEvent, *Response, error) + ListIssueLabelEvents(pid any, issue int64, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) + GetIssueLabelEvent(pid any, issue int64, event int64, options ...RequestOptionFunc) (*LabelEvent, *Response, error) + ListMergeRequestsLabelEvents(pid any, request int64, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) + GetMergeRequestLabelEvent(pid any, request int64, event int64, options ...RequestOptionFunc) (*LabelEvent, *Response, error) // Will be removed in v5, use Work Items API instead - ListGroupEpicLabelEvents(gid any, epic int, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) + ListGroupEpicLabelEvents(gid any, epic int64, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) // Will be removed in v5, use Work Items API instead - GetGroupEpicLabelEvent(gid any, epic int, event int, options ...RequestOptionFunc) (*LabelEvent, *Response, error) + GetGroupEpicLabelEvent(gid any, epic int64, event int64, options ...RequestOptionFunc) (*LabelEvent, *Response, error) } // ResourceLabelEventsService handles communication with the event related @@ -51,26 +51,25 @@ var _ ResourceLabelEventsServiceInterface = (*ResourceLabelEventsService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/resource_label_events/#get-single-issue-label-event type LabelEvent struct { - ID int `json:"id"` - Action string `json:"action"` - CreatedAt *time.Time `json:"created_at"` - ResourceType string `json:"resource_type"` - ResourceID int `json:"resource_id"` - User struct { - ID int `json:"id"` - Name string `json:"name"` - Username string `json:"username"` - State string `json:"state"` - AvatarURL string `json:"avatar_url"` - WebURL string `json:"web_url"` - } `json:"user"` - Label struct { - ID int `json:"id"` - Name string `json:"name"` - Color string `json:"color"` - TextColor string `json:"text_color"` - Description string `json:"description"` - } `json:"label"` + ID int64 `json:"id"` + Action string `json:"action"` + CreatedAt *time.Time `json:"created_at"` + ResourceType string `json:"resource_type"` + ResourceID int64 `json:"resource_id"` + User BasicUser `json:"user"` + Label LabelEventLabel `json:"label"` +} + +// LabelEventLabel represents a resource label event label. +// +// GitLab API docs: +// https://docs.gitlab.com/api/resource_label_events/#get-single-issue-label-event +type LabelEventLabel struct { + ID int64 `json:"id"` + Name string `json:"name"` + Color string `json:"color"` + TextColor string `json:"text_color"` + Description string `json:"description"` } // ListLabelEventsOptions represents the options for all resource label events @@ -87,7 +86,7 @@ type ListLabelEventsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/resource_label_events/#list-project-issue-label-events -func (s *ResourceLabelEventsService) ListIssueLabelEvents(pid any, issue int, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) { +func (s *ResourceLabelEventsService) ListIssueLabelEvents(pid any, issue int64, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -112,7 +111,7 @@ func (s *ResourceLabelEventsService) ListIssueLabelEvents(pid any, issue int, op // // GitLab API docs: // https://docs.gitlab.com/api/resource_label_events/#get-single-issue-label-event -func (s *ResourceLabelEventsService) GetIssueLabelEvent(pid any, issue int, event int, options ...RequestOptionFunc) (*LabelEvent, *Response, error) { +func (s *ResourceLabelEventsService) GetIssueLabelEvent(pid any, issue int64, event int64, options ...RequestOptionFunc) (*LabelEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -139,7 +138,7 @@ func (s *ResourceLabelEventsService) GetIssueLabelEvent(pid any, issue int, even // // GitLab API docs: // https://docs.gitlab.com/api/resource_label_events/#list-group-epic-label-events -func (s *ResourceLabelEventsService) ListGroupEpicLabelEvents(gid any, epic int, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) { +func (s *ResourceLabelEventsService) ListGroupEpicLabelEvents(gid any, epic int64, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -165,7 +164,7 @@ func (s *ResourceLabelEventsService) ListGroupEpicLabelEvents(gid any, epic int, // // GitLab API docs: // https://docs.gitlab.com/api/resource_label_events/#get-single-epic-label-event -func (s *ResourceLabelEventsService) GetGroupEpicLabelEvent(gid any, epic int, event int, options ...RequestOptionFunc) (*LabelEvent, *Response, error) { +func (s *ResourceLabelEventsService) GetGroupEpicLabelEvent(gid any, epic int64, event int64, options ...RequestOptionFunc) (*LabelEvent, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -191,7 +190,7 @@ func (s *ResourceLabelEventsService) GetGroupEpicLabelEvent(gid any, epic int, e // // GitLab API docs: // https://docs.gitlab.com/api/resource_label_events/#list-project-merge-request-label-events -func (s *ResourceLabelEventsService) ListMergeRequestsLabelEvents(pid any, request int, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) { +func (s *ResourceLabelEventsService) ListMergeRequestsLabelEvents(pid any, request int64, opt *ListLabelEventsOptions, options ...RequestOptionFunc) ([]*LabelEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -216,7 +215,7 @@ func (s *ResourceLabelEventsService) ListMergeRequestsLabelEvents(pid any, reque // // GitLab API docs: // https://docs.gitlab.com/api/resource_label_events/#get-single-merge-request-label-event -func (s *ResourceLabelEventsService) GetMergeRequestLabelEvent(pid any, request int, event int, options ...RequestOptionFunc) (*LabelEvent, *Response, error) { +func (s *ResourceLabelEventsService) GetMergeRequestLabelEvent(pid any, request int64, event int64, options ...RequestOptionFunc) (*LabelEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/resource_milestone_events.go b/vendor/gitlab.com/gitlab-org/api/client-go/resource_milestone_events.go index 76cb105da..ed4e03a06 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/resource_milestone_events.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/resource_milestone_events.go @@ -24,10 +24,10 @@ import ( type ( ResourceMilestoneEventsServiceInterface interface { - ListIssueMilestoneEvents(pid any, issue int, opt *ListMilestoneEventsOptions, options ...RequestOptionFunc) ([]*MilestoneEvent, *Response, error) - GetIssueMilestoneEvent(pid any, issue int, event int, options ...RequestOptionFunc) (*MilestoneEvent, *Response, error) - ListMergeMilestoneEvents(pid any, request int, opt *ListMilestoneEventsOptions, options ...RequestOptionFunc) ([]*MilestoneEvent, *Response, error) - GetMergeRequestMilestoneEvent(pid any, request int, event int, options ...RequestOptionFunc) (*MilestoneEvent, *Response, error) + ListIssueMilestoneEvents(pid any, issue int64, opt *ListMilestoneEventsOptions, options ...RequestOptionFunc) ([]*MilestoneEvent, *Response, error) + GetIssueMilestoneEvent(pid any, issue int64, event int64, options ...RequestOptionFunc) (*MilestoneEvent, *Response, error) + ListMergeMilestoneEvents(pid any, request int64, opt *ListMilestoneEventsOptions, options ...RequestOptionFunc) ([]*MilestoneEvent, *Response, error) + GetMergeRequestMilestoneEvent(pid any, request int64, event int64, options ...RequestOptionFunc) (*MilestoneEvent, *Response, error) } // ResourceMilestoneEventsService handles communication with the event related @@ -45,11 +45,11 @@ var _ ResourceMilestoneEventsServiceInterface = (*ResourceMilestoneEventsService // // GitLab API docs: https://docs.gitlab.com/api/resource_milestone_events/ type MilestoneEvent struct { - ID int `json:"id"` + ID int64 `json:"id"` User *BasicUser `json:"user"` CreatedAt *time.Time `json:"created_at"` ResourceType string `json:"resource_type"` - ResourceID int `json:"resource_id"` + ResourceID int64 `json:"resource_id"` Milestone *Milestone `json:"milestone"` Action string `json:"action"` } @@ -68,7 +68,7 @@ type ListMilestoneEventsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/resource_milestone_events/#list-project-issue-milestone-events -func (s *ResourceMilestoneEventsService) ListIssueMilestoneEvents(pid any, issue int, opt *ListMilestoneEventsOptions, options ...RequestOptionFunc) ([]*MilestoneEvent, *Response, error) { +func (s *ResourceMilestoneEventsService) ListIssueMilestoneEvents(pid any, issue int64, opt *ListMilestoneEventsOptions, options ...RequestOptionFunc) ([]*MilestoneEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -93,7 +93,7 @@ func (s *ResourceMilestoneEventsService) ListIssueMilestoneEvents(pid any, issue // // GitLab API docs: // https://docs.gitlab.com/api/resource_milestone_events/#get-single-issue-milestone-event -func (s *ResourceMilestoneEventsService) GetIssueMilestoneEvent(pid any, issue int, event int, options ...RequestOptionFunc) (*MilestoneEvent, *Response, error) { +func (s *ResourceMilestoneEventsService) GetIssueMilestoneEvent(pid any, issue int64, event int64, options ...RequestOptionFunc) (*MilestoneEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -119,7 +119,7 @@ func (s *ResourceMilestoneEventsService) GetIssueMilestoneEvent(pid any, issue i // // GitLab API docs: // https://docs.gitlab.com/api/resource_milestone_events/#list-project-merge-request-milestone-events -func (s *ResourceMilestoneEventsService) ListMergeMilestoneEvents(pid any, request int, opt *ListMilestoneEventsOptions, options ...RequestOptionFunc) ([]*MilestoneEvent, *Response, error) { +func (s *ResourceMilestoneEventsService) ListMergeMilestoneEvents(pid any, request int64, opt *ListMilestoneEventsOptions, options ...RequestOptionFunc) ([]*MilestoneEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -144,7 +144,7 @@ func (s *ResourceMilestoneEventsService) ListMergeMilestoneEvents(pid any, reque // // GitLab API docs: // https://docs.gitlab.com/api/resource_milestone_events/#get-single-merge-request-milestone-event -func (s *ResourceMilestoneEventsService) GetMergeRequestMilestoneEvent(pid any, request int, event int, options ...RequestOptionFunc) (*MilestoneEvent, *Response, error) { +func (s *ResourceMilestoneEventsService) GetMergeRequestMilestoneEvent(pid any, request int64, event int64, options ...RequestOptionFunc) (*MilestoneEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/resource_state_events.go b/vendor/gitlab.com/gitlab-org/api/client-go/resource_state_events.go index b1acec9ce..ba0e5152c 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/resource_state_events.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/resource_state_events.go @@ -24,10 +24,10 @@ import ( type ( ResourceStateEventsServiceInterface interface { - ListIssueStateEvents(pid any, issue int, opt *ListStateEventsOptions, options ...RequestOptionFunc) ([]*StateEvent, *Response, error) - GetIssueStateEvent(pid any, issue int, event int, options ...RequestOptionFunc) (*StateEvent, *Response, error) - ListMergeStateEvents(pid any, request int, opt *ListStateEventsOptions, options ...RequestOptionFunc) ([]*StateEvent, *Response, error) - GetMergeRequestStateEvent(pid any, request int, event int, options ...RequestOptionFunc) (*StateEvent, *Response, error) + ListIssueStateEvents(pid any, issue int64, opt *ListStateEventsOptions, options ...RequestOptionFunc) ([]*StateEvent, *Response, error) + GetIssueStateEvent(pid any, issue int64, event int64, options ...RequestOptionFunc) (*StateEvent, *Response, error) + ListMergeStateEvents(pid any, request int64, opt *ListStateEventsOptions, options ...RequestOptionFunc) ([]*StateEvent, *Response, error) + GetMergeRequestStateEvent(pid any, request int64, event int64, options ...RequestOptionFunc) (*StateEvent, *Response, error) } // ResourceStateEventsService handles communication with the event related @@ -45,11 +45,11 @@ var _ ResourceStateEventsServiceInterface = (*ResourceStateEventsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/resource_state_events/ type StateEvent struct { - ID int `json:"id"` + ID int64 `json:"id"` User *BasicUser `json:"user"` CreatedAt *time.Time `json:"created_at"` ResourceType string `json:"resource_type"` - ResourceID int `json:"resource_id"` + ResourceID int64 `json:"resource_id"` State EventTypeValue `json:"state"` } @@ -67,7 +67,7 @@ type ListStateEventsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/resource_state_events/#list-project-issue-state-events -func (s *ResourceStateEventsService) ListIssueStateEvents(pid any, issue int, opt *ListStateEventsOptions, options ...RequestOptionFunc) ([]*StateEvent, *Response, error) { +func (s *ResourceStateEventsService) ListIssueStateEvents(pid any, issue int64, opt *ListStateEventsOptions, options ...RequestOptionFunc) ([]*StateEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -92,7 +92,7 @@ func (s *ResourceStateEventsService) ListIssueStateEvents(pid any, issue int, op // // GitLab API docs: // https://docs.gitlab.com/api/resource_state_events/#get-single-issue-state-event -func (s *ResourceStateEventsService) GetIssueStateEvent(pid any, issue int, event int, options ...RequestOptionFunc) (*StateEvent, *Response, error) { +func (s *ResourceStateEventsService) GetIssueStateEvent(pid any, issue int64, event int64, options ...RequestOptionFunc) (*StateEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -118,7 +118,7 @@ func (s *ResourceStateEventsService) GetIssueStateEvent(pid any, issue int, even // // GitLab API docs: // https://docs.gitlab.com/api/resource_state_events/#list-project-merge-request-state-events -func (s *ResourceStateEventsService) ListMergeStateEvents(pid any, request int, opt *ListStateEventsOptions, options ...RequestOptionFunc) ([]*StateEvent, *Response, error) { +func (s *ResourceStateEventsService) ListMergeStateEvents(pid any, request int64, opt *ListStateEventsOptions, options ...RequestOptionFunc) ([]*StateEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -143,7 +143,7 @@ func (s *ResourceStateEventsService) ListMergeStateEvents(pid any, request int, // // GitLab API docs: // https://docs.gitlab.com/api/resource_state_events/#get-single-merge-request-state-event -func (s *ResourceStateEventsService) GetMergeRequestStateEvent(pid any, request int, event int, options ...RequestOptionFunc) (*StateEvent, *Response, error) { +func (s *ResourceStateEventsService) GetMergeRequestStateEvent(pid any, request int64, event int64, options ...RequestOptionFunc) (*StateEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/resource_weight_events.go b/vendor/gitlab.com/gitlab-org/api/client-go/resource_weight_events.go index e515f312a..4bf9a1214 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/resource_weight_events.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/resource_weight_events.go @@ -24,7 +24,7 @@ import ( type ( ResourceWeightEventsServiceInterface interface { - ListIssueWeightEvents(pid any, issue int, opt *ListWeightEventsOptions, options ...RequestOptionFunc) ([]*WeightEvent, *Response, error) + ListIssueWeightEvents(pid any, issue int64, opt *ListWeightEventsOptions, options ...RequestOptionFunc) ([]*WeightEvent, *Response, error) } // ResourceWeightEventsService handles communication with the event related @@ -42,14 +42,14 @@ var _ ResourceWeightEventsServiceInterface = (*ResourceWeightEventsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/resource_weight_events/ type WeightEvent struct { - ID int `json:"id"` + ID int64 `json:"id"` User *BasicUser `json:"user"` CreatedAt *time.Time `json:"created_at"` ResourceType string `json:"resource_type"` - ResourceID int `json:"resource_id"` + ResourceID int64 `json:"resource_id"` State EventTypeValue `json:"state"` - IssueID int `json:"issue_id"` - Weight int `json:"weight"` + IssueID int64 `json:"issue_id"` + Weight int64 `json:"weight"` } // ListWeightEventsOptions represents the options for all resource weight events @@ -66,7 +66,7 @@ type ListWeightEventsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/resource_weight_events/#list-project-issue-weight-events -func (s *ResourceWeightEventsService) ListIssueWeightEvents(pid any, issue int, opt *ListWeightEventsOptions, options ...RequestOptionFunc) ([]*WeightEvent, *Response, error) { +func (s *ResourceWeightEventsService) ListIssueWeightEvents(pid any, issue int64, opt *ListWeightEventsOptions, options ...RequestOptionFunc) ([]*WeightEvent, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/runner_controller_tokens.go b/vendor/gitlab.com/gitlab-org/api/client-go/runner_controller_tokens.go new file mode 100644 index 000000000..0f9bc2fec --- /dev/null +++ b/vendor/gitlab.com/gitlab-org/api/client-go/runner_controller_tokens.go @@ -0,0 +1,113 @@ +package gitlab + +import ( + "net/http" + "time" +) + +type ( + // RunnerControllerTokensServiceInterface handles communication with the runner + // controller token related methods of the GitLab API. This is an admin-only + // endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + RunnerControllerTokensServiceInterface interface { + // ListRunnerControllerTokens gets a list of runner controller tokens. This is + // an admin-only endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + ListRunnerControllerTokens(rid int64, opt *ListRunnerControllerTokensOptions, options ...RequestOptionFunc) ([]*RunnerControllerToken, *Response, error) + // GetRunnerControllerToken gets a single runner controller token. This is an + // admin-only endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + GetRunnerControllerToken(rid int64, tokenID int64, options ...RequestOptionFunc) (*RunnerControllerToken, *Response, error) + // CreateRunnerControllerToken creates a new runner controller token. This is + // an admin-only endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + CreateRunnerControllerToken(rid int64, opt *CreateRunnerControllerTokenOptions, options ...RequestOptionFunc) (*RunnerControllerToken, *Response, error) + // RevokeRunnerControllerToken revokes a runner controller token. This is an + // admin-only endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + RevokeRunnerControllerToken(rid int64, tokenID int64, options ...RequestOptionFunc) (*Response, error) + } + + // RunnerControllerTokensService handles communication with the runner + // controller token related methods of the GitLab API. This is an admin-only + // endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + RunnerControllerTokensService struct { + client *Client + } +) + +var _ RunnerControllerTokensServiceInterface = (*RunnerControllerTokensService)(nil) + +// RunnerControllerToken represents a GitLab runner controller token. +type RunnerControllerToken struct { + ID int64 `json:"id"` + Description string `json:"description"` + Token string `json:"token,omitempty"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` +} + +// ListRunnerControllerTokensOptions represents the available +// ListRunnerControllerTokens() options. +// +// GitLab API docs: Documentation not yet available, see +// https://gitlab.com/gitlab-org/gitlab/-/issues/581275 +type ListRunnerControllerTokensOptions struct { + ListOptions +} + +func (s *RunnerControllerTokensService) ListRunnerControllerTokens(rid int64, opt *ListRunnerControllerTokensOptions, options ...RequestOptionFunc) ([]*RunnerControllerToken, *Response, error) { + return do[[]*RunnerControllerToken](s.client, + withPath("runner_controllers/%d/tokens", rid), + withAPIOpts(opt), + withRequestOpts(options...), + ) +} + +func (s *RunnerControllerTokensService) GetRunnerControllerToken(rid int64, tokenID int64, options ...RequestOptionFunc) (*RunnerControllerToken, *Response, error) { + return do[*RunnerControllerToken](s.client, + withPath("runner_controllers/%d/tokens/%d", rid, tokenID), + withRequestOpts(options...), + ) +} + +// CreateRunnerControllerTokenOptions represents the available +// CreateRunnerControllerToken() options. +// +// GitLab API docs: Documentation not yet available, see +// https://gitlab.com/gitlab-org/gitlab/-/issues/581275 +type CreateRunnerControllerTokenOptions struct { + Description *string `url:"description,omitempty" json:"description,omitempty"` +} + +func (s *RunnerControllerTokensService) CreateRunnerControllerToken(rid int64, opt *CreateRunnerControllerTokenOptions, options ...RequestOptionFunc) (*RunnerControllerToken, *Response, error) { + return do[*RunnerControllerToken](s.client, + withMethod(http.MethodPost), + withPath("runner_controllers/%d/tokens", rid), + withAPIOpts(opt), + withRequestOpts(options...), + ) +} + +func (s *RunnerControllerTokensService) RevokeRunnerControllerToken(rid int64, tokenID int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("runner_controllers/%d/tokens/%d", rid, tokenID), + withRequestOpts(options...), + ) + return resp, err +} diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/runner_controllers.go b/vendor/gitlab.com/gitlab-org/api/client-go/runner_controllers.go new file mode 100644 index 000000000..7431026a5 --- /dev/null +++ b/vendor/gitlab.com/gitlab-org/api/client-go/runner_controllers.go @@ -0,0 +1,137 @@ +package gitlab + +import ( + "net/http" + "time" +) + +type ( + // RunnerControllersServiceInterface handles communication with the runner + // controller related methods of the GitLab API. This is an admin-only endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + RunnerControllersServiceInterface interface { + // ListRunnerControllers gets a list of runner controllers. This is an + // admin-only endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + ListRunnerControllers(opt *ListRunnerControllersOptions, options ...RequestOptionFunc) ([]*RunnerController, *Response, error) + // GetRunnerController gets a single runner controller. This is an admin-only + // endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + GetRunnerController(rid int64, options ...RequestOptionFunc) (*RunnerController, *Response, error) + // CreateRunnerController creates a new runner controller. This is an + // admin-only endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + CreateRunnerController(opt *CreateRunnerControllerOptions, options ...RequestOptionFunc) (*RunnerController, *Response, error) + // UpdateRunnerController updates a runner controller. This is an admin-only + // endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + UpdateRunnerController(rid int64, opt *UpdateRunnerControllerOptions, options ...RequestOptionFunc) (*RunnerController, *Response, error) + // DeleteRunnerController deletes a runner controller. This is an admin-only + // endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + DeleteRunnerController(rid int64, options ...RequestOptionFunc) (*Response, error) + } + + // RunnerControllersService handles communication with the runner controller + // related methods of the GitLab API. This is an admin-only endpoint. + // + // GitLab API docs: Documentation not yet available, see + // https://gitlab.com/gitlab-org/gitlab/-/issues/581275 + RunnerControllersService struct { + client *Client + } +) + +var _ RunnerControllersServiceInterface = (*RunnerControllersService)(nil) + +// RunnerController represents a GitLab runner controller. +type RunnerController struct { + ID int64 `json:"id"` + Description string `json:"description"` + Enabled bool `json:"enabled"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` +} + +// ListRunnerControllersOptions represents the available +// ListRunnerControllers() options. +// +// GitLab API docs: Documentation not yet available, see +// https://gitlab.com/gitlab-org/gitlab/-/issues/581275 +type ListRunnerControllersOptions struct { + ListOptions +} + +func (s *RunnerControllersService) ListRunnerControllers(opt *ListRunnerControllersOptions, options ...RequestOptionFunc) ([]*RunnerController, *Response, error) { + return do[[]*RunnerController](s.client, + withPath("runner_controllers"), + withAPIOpts(opt), + withRequestOpts(options...), + ) +} + +func (s *RunnerControllersService) GetRunnerController(rid int64, options ...RequestOptionFunc) (*RunnerController, *Response, error) { + return do[*RunnerController](s.client, + withPath("runner_controllers/%d", rid), + withRequestOpts(options...), + ) +} + +// CreateRunnerControllerOptions represents the available +// CreateRunnerController() options. +// +// GitLab API docs: Documentation not yet available, see +// https://gitlab.com/gitlab-org/gitlab/-/issues/581275 +type CreateRunnerControllerOptions struct { + Description *string `url:"description,omitempty" json:"description,omitempty"` + Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"` +} + +func (s *RunnerControllersService) CreateRunnerController(opt *CreateRunnerControllerOptions, options ...RequestOptionFunc) (*RunnerController, *Response, error) { + return do[*RunnerController](s.client, + withMethod(http.MethodPost), + withPath("runner_controllers"), + withAPIOpts(opt), + withRequestOpts(options...), + ) +} + +// UpdateRunnerControllerOptions represents the available +// UpdateRunnerController() options. +// +// GitLab API docs: Documentation not yet available, see +// https://gitlab.com/gitlab-org/gitlab/-/issues/581275 +type UpdateRunnerControllerOptions struct { + Description *string `url:"description,omitempty" json:"description,omitempty"` + Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"` +} + +func (s *RunnerControllersService) UpdateRunnerController(rid int64, opt *UpdateRunnerControllerOptions, options ...RequestOptionFunc) (*RunnerController, *Response, error) { + return do[*RunnerController](s.client, + withMethod(http.MethodPut), + withPath("runner_controllers/%d", rid), + withAPIOpts(opt), + withRequestOpts(options...), + ) +} + +func (s *RunnerControllersService) DeleteRunnerController(rid int64, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("runner_controllers/%d", rid), + withRequestOpts(options...), + ) + return resp, err +} diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/runners.go b/vendor/gitlab.com/gitlab-org/api/client-go/runners.go index bb10a694a..69399a7e7 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/runners.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/runners.go @@ -32,13 +32,13 @@ type ( ListRunnerJobs(rid any, opt *ListRunnerJobsOptions, options ...RequestOptionFunc) ([]*Job, *Response, error) ListProjectRunners(pid any, opt *ListProjectRunnersOptions, options ...RequestOptionFunc) ([]*Runner, *Response, error) EnableProjectRunner(pid any, opt *EnableProjectRunnerOptions, options ...RequestOptionFunc) (*Runner, *Response, error) - DisableProjectRunner(pid any, runner int, options ...RequestOptionFunc) (*Response, error) + DisableProjectRunner(pid any, runner int64, options ...RequestOptionFunc) (*Response, error) ListGroupsRunners(gid any, opt *ListGroupsRunnersOptions, options ...RequestOptionFunc) ([]*Runner, *Response, error) RegisterNewRunner(opt *RegisterNewRunnerOptions, options ...RequestOptionFunc) (*Runner, *Response, error) DeleteRegisteredRunner(opt *DeleteRegisteredRunnerOptions, options ...RequestOptionFunc) (*Response, error) - DeleteRegisteredRunnerByID(rid int, options ...RequestOptionFunc) (*Response, error) + DeleteRegisteredRunnerByID(rid int64, options ...RequestOptionFunc) (*Response, error) VerifyRegisteredRunner(opt *VerifyRegisteredRunnerOptions, options ...RequestOptionFunc) (*Response, error) - ResetRunnerAuthenticationToken(rid int, options ...RequestOptionFunc) (*RunnerAuthenticationToken, *Response, error) + ResetRunnerAuthenticationToken(rid int64, options ...RequestOptionFunc) (*RunnerAuthenticationToken, *Response, error) // Deprecated: for removal in GitLab 20.0, see https://docs.gitlab.com/ci/runners/new_creation_workflow/ instead ResetInstanceRunnerRegistrationToken(options ...RequestOptionFunc) (*RunnerRegistrationToken, *Response, error) @@ -65,7 +65,7 @@ var _ RunnersServiceInterface = (*RunnersService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/runners/ type Runner struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` Paused bool `json:"paused"` IsShared bool `json:"is_shared"` @@ -87,34 +87,24 @@ type Runner struct { // // GitLab API docs: https://docs.gitlab.com/api/runners/ type RunnerDetails struct { - Paused bool `json:"paused"` - Description string `json:"description"` - ID int `json:"id"` - IsShared bool `json:"is_shared"` - RunnerType string `json:"runner_type"` - ContactedAt *time.Time `json:"contacted_at"` - MaintenanceNote string `json:"maintenance_note"` - Name string `json:"name"` - Online bool `json:"online"` - Status string `json:"status"` - Projects []struct { - ID int `json:"id"` - Name string `json:"name"` - NameWithNamespace string `json:"name_with_namespace"` - Path string `json:"path"` - PathWithNamespace string `json:"path_with_namespace"` - } `json:"projects"` - Token string `json:"token"` - TagList []string `json:"tag_list"` - RunUntagged bool `json:"run_untagged"` - Locked bool `json:"locked"` - AccessLevel string `json:"access_level"` - MaximumTimeout int `json:"maximum_timeout"` - Groups []struct { - ID int `json:"id"` - Name string `json:"name"` - WebURL string `json:"web_url"` - } `json:"groups"` + Paused bool `json:"paused"` + Description string `json:"description"` + ID int64 `json:"id"` + IsShared bool `json:"is_shared"` + RunnerType string `json:"runner_type"` + ContactedAt *time.Time `json:"contacted_at"` + MaintenanceNote string `json:"maintenance_note"` + Name string `json:"name"` + Online bool `json:"online"` + Status string `json:"status"` + Projects []RunnerDetailsProject `json:"projects"` + Token string `json:"token"` + TagList []string `json:"tag_list"` + RunUntagged bool `json:"run_untagged"` + Locked bool `json:"locked"` + AccessLevel string `json:"access_level"` + MaximumTimeout int64 `json:"maximum_timeout"` + Groups []RunnerDetailsGroup `json:"groups"` // Deprecated: for removal in v5 of the API, see GraphQL resource CiRunnerManager instead Architecture string `json:"architecture"` @@ -135,6 +125,26 @@ type RunnerDetails struct { Active bool `json:"active"` } +// RunnerDetailsProject represents the GitLab CI runner details project. +// +// GitLab API docs: https://docs.gitlab.com/api/runners/ +type RunnerDetailsProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + NameWithNamespace string `json:"name_with_namespace"` + Path string `json:"path"` + PathWithNamespace string `json:"path_with_namespace"` +} + +// RunnerDetailsGroup represents the GitLab CI runner details group. +// +// GitLab API docs: https://docs.gitlab.com/api/runners/ +type RunnerDetailsGroup struct { + ID int64 `json:"id"` + Name string `json:"name"` + WebURL string `json:"web_url"` +} + // ListRunnersOptions represents the available ListRunners() options. // // GitLab API docs: @@ -213,7 +223,7 @@ type UpdateRunnerDetailsOptions struct { RunUntagged *bool `url:"run_untagged,omitempty" json:"run_untagged,omitempty"` Locked *bool `url:"locked,omitempty" json:"locked,omitempty"` AccessLevel *string `url:"access_level,omitempty" json:"access_level,omitempty"` - MaximumTimeout *int `url:"maximum_timeout,omitempty" json:"maximum_timeout,omitempty"` + MaximumTimeout *int64 `url:"maximum_timeout,omitempty" json:"maximum_timeout,omitempty"` MaintenanceNote *string `url:"maintenance_note,omitempty" json:"maintenance_note,omitempty"` // Deprecated: for removal in v5 of the API, use Paused instead @@ -310,7 +320,7 @@ func (s *RunnersService) ListProjectRunners(pid any, opt *ListProjectRunnersOpti // GitLab API docs: // https://docs.gitlab.com/api/runners/#assign-a-runner-to-project type EnableProjectRunnerOptions struct { - RunnerID int `json:"runner_id"` + RunnerID int64 `json:"runner_id"` } // EnableProjectRunner enables an available specific runner in the project. @@ -334,7 +344,7 @@ func (s *RunnersService) EnableProjectRunner(pid any, opt *EnableProjectRunnerOp // // GitLab API docs: // https://docs.gitlab.com/api/runners/#unassign-a-runner-from-project -func (s *RunnersService) DisableProjectRunner(pid any, runner int, options ...RequestOptionFunc) (*Response, error) { +func (s *RunnersService) DisableProjectRunner(pid any, runner int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("projects/%s/runners/%d", ProjectID{pid}, runner), @@ -388,7 +398,7 @@ type RegisterNewRunnerOptions struct { RunUntagged *bool `url:"run_untagged,omitempty" json:"run_untagged,omitempty"` TagList *[]string `url:"tag_list[],omitempty" json:"tag_list,omitempty"` AccessLevel *string `url:"access_level,omitempty" json:"access_level,omitempty"` - MaximumTimeout *int `url:"maximum_timeout,omitempty" json:"maximum_timeout,omitempty"` + MaximumTimeout *int64 `url:"maximum_timeout,omitempty" json:"maximum_timeout,omitempty"` MaintenanceNote *string `url:"maintenance_note,omitempty" json:"maintenance_note,omitempty"` // Deprecated: for removal in v5 of the API, use Paused instead @@ -452,7 +462,7 @@ func (s *RunnersService) DeleteRegisteredRunner(opt *DeleteRegisteredRunnerOptio // // GitLab API docs: // https://docs.gitlab.com/api/runners/#delete-a-runner-by-id -func (s *RunnersService) DeleteRegisteredRunnerByID(rid int, options ...RequestOptionFunc) (*Response, error) { +func (s *RunnersService) DeleteRegisteredRunnerByID(rid int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath(fmt.Sprintf("runners/%d", rid)), @@ -554,7 +564,7 @@ type RunnerAuthenticationToken struct { // // GitLab API docs: // https://docs.gitlab.com/api/runners/#reset-runners-authentication-token-by-using-the-runner-id -func (s *RunnersService) ResetRunnerAuthenticationToken(rid int, options ...RequestOptionFunc) (*RunnerAuthenticationToken, *Response, error) { +func (s *RunnersService) ResetRunnerAuthenticationToken(rid int64, options ...RequestOptionFunc) (*RunnerAuthenticationToken, *Response, error) { res, resp, err := do[*RunnerAuthenticationToken](s.client, withMethod(http.MethodPost), withPath("runners/%d/reset_authentication_token", rid), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/search.go b/vendor/gitlab.com/gitlab-org/api/client-go/search.go index 580e56ff1..33276d598 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/search.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/search.go @@ -273,8 +273,8 @@ type Blob struct { Filename string `json:"filename"` ID string `json:"id"` Ref string `json:"ref"` - Startline int `json:"startline"` - ProjectID int `json:"project_id"` + Startline int64 `json:"startline"` + ProjectID int64 `json:"project_id"` } // Blobs searches the expression within all blobs diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/secure_files.go b/vendor/gitlab.com/gitlab-org/api/client-go/secure_files.go index 13fc386cc..a0f96d1a5 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/secure_files.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/secure_files.go @@ -24,10 +24,10 @@ import ( type ( SecureFilesServiceInterface interface { ListProjectSecureFiles(pid any, opt *ListProjectSecureFilesOptions, options ...RequestOptionFunc) ([]*SecureFile, *Response, error) - ShowSecureFileDetails(pid any, id int, options ...RequestOptionFunc) (*SecureFile, *Response, error) + ShowSecureFileDetails(pid any, id int64, options ...RequestOptionFunc) (*SecureFile, *Response, error) CreateSecureFile(pid any, content io.Reader, opt *CreateSecureFileOptions, options ...RequestOptionFunc) (*SecureFile, *Response, error) - DownloadSecureFile(pid any, id int, options ...RequestOptionFunc) (io.Reader, *Response, error) - RemoveSecureFile(pid any, id int, options ...RequestOptionFunc) (*Response, error) + DownloadSecureFile(pid any, id int64, options ...RequestOptionFunc) (io.Reader, *Response, error) + RemoveSecureFile(pid any, id int64, options ...RequestOptionFunc) (*Response, error) } // SecureFilesService handles communication with the secure files related @@ -47,7 +47,7 @@ var _ SecureFilesServiceInterface = (*SecureFilesService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/secure_files/ type SecureFile struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Checksum string `json:"checksum"` ChecksumAlgorithm string `json:"checksum_algorithm"` @@ -103,7 +103,9 @@ func (f SecureFile) String() string { // // GitLab API docs: // https://docs.gitlab.com/api/secure_files/#list-project-secure-files -type ListProjectSecureFilesOptions ListOptions +type ListProjectSecureFilesOptions struct { + ListOptions +} // ListProjectSecureFiles gets a list of secure files in a project. // @@ -133,7 +135,7 @@ func (s SecureFilesService) ListProjectSecureFiles(pid any, opt *ListProjectSecu // // GitLab API docs: // https://docs.gitlab.com/api/secure_files/#show-secure-file-details -func (s SecureFilesService) ShowSecureFileDetails(pid any, id int, options ...RequestOptionFunc) (*SecureFile, *Response, error) { +func (s SecureFilesService) ShowSecureFileDetails(pid any, id int64, options ...RequestOptionFunc) (*SecureFile, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -192,7 +194,7 @@ func (s SecureFilesService) CreateSecureFile(pid any, content io.Reader, opt *Cr // // GitLab API docs: // https://docs.gitlab.com/api/secure_files/#download-secure-file -func (s SecureFilesService) DownloadSecureFile(pid any, id int, options ...RequestOptionFunc) (io.Reader, *Response, error) { +func (s SecureFilesService) DownloadSecureFile(pid any, id int64, options ...RequestOptionFunc) (io.Reader, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -217,7 +219,7 @@ func (s SecureFilesService) DownloadSecureFile(pid any, id int, options ...Reque // // GitLab API docs: // https://docs.gitlab.com/api/secure_files/#remove-secure-file -func (s SecureFilesService) RemoveSecureFile(pid any, id int, options ...RequestOptionFunc) (*Response, error) { +func (s SecureFilesService) RemoveSecureFile(pid any, id int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/services.go b/vendor/gitlab.com/gitlab-org/api/client-go/services.go index c41b6e049..53a34add3 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/services.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/services.go @@ -59,6 +59,9 @@ type ( GetJiraService(pid any, options ...RequestOptionFunc) (*JiraService, *Response, error) SetJiraService(pid any, opt *SetJiraServiceOptions, options ...RequestOptionFunc) (*JiraService, *Response, error) DeleteJiraService(pid any, options ...RequestOptionFunc) (*Response, error) + GetMatrixService(pid any, options ...RequestOptionFunc) (*MatrixService, *Response, error) + SetMatrixService(pid any, opt *SetMatrixServiceOptions, options ...RequestOptionFunc) (*MatrixService, *Response, error) + DeleteMatrixService(pid any, options ...RequestOptionFunc) (*Response, error) GetMattermostService(pid any, options ...RequestOptionFunc) (*MattermostService, *Response, error) SetMattermostService(pid any, opt *SetMattermostServiceOptions, options ...RequestOptionFunc) (*MattermostService, *Response, error) DeleteMattermostService(pid any, options ...RequestOptionFunc) (*Response, error) @@ -1229,7 +1232,7 @@ type JiraServiceProperties struct { Username string `json:"username" ` Password string `json:"password" ` Active bool `json:"active"` - JiraAuthType int `json:"jira_auth_type"` + JiraAuthType int64 `json:"jira_auth_type"` JiraIssuePrefix string `json:"jira_issue_prefix"` JiraIssueRegex string `json:"jira_issue_regex"` JiraIssueTransitionAutomatic bool `json:"jira_issue_transition_automatic"` @@ -1264,7 +1267,7 @@ func (p *JiraServiceProperties) UnmarshalJSON(b []byte) error { case string: p.JiraIssueTransitionID = id case float64: - p.JiraIssueTransitionID = strconv.Itoa(int(id)) + p.JiraIssueTransitionID = strconv.FormatInt(int64(id), 10) default: return fmt.Errorf("failed to unmarshal JiraTransitionID of type: %T", id) } @@ -1308,7 +1311,7 @@ type SetJiraServiceOptions struct { Username *string `url:"username,omitempty" json:"username,omitempty" ` Password *string `url:"password,omitempty" json:"password,omitempty" ` Active *bool `url:"active,omitempty" json:"active,omitempty"` - JiraAuthType *int `url:"jira_auth_type,omitempty" json:"jira_auth_type,omitempty"` + JiraAuthType *int64 `url:"jira_auth_type,omitempty" json:"jira_auth_type,omitempty"` JiraIssuePrefix *string `url:"jira_issue_prefix,omitempty" json:"jira_issue_prefix,omitempty"` JiraIssueRegex *string `url:"jira_issue_regex,omitempty" json:"jira_issue_regex,omitempty"` JiraIssueTransitionAutomatic *bool `url:"jira_issue_transition_automatic,omitempty" json:"jira_issue_transition_automatic,omitempty"` @@ -1365,6 +1368,89 @@ func (s *ServicesService) DeleteJiraService(pid any, options ...RequestOptionFun return s.client.Do(req, nil) } +// MatrixService represents Matrix service settings. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_integrations/#matrix-notifications +type MatrixService struct { + Service + Properties *MatrixServiceProperties `json:"properties"` +} + +// MatrixServiceProperties represents Matrix specific properties. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_integrations/#matrix-notifications +type MatrixServiceProperties struct { + Hostname string `json:"hostname"` + Token string `json:"token"` + Room string `json:"room"` + NotifyOnlyBrokenPipelines BoolValue `json:"notify_only_broken_pipelines"` + BranchesToBeNotified string `json:"branches_to_be_notified"` + UseInheritedSettings BoolValue `json:"use_inherited_settings"` +} + +// GetMatrixService gets Matrix service settings for a project. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_integrations/#get-matrix-notifications-settings +func (s *ServicesService) GetMatrixService(pid any, options ...RequestOptionFunc) (*MatrixService, *Response, error) { + return do[*MatrixService](s.client, + withMethod(http.MethodGet), + withPath("projects/%s/integrations/matrix", ProjectID{pid}), + withRequestOpts(options...), + ) +} + +// SetMatrixServiceOptions represents the available SetMatrixService() +// options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_integrations/#set-up-matrix-notifications +type SetMatrixServiceOptions struct { + Hostname *string `url:"hostname,omitempty" json:"hostname,omitempty"` + Token *string `url:"token,omitempty" json:"token,omitempty"` + Room *string `url:"room,omitempty" json:"room,omitempty"` + NotifyOnlyBrokenPipelines *bool `url:"notify_only_broken_pipelines,omitempty" json:"notify_only_broken_pipelines,omitempty"` + BranchesToBeNotified *string `url:"branches_to_be_notified,omitempty" json:"branches_to_be_notified,omitempty"` + PushEvents *bool `url:"push_events,omitempty" json:"push_events,omitempty"` + IssuesEvents *bool `url:"issues_events,omitempty" json:"issues_events,omitempty"` + ConfidentialIssuesEvents *bool `url:"confidential_issues_events,omitempty" json:"confidential_issues_events,omitempty"` + MergeRequestsEvents *bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"` + TagPushEvents *bool `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"` + NoteEvents *bool `url:"note_events,omitempty" json:"note_events,omitempty"` + ConfidentialNoteEvents *bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"` + PipelineEvents *bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"` + WikiPageEvents *bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"` + UseInheritedSettings *bool `url:"use_inherited_settings,omitempty" json:"use_inherited_settings,omitempty"` +} + +// SetMatrixService sets Matrix service for a project. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_integrations/#set-up-matrix-notifications +func (s *ServicesService) SetMatrixService(pid any, opt *SetMatrixServiceOptions, options ...RequestOptionFunc) (*MatrixService, *Response, error) { + return do[*MatrixService](s.client, + withMethod(http.MethodPut), + withPath("projects/%s/integrations/matrix", ProjectID{pid}), + withAPIOpts(opt), + withRequestOpts(options...), + ) +} + +// DeleteMatrixService deletes Matrix service for project. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_integrations/#disable-matrix-notifications +func (s *ServicesService) DeleteMatrixService(pid any, options ...RequestOptionFunc) (*Response, error) { + _, resp, err := do[none](s.client, + withMethod(http.MethodDelete), + withPath("projects/%s/integrations/matrix", ProjectID{pid}), + withRequestOpts(options...), + ) + return resp, err +} + // MattermostService represents Mattermost service settings. // // GitLab API docs: diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/settings.go b/vendor/gitlab.com/gitlab-org/api/client-go/settings.go index 9e7981695..ef3d769fc 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/settings.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/settings.go @@ -52,7 +52,7 @@ var _ SettingsServiceInterface = (*SettingsService)(nil) // https://gitlab.com/gitlab-org/gitlab/-/blob/v14.9.3-ee/ee/lib/ee/api/helpers/settings_helpers.rb#L10 // https://gitlab.com/gitlab-org/gitlab/-/blob/v14.9.3-ee/ee/app/helpers/ee/application_settings_helper.rb#L20 type Settings struct { - ID int `json:"id"` + ID int64 `json:"id"` AbuseNotificationEmail string `json:"abuse_notification_email"` AdminMode bool `json:"admin_mode"` AfterSignOutPath string `json:"after_sign_out_path"` @@ -68,72 +68,72 @@ type Settings struct { AllowProjectCreationForGuestAndBelow bool `json:"allow_project_creation_for_guest_and_below"` AllowRunnerRegistrationToken bool `json:"allow_runner_registration_token"` ArchiveBuildsInHumanReadable string `json:"archive_builds_in_human_readable"` - ASCIIDocMaxIncludes int `json:"asciidoc_max_includes"` + ASCIIDocMaxIncludes int64 `json:"asciidoc_max_includes"` AssetProxyAllowlist []string `json:"asset_proxy_allowlist"` AssetProxyEnabled bool `json:"asset_proxy_enabled"` AssetProxyURL string `json:"asset_proxy_url"` AssetProxySecretKey string `json:"asset_proxy_secret_key"` AuthorizedKeysEnabled bool `json:"authorized_keys_enabled"` AutoBanUserOnExcessiveProjectsDownload bool `json:"auto_ban_user_on_excessive_projects_download"` - AutocompleteUsers int `json:"autocomplete_users"` - AutocompleteUsersUnauthenticated int `json:"autocomplete_users_unauthenticated"` + AutocompleteUsers int64 `json:"autocomplete_users"` + AutocompleteUsersUnauthenticated int64 `json:"autocomplete_users_unauthenticated"` AutoDevOpsDomain string `json:"auto_devops_domain"` AutoDevOpsEnabled bool `json:"auto_devops_enabled"` AutomaticPurchasedStorageAllocation bool `json:"automatic_purchased_storage_allocation"` - BulkImportConcurrentPipelineBatchLimit int `json:"bulk_import_concurrent_pipeline_batch_limit"` + BulkImportConcurrentPipelineBatchLimit int64 `json:"bulk_import_concurrent_pipeline_batch_limit"` BulkImportEnabled bool `json:"bulk_import_enabled"` - BulkImportMaxDownloadFileSize int `json:"bulk_import_max_download_file_size"` + BulkImportMaxDownloadFileSize int64 `json:"bulk_import_max_download_file_size"` CanCreateGroup bool `json:"can_create_group"` CheckNamespacePlan bool `json:"check_namespace_plan"` CIJobLiveTraceEnabled bool `json:"ci_job_live_trace_enabled"` - CIMaxIncludes int `json:"ci_max_includes"` - CIMaxTotalYAMLSizeBytes int `json:"ci_max_total_yaml_size_bytes"` - CIPartitionsSizeLimit int `json:"ci_partitions_size_limit"` + CIMaxIncludes int64 `json:"ci_max_includes"` + CIMaxTotalYAMLSizeBytes int64 `json:"ci_max_total_yaml_size_bytes"` + CIPartitionsSizeLimit int64 `json:"ci_partitions_size_limit"` CommitEmailHostname string `json:"commit_email_hostname"` - ConcurrentBitbucketImportJobsLimit int `json:"concurrent_bitbucket_import_jobs_limit"` - ConcurrentBitbucketServerImportJobsLimit int `json:"concurrent_bitbucket_server_import_jobs_limit"` - ConcurrentGitHubImportJobsLimit int `json:"concurrent_github_import_jobs_limit"` + ConcurrentBitbucketImportJobsLimit int64 `json:"concurrent_bitbucket_import_jobs_limit"` + ConcurrentBitbucketServerImportJobsLimit int64 `json:"concurrent_bitbucket_server_import_jobs_limit"` + ConcurrentGitHubImportJobsLimit int64 `json:"concurrent_github_import_jobs_limit"` ContainerExpirationPoliciesEnableHistoricEntries bool `json:"container_expiration_policies_enable_historic_entries"` - ContainerRegistryCleanupTagsServiceMaxListSize int `json:"container_registry_cleanup_tags_service_max_list_size"` - ContainerRegistryDeleteTagsServiceTimeout int `json:"container_registry_delete_tags_service_timeout"` + ContainerRegistryCleanupTagsServiceMaxListSize int64 `json:"container_registry_cleanup_tags_service_max_list_size"` + ContainerRegistryDeleteTagsServiceTimeout int64 `json:"container_registry_delete_tags_service_timeout"` ContainerRegistryExpirationPoliciesCaching bool `json:"container_registry_expiration_policies_caching"` - ContainerRegistryExpirationPoliciesWorkerCapacity int `json:"container_registry_expiration_policies_worker_capacity"` + ContainerRegistryExpirationPoliciesWorkerCapacity int64 `json:"container_registry_expiration_policies_worker_capacity"` ContainerRegistryImportCreatedBefore *time.Time `json:"container_registry_import_created_before"` - ContainerRegistryImportMaxRetries int `json:"container_registry_import_max_retries"` - ContainerRegistryImportMaxStepDuration int `json:"container_registry_import_max_step_duration"` - ContainerRegistryImportMaxTagsCount int `json:"container_registry_import_max_tags_count"` - ContainerRegistryImportStartMaxRetries int `json:"container_registry_import_start_max_retries"` + ContainerRegistryImportMaxRetries int64 `json:"container_registry_import_max_retries"` + ContainerRegistryImportMaxStepDuration int64 `json:"container_registry_import_max_step_duration"` + ContainerRegistryImportMaxTagsCount int64 `json:"container_registry_import_max_tags_count"` + ContainerRegistryImportStartMaxRetries int64 `json:"container_registry_import_start_max_retries"` ContainerRegistryImportTargetPlan string `json:"container_registry_import_target_plan"` - ContainerRegistryTokenExpireDelay int `json:"container_registry_token_expire_delay"` + ContainerRegistryTokenExpireDelay int64 `json:"container_registry_token_expire_delay"` CreatedAt *time.Time `json:"created_at"` CustomHTTPCloneURLRoot string `json:"custom_http_clone_url_root"` DNSRebindingProtectionEnabled bool `json:"dns_rebinding_protection_enabled"` - DSAKeyRestriction int `json:"dsa_key_restriction"` + DSAKeyRestriction int64 `json:"dsa_key_restriction"` DeactivateDormantUsers bool `json:"deactivate_dormant_users"` - DeactivateDormantUsersPeriod int `json:"deactivate_dormant_users_period"` - DecompressArchiveFileTimeout int `json:"decompress_archive_file_timeout"` + DeactivateDormantUsersPeriod int64 `json:"deactivate_dormant_users_period"` + DecompressArchiveFileTimeout int64 `json:"decompress_archive_file_timeout"` DefaultArtifactsExpireIn string `json:"default_artifacts_expire_in"` DefaultBranchName string `json:"default_branch_name"` DefaultBranchProtectionDefaults *BranchProtectionDefaults `json:"default_branch_protection_defaults,omitempty"` DefaultCiConfigPath string `json:"default_ci_config_path"` DefaultGroupVisibility VisibilityValue `json:"default_group_visibility"` DefaultPreferredLanguage string `json:"default_preferred_language"` - DefaultProjectCreation int `json:"default_project_creation"` + DefaultProjectCreation int64 `json:"default_project_creation"` DefaultProjectDeletionProtection bool `json:"default_project_deletion_protection"` DefaultProjectVisibility VisibilityValue `json:"default_project_visibility"` - DefaultProjectsLimit int `json:"default_projects_limit"` + DefaultProjectsLimit int64 `json:"default_projects_limit"` DefaultSnippetVisibility VisibilityValue `json:"default_snippet_visibility"` - DefaultSyntaxHighlightingTheme int `json:"default_syntax_highlighting_theme"` + DefaultSyntaxHighlightingTheme int64 `json:"default_syntax_highlighting_theme"` DelayedGroupDeletion bool `json:"delayed_group_deletion"` DelayedProjectDeletion bool `json:"delayed_project_deletion"` DeleteInactiveProjects bool `json:"delete_inactive_projects"` DeleteUnconfirmedUsers bool `json:"delete_unconfirmed_users"` - DeletionAdjournedPeriod int `json:"deletion_adjourned_period"` + DeletionAdjournedPeriod int64 `json:"deletion_adjourned_period"` DiagramsnetEnabled bool `json:"diagramsnet_enabled"` DiagramsnetURL string `json:"diagramsnet_url"` - DiffMaxFiles int `json:"diff_max_files"` - DiffMaxLines int `json:"diff_max_lines"` - DiffMaxPatchBytes int `json:"diff_max_patch_bytes"` + DiffMaxFiles int64 `json:"diff_max_files"` + DiffMaxLines int64 `json:"diff_max_lines"` + DiffMaxPatchBytes int64 `json:"diff_max_patch_bytes"` DisableAdminOAuthScopes bool `json:"disable_admin_oauth_scopes"` DisableFeedToken bool `json:"disable_feed_token"` DisableOverridingApproversPerMergeRequest bool `json:"disable_overriding_approvers_per_merge_request"` @@ -142,16 +142,16 @@ type Settings struct { DomainAllowlist []string `json:"domain_allowlist"` DomainDenylist []string `json:"domain_denylist"` DomainDenylistEnabled bool `json:"domain_denylist_enabled"` - DownstreamPipelineTriggerLimitPerProjectUserSHA int `json:"downstream_pipeline_trigger_limit_per_project_user_sha"` + DownstreamPipelineTriggerLimitPerProjectUserSHA int64 `json:"downstream_pipeline_trigger_limit_per_project_user_sha"` DuoFeaturesEnabled bool `json:"duo_features_enabled"` - ECDSAKeyRestriction int `json:"ecdsa_key_restriction"` - ECDSASKKeyRestriction int `json:"ecdsa_sk_key_restriction"` + ECDSAKeyRestriction int64 `json:"ecdsa_key_restriction"` + ECDSASKKeyRestriction int64 `json:"ecdsa_sk_key_restriction"` EKSAccessKeyID string `json:"eks_access_key_id"` EKSAccountID string `json:"eks_account_id"` EKSIntegrationEnabled bool `json:"eks_integration_enabled"` EKSSecretAccessKey string `json:"eks_secret_access_key"` - Ed25519KeyRestriction int `json:"ed25519_key_restriction"` - Ed25519SKKeyRestriction int `json:"ed25519_sk_key_restriction"` + Ed25519KeyRestriction int64 `json:"ed25519_key_restriction"` + Ed25519SKKeyRestriction int64 `json:"ed25519_sk_key_restriction"` ElasticsearchAWS bool `json:"elasticsearch_aws"` ElasticsearchAWSAccessKey string `json:"elasticsearch_aws_access_key"` ElasticsearchAWSRegion string `json:"elasticsearch_aws_region"` @@ -160,26 +160,26 @@ type Settings struct { ElasticsearchAnalyzersKuromojiSearch bool `json:"elasticsearch_analyzers_kuromoji_search"` ElasticsearchAnalyzersSmartCNEnabled bool `json:"elasticsearch_analyzers_smartcn_enabled"` ElasticsearchAnalyzersSmartCNSearch bool `json:"elasticsearch_analyzers_smartcn_search"` - ElasticsearchClientRequestTimeout int `json:"elasticsearch_client_request_timeout"` - ElasticsearchIndexedFieldLengthLimit int `json:"elasticsearch_indexed_field_length_limit"` - ElasticsearchIndexedFileSizeLimitKB int `json:"elasticsearch_indexed_file_size_limit_kb"` + ElasticsearchClientRequestTimeout int64 `json:"elasticsearch_client_request_timeout"` + ElasticsearchIndexedFieldLengthLimit int64 `json:"elasticsearch_indexed_field_length_limit"` + ElasticsearchIndexedFileSizeLimitKB int64 `json:"elasticsearch_indexed_file_size_limit_kb"` ElasticsearchIndexing bool `json:"elasticsearch_indexing"` ElasticsearchLimitIndexing bool `json:"elasticsearch_limit_indexing"` - ElasticsearchMaxBulkConcurrency int `json:"elasticsearch_max_bulk_concurrency"` - ElasticsearchMaxBulkSizeMB int `json:"elasticsearch_max_bulk_size_mb"` - ElasticsearchMaxCodeIndexingConcurrency int `json:"elasticsearch_max_code_indexing_concurrency"` - ElasticsearchNamespaceIDs []int `json:"elasticsearch_namespace_ids"` + ElasticsearchMaxBulkConcurrency int64 `json:"elasticsearch_max_bulk_concurrency"` + ElasticsearchMaxBulkSizeMB int64 `json:"elasticsearch_max_bulk_size_mb"` + ElasticsearchMaxCodeIndexingConcurrency int64 `json:"elasticsearch_max_code_indexing_concurrency"` + ElasticsearchNamespaceIDs []int64 `json:"elasticsearch_namespace_ids"` ElasticsearchPassword string `json:"elasticsearch_password"` ElasticsearchPauseIndexing bool `json:"elasticsearch_pause_indexing"` - ElasticsearchProjectIDs []int `json:"elasticsearch_project_ids"` - ElasticsearchReplicas int `json:"elasticsearch_replicas"` + ElasticsearchProjectIDs []int64 `json:"elasticsearch_project_ids"` + ElasticsearchReplicas int64 `json:"elasticsearch_replicas"` ElasticsearchRequeueWorkers bool `json:"elasticsearch_requeue_workers"` - ElasticsearchRetryOnFailure int `json:"elasticsearch_retry_on_failure"` + ElasticsearchRetryOnFailure int64 `json:"elasticsearch_retry_on_failure"` ElasticsearchSearch bool `json:"elasticsearch_search"` - ElasticsearchShards int `json:"elasticsearch_shards"` + ElasticsearchShards int64 `json:"elasticsearch_shards"` ElasticsearchURL []string `json:"elasticsearch_url"` ElasticsearchUsername string `json:"elasticsearch_username"` - ElasticsearchWorkerNumberOfShards int `json:"elasticsearch_worker_number_of_shards"` + ElasticsearchWorkerNumberOfShards int64 `json:"elasticsearch_worker_number_of_shards"` EmailAdditionalText string `json:"email_additional_text"` EmailAuthorInBody bool `json:"email_author_in_body"` EmailConfirmationSetting string `json:"email_confirmation_setting"` @@ -199,23 +199,23 @@ type Settings struct { ExternalAuthorizationServiceEnabled bool `json:"external_authorization_service_enabled"` ExternalAuthorizationServiceTimeout float64 `json:"external_authorization_service_timeout"` ExternalAuthorizationServiceURL string `json:"external_authorization_service_url"` - ExternalPipelineValidationServiceTimeout int `json:"external_pipeline_validation_service_timeout"` + ExternalPipelineValidationServiceTimeout int64 `json:"external_pipeline_validation_service_timeout"` ExternalPipelineValidationServiceToken string `json:"external_pipeline_validation_service_token"` ExternalPipelineValidationServiceURL string `json:"external_pipeline_validation_service_url"` - FailedLoginAttemptsUnlockPeriodInMinutes int `json:"failed_login_attempts_unlock_period_in_minutes"` - FileTemplateProjectID int `json:"file_template_project_id"` - FirstDayOfWeek int `json:"first_day_of_week"` + FailedLoginAttemptsUnlockPeriodInMinutes int64 `json:"failed_login_attempts_unlock_period_in_minutes"` + FileTemplateProjectID int64 `json:"file_template_project_id"` + FirstDayOfWeek int64 `json:"first_day_of_week"` FlocEnabled bool `json:"floc_enabled"` GeoNodeAllowedIPs string `json:"geo_node_allowed_ips"` - GeoStatusTimeout int `json:"geo_status_timeout"` - GitRateLimitUsersAlertlist []int `json:"git_rate_limit_users_alertlist"` - GitTwoFactorSessionExpiry int `json:"git_two_factor_session_expiry"` - GitalyTimeoutDefault int `json:"gitaly_timeout_default"` - GitalyTimeoutFast int `json:"gitaly_timeout_fast"` - GitalyTimeoutMedium int `json:"gitaly_timeout_medium"` + GeoStatusTimeout int64 `json:"geo_status_timeout"` + GitRateLimitUsersAlertlist []int64 `json:"git_rate_limit_users_alertlist"` + GitTwoFactorSessionExpiry int64 `json:"git_two_factor_session_expiry"` + GitalyTimeoutDefault int64 `json:"gitaly_timeout_default"` + GitalyTimeoutFast int64 `json:"gitaly_timeout_fast"` + GitalyTimeoutMedium int64 `json:"gitaly_timeout_medium"` GitlabDedicatedInstance bool `json:"gitlab_dedicated_instance"` GitlabEnvironmentToolkitInstance bool `json:"gitlab_environment_toolkit_instance"` - GitlabShellOperationLimit int `json:"gitlab_shell_operation_limit"` + GitlabShellOperationLimit int64 `json:"gitlab_shell_operation_limit"` GitpodEnabled bool `json:"gitpod_enabled"` GitpodURL string `json:"gitpod_url"` GitRateLimitUsersAllowlist []string `json:"git_rate_limit_users_allowlist"` @@ -223,11 +223,11 @@ type Settings struct { GrafanaEnabled bool `json:"grafana_enabled"` GrafanaURL string `json:"grafana_url"` GravatarEnabled bool `json:"gravatar_enabled"` - GroupDownloadExportLimit int `json:"group_download_export_limit"` - GroupExportLimit int `json:"group_export_limit"` - GroupImportLimit int `json:"group_import_limit"` + GroupDownloadExportLimit int64 `json:"group_download_export_limit"` + GroupExportLimit int64 `json:"group_export_limit"` + GroupImportLimit int64 `json:"group_import_limit"` GroupOwnersCanManageDefaultBranchProtection bool `json:"group_owners_can_manage_default_branch_protection"` - GroupRunnerTokenExpirationInterval int `json:"group_runner_token_expiration_interval"` + GroupRunnerTokenExpirationInterval int64 `json:"group_runner_token_expiration_interval"` HTMLEmailsEnabled bool `json:"html_emails_enabled"` HashedStorageEnabled bool `json:"hashed_storage_enabled"` HelpPageDocumentationBaseURL string `json:"help_page_documentation_base_url"` @@ -238,15 +238,15 @@ type Settings struct { HideThirdPartyOffers bool `json:"hide_third_party_offers"` HomePageURL string `json:"home_page_url"` HousekeepingEnabled bool `json:"housekeeping_enabled"` - HousekeepingOptimizeRepositoryPeriod int `json:"housekeeping_optimize_repository_period"` + HousekeepingOptimizeRepositoryPeriod int64 `json:"housekeeping_optimize_repository_period"` ImportSources []string `json:"import_sources"` - InactiveProjectsDeleteAfterMonths int `json:"inactive_projects_delete_after_months"` - InactiveProjectsMinSizeMB int `json:"inactive_projects_min_size_mb"` - InactiveProjectsSendWarningEmailAfterMonths int `json:"inactive_projects_send_warning_email_after_months"` + InactiveProjectsDeleteAfterMonths int64 `json:"inactive_projects_delete_after_months"` + InactiveProjectsMinSizeMB int64 `json:"inactive_projects_min_size_mb"` + InactiveProjectsSendWarningEmailAfterMonths int64 `json:"inactive_projects_send_warning_email_after_months"` IncludeOptionalMetricsInServicePing bool `json:"include_optional_metrics_in_service_ping"` InProductMarketingEmailsEnabled bool `json:"in_product_marketing_emails_enabled"` InvisibleCaptchaEnabled bool `json:"invisible_captcha_enabled"` - IssuesCreateLimit int `json:"issues_create_limit"` + IssuesCreateLimit int64 `json:"issues_create_limit"` JiraConnectApplicationKey string `json:"jira_connect_application_key"` JiraConnectPublicKeyStorageEnabled bool `json:"jira_connect_public_key_storage_enabled"` JiraConnectProxyURL string `json:"jira_connect_proxy_url"` @@ -254,7 +254,7 @@ type Settings struct { KrokiEnabled bool `json:"kroki_enabled"` KrokiFormats map[string]bool `json:"kroki_formats"` KrokiURL string `json:"kroki_url"` - LocalMarkdownVersion int `json:"local_markdown_version"` + LocalMarkdownVersion int64 `json:"local_markdown_version"` LockDuoFeaturesEnabled bool `json:"lock_duo_features_enabled"` LockMembershipsToLDAP bool `json:"lock_memberships_to_ldap"` LoginRecaptchaProtectionEnabled bool `json:"login_recaptcha_protection_enabled"` @@ -263,36 +263,36 @@ type Settings struct { MaintenanceMode bool `json:"maintenance_mode"` MaintenanceModeMessage string `json:"maintenance_mode_message"` MavenPackageRequestsForwarding bool `json:"maven_package_requests_forwarding"` - MaxArtifactsSize int `json:"max_artifacts_size"` - MaxAttachmentSize int `json:"max_attachment_size"` - MaxDecompressedArchiveSize int `json:"max_decompressed_archive_size"` - MaxExportSize int `json:"max_export_size"` - MaxImportRemoteFileSize int `json:"max_import_remote_file_size"` - MaxImportSize int `json:"max_import_size"` - MaxLoginAttempts int `json:"max_login_attempts"` - MaxNumberOfRepositoryDownloads int `json:"max_number_of_repository_downloads"` - MaxNumberOfRepositoryDownloadsWithinTimePeriod int `json:"max_number_of_repository_downloads_within_time_period"` - MaxPagesSize int `json:"max_pages_size"` - MaxPersonalAccessTokenLifetime int `json:"max_personal_access_token_lifetime"` - MaxSSHKeyLifetime int `json:"max_ssh_key_lifetime"` - MaxTerraformStateSizeBytes int `json:"max_terraform_state_size_bytes"` - MaxYAMLDepth int `json:"max_yaml_depth"` - MaxYAMLSizeBytes int `json:"max_yaml_size_bytes"` - MetricsMethodCallThreshold int `json:"metrics_method_call_threshold"` - MinimumPasswordLength int `json:"minimum_password_length"` + MaxArtifactsSize int64 `json:"max_artifacts_size"` + MaxAttachmentSize int64 `json:"max_attachment_size"` + MaxDecompressedArchiveSize int64 `json:"max_decompressed_archive_size"` + MaxExportSize int64 `json:"max_export_size"` + MaxImportRemoteFileSize int64 `json:"max_import_remote_file_size"` + MaxImportSize int64 `json:"max_import_size"` + MaxLoginAttempts int64 `json:"max_login_attempts"` + MaxNumberOfRepositoryDownloads int64 `json:"max_number_of_repository_downloads"` + MaxNumberOfRepositoryDownloadsWithinTimePeriod int64 `json:"max_number_of_repository_downloads_within_time_period"` + MaxPagesSize int64 `json:"max_pages_size"` + MaxPersonalAccessTokenLifetime int64 `json:"max_personal_access_token_lifetime"` + MaxSSHKeyLifetime int64 `json:"max_ssh_key_lifetime"` + MaxTerraformStateSizeBytes int64 `json:"max_terraform_state_size_bytes"` + MaxYAMLDepth int64 `json:"max_yaml_depth"` + MaxYAMLSizeBytes int64 `json:"max_yaml_size_bytes"` + MetricsMethodCallThreshold int64 `json:"metrics_method_call_threshold"` + MinimumPasswordLength int64 `json:"minimum_password_length"` MirrorAvailable bool `json:"mirror_available"` - MirrorCapacityThreshold int `json:"mirror_capacity_threshold"` - MirrorMaxCapacity int `json:"mirror_max_capacity"` - MirrorMaxDelay int `json:"mirror_max_delay"` + MirrorCapacityThreshold int64 `json:"mirror_capacity_threshold"` + MirrorMaxCapacity int64 `json:"mirror_max_capacity"` + MirrorMaxDelay int64 `json:"mirror_max_delay"` NPMPackageRequestsForwarding bool `json:"npm_package_requests_forwarding"` - NotesCreateLimit int `json:"notes_create_limit"` + NotesCreateLimit int64 `json:"notes_create_limit"` NotifyOnUnknownSignIn bool `json:"notify_on_unknown_sign_in"` NugetSkipMetadataURLValidation bool `json:"nuget_skip_metadata_url_validation"` OutboundLocalRequestsAllowlistRaw string `json:"outbound_local_requests_allowlist_raw"` OutboundLocalRequestsWhitelist []string `json:"outbound_local_requests_whitelist"` - PackageMetadataPURLTypes []int `json:"package_metadata_purl_types"` + PackageMetadataPURLTypes []int64 `json:"package_metadata_purl_types"` PackageRegistryAllowAnyoneToPullOption bool `json:"package_registry_allow_anyone_to_pull_option"` - PackageRegistryCleanupPoliciesWorkerCapacity int `json:"package_registry_cleanup_policies_worker_capacity"` + PackageRegistryCleanupPoliciesWorkerCapacity int64 `json:"package_registry_cleanup_policies_worker_capacity"` PagesDomainVerificationEnabled bool `json:"pages_domain_verification_enabled"` PasswordAuthenticationEnabledForGit bool `json:"password_authentication_enabled_for_git"` PasswordAuthenticationEnabledForWeb bool `json:"password_authentication_enabled_for_web"` @@ -302,51 +302,51 @@ type Settings struct { PasswordLowercaseRequired bool `json:"password_lowercase_required"` PerformanceBarAllowedGroupPath string `json:"performance_bar_allowed_group_path"` PersonalAccessTokenPrefix string `json:"personal_access_token_prefix"` - PipelineLimitPerProjectUserSha int `json:"pipeline_limit_per_project_user_sha"` + PipelineLimitPerProjectUserSha int64 `json:"pipeline_limit_per_project_user_sha"` PlantumlEnabled bool `json:"plantuml_enabled"` PlantumlURL string `json:"plantuml_url"` PollingIntervalMultiplier float64 `json:"polling_interval_multiplier,string"` PreventMergeRequestsAuthorApproval bool `json:"prevent_merge_request_author_approval"` PreventMergeRequestsCommittersApproval bool `json:"prevent_merge_request_committers_approval"` - ProjectDownloadExportLimit int `json:"project_download_export_limit"` + ProjectDownloadExportLimit int64 `json:"project_download_export_limit"` ProjectExportEnabled bool `json:"project_export_enabled"` - ProjectExportLimit int `json:"project_export_limit"` - ProjectImportLimit int `json:"project_import_limit"` - ProjectJobsAPIRateLimit int `json:"project_jobs_api_rate_limit"` - ProjectRunnerTokenExpirationInterval int `json:"project_runner_token_expiration_interval"` - ProjectsAPIRateLimitUnauthenticated int `json:"projects_api_rate_limit_unauthenticated"` + ProjectExportLimit int64 `json:"project_export_limit"` + ProjectImportLimit int64 `json:"project_import_limit"` + ProjectJobsAPIRateLimit int64 `json:"project_jobs_api_rate_limit"` + ProjectRunnerTokenExpirationInterval int64 `json:"project_runner_token_expiration_interval"` + ProjectsAPIRateLimitUnauthenticated int64 `json:"projects_api_rate_limit_unauthenticated"` PrometheusMetricsEnabled bool `json:"prometheus_metrics_enabled"` ProtectedCIVariables bool `json:"protected_ci_variables"` PseudonymizerEnabled bool `json:"pseudonymizer_enabled"` - PushEventActivitiesLimit int `json:"push_event_activities_limit"` - PushEventHooksLimit int `json:"push_event_hooks_limit"` + PushEventActivitiesLimit int64 `json:"push_event_activities_limit"` + PushEventHooksLimit int64 `json:"push_event_hooks_limit"` PyPIPackageRequestsForwarding bool `json:"pypi_package_requests_forwarding"` - RSAKeyRestriction int `json:"rsa_key_restriction"` + RSAKeyRestriction int64 `json:"rsa_key_restriction"` RateLimitingResponseText string `json:"rate_limiting_response_text"` - RawBlobRequestLimit int `json:"raw_blob_request_limit"` + RawBlobRequestLimit int64 `json:"raw_blob_request_limit"` RecaptchaEnabled bool `json:"recaptcha_enabled"` RecaptchaPrivateKey string `json:"recaptcha_private_key"` RecaptchaSiteKey string `json:"recaptcha_site_key"` - ReceiveMaxInputSize int `json:"receive_max_input_size"` + ReceiveMaxInputSize int64 `json:"receive_max_input_size"` ReceptiveClusterAgentsEnabled bool `json:"receptive_cluster_agents_enabled"` RememberMeEnabled bool `json:"remember_me_enabled"` RepositoryChecksEnabled bool `json:"repository_checks_enabled"` - RepositorySizeLimit int `json:"repository_size_limit"` + RepositorySizeLimit int64 `json:"repository_size_limit"` RepositoryStorages []string `json:"repository_storages"` - RepositoryStoragesWeighted map[string]int `json:"repository_storages_weighted"` + RepositoryStoragesWeighted map[string]int64 `json:"repository_storages_weighted"` RequireAdminApprovalAfterUserSignup bool `json:"require_admin_approval_after_user_signup"` RequireAdminTwoFactorAuthentication bool `json:"require_admin_two_factor_authentication"` RequirePersonalAccessTokenExpiry bool `json:"require_personal_access_token_expiry"` RequireTwoFactorAuthentication bool `json:"require_two_factor_authentication"` RestrictedVisibilityLevels []VisibilityValue `json:"restricted_visibility_levels"` - RunnerTokenExpirationInterval int `json:"runner_token_expiration_interval"` - SearchRateLimit int `json:"search_rate_limit"` - SearchRateLimitUnauthenticated int `json:"search_rate_limit_unauthenticated"` + RunnerTokenExpirationInterval int64 `json:"runner_token_expiration_interval"` + SearchRateLimit int64 `json:"search_rate_limit"` + SearchRateLimitUnauthenticated int64 `json:"search_rate_limit_unauthenticated"` SecretDetectionRevocationTokenTypesURL string `json:"secret_detection_revocation_token_types_url"` SecretDetectionTokenRevocationEnabled bool `json:"secret_detection_token_revocation_enabled"` SecretDetectionTokenRevocationToken string `json:"secret_detection_token_revocation_token"` SecretDetectionTokenRevocationURL string `json:"secret_detection_token_revocation_url"` - SecurityApprovalPoliciesLimit int `json:"security_approval_policies_limit"` + SecurityApprovalPoliciesLimit int64 `json:"security_approval_policies_limit"` SecurityPolicyGlobalGroupApproversEnabled bool `json:"security_policy_global_group_approvers_enabled"` SecurityTXTContent string `json:"security_txt_content"` SendUserConfirmationEmail bool `json:"send_user_confirmation_email"` @@ -355,12 +355,12 @@ type Settings struct { SentryEnabled bool `json:"sentry_enabled"` SentryEnvironment string `json:"sentry_environment"` ServiceAccessTokensExpirationEnforced bool `json:"service_access_tokens_expiration_enforced"` - SessionExpireDelay int `json:"session_expire_delay"` + SessionExpireDelay int64 `json:"session_expire_delay"` SharedRunnersEnabled bool `json:"shared_runners_enabled"` - SharedRunnersMinutes int `json:"shared_runners_minutes"` + SharedRunnersMinutes int64 `json:"shared_runners_minutes"` SharedRunnersText string `json:"shared_runners_text"` - SidekiqJobLimiterCompressionThresholdBytes int `json:"sidekiq_job_limiter_compression_threshold_bytes"` - SidekiqJobLimiterLimitBytes int `json:"sidekiq_job_limiter_limit_bytes"` + SidekiqJobLimiterCompressionThresholdBytes int64 `json:"sidekiq_job_limiter_compression_threshold_bytes"` + SidekiqJobLimiterLimitBytes int64 `json:"sidekiq_job_limiter_limit_bytes"` SidekiqJobLimiterMode string `json:"sidekiq_job_limiter_mode"` SignInText string `json:"sign_in_text"` SignupEnabled bool `json:"signup_enabled"` @@ -371,7 +371,7 @@ type Settings struct { SlackAppSecret string `json:"slack_app_secret"` SlackAppSigningSecret string `json:"slack_app_signing_secret"` SlackAppVerificationToken string `json:"slack_app_verification_token"` - SnippetSizeLimit int `json:"snippet_size_limit"` + SnippetSizeLimit int64 `json:"snippet_size_limit"` SnowplowAppID string `json:"snowplow_app_id"` SnowplowCollectorHostname string `json:"snowplow_collector_hostname"` SnowplowCookieDomain string `json:"snowplow_cookie_domain"` @@ -386,56 +386,56 @@ type Settings struct { StaticObjectsExternalStorageAuthToken string `json:"static_objects_external_storage_auth_token"` StaticObjectsExternalStorageURL string `json:"static_objects_external_storage_url"` SuggestPipelineEnabled bool `json:"suggest_pipeline_enabled"` - TerminalMaxSessionTime int `json:"terminal_max_session_time"` + TerminalMaxSessionTime int64 `json:"terminal_max_session_time"` Terms string `json:"terms"` ThrottleAuthenticatedAPIEnabled bool `json:"throttle_authenticated_api_enabled"` - ThrottleAuthenticatedAPIPeriodInSeconds int `json:"throttle_authenticated_api_period_in_seconds"` - ThrottleAuthenticatedAPIRequestsPerPeriod int `json:"throttle_authenticated_api_requests_per_period"` + ThrottleAuthenticatedAPIPeriodInSeconds int64 `json:"throttle_authenticated_api_period_in_seconds"` + ThrottleAuthenticatedAPIRequestsPerPeriod int64 `json:"throttle_authenticated_api_requests_per_period"` ThrottleAuthenticatedDeprecatedAPIEnabled bool `json:"throttle_authenticated_deprecated_api_enabled"` - ThrottleAuthenticatedDeprecatedAPIPeriodInSeconds int `json:"throttle_authenticated_deprecated_api_period_in_seconds"` - ThrottleAuthenticatedDeprecatedAPIRequestsPerPeriod int `json:"throttle_authenticated_deprecated_api_requests_per_period"` + ThrottleAuthenticatedDeprecatedAPIPeriodInSeconds int64 `json:"throttle_authenticated_deprecated_api_period_in_seconds"` + ThrottleAuthenticatedDeprecatedAPIRequestsPerPeriod int64 `json:"throttle_authenticated_deprecated_api_requests_per_period"` ThrottleAuthenticatedFilesAPIEnabled bool `json:"throttle_authenticated_files_api_enabled"` - ThrottleAuthenticatedFilesAPIPeriodInSeconds int `json:"throttle_authenticated_files_api_period_in_seconds"` - ThrottleAuthenticatedFilesAPIRequestsPerPeriod int `json:"throttle_authenticated_files_api_requests_per_period"` + ThrottleAuthenticatedFilesAPIPeriodInSeconds int64 `json:"throttle_authenticated_files_api_period_in_seconds"` + ThrottleAuthenticatedFilesAPIRequestsPerPeriod int64 `json:"throttle_authenticated_files_api_requests_per_period"` ThrottleAuthenticatedGitLFSEnabled bool `json:"throttle_authenticated_git_lfs_enabled"` - ThrottleAuthenticatedGitLFSPeriodInSeconds int `json:"throttle_authenticated_git_lfs_period_in_seconds"` - ThrottleAuthenticatedGitLFSRequestsPerPeriod int `json:"throttle_authenticated_git_lfs_requests_per_period"` + ThrottleAuthenticatedGitLFSPeriodInSeconds int64 `json:"throttle_authenticated_git_lfs_period_in_seconds"` + ThrottleAuthenticatedGitLFSRequestsPerPeriod int64 `json:"throttle_authenticated_git_lfs_requests_per_period"` ThrottleAuthenticatedPackagesAPIEnabled bool `json:"throttle_authenticated_packages_api_enabled"` - ThrottleAuthenticatedPackagesAPIPeriodInSeconds int `json:"throttle_authenticated_packages_api_period_in_seconds"` - ThrottleAuthenticatedPackagesAPIRequestsPerPeriod int `json:"throttle_authenticated_packages_api_requests_per_period"` + ThrottleAuthenticatedPackagesAPIPeriodInSeconds int64 `json:"throttle_authenticated_packages_api_period_in_seconds"` + ThrottleAuthenticatedPackagesAPIRequestsPerPeriod int64 `json:"throttle_authenticated_packages_api_requests_per_period"` ThrottleAuthenticatedWebEnabled bool `json:"throttle_authenticated_web_enabled"` - ThrottleAuthenticatedWebPeriodInSeconds int `json:"throttle_authenticated_web_period_in_seconds"` - ThrottleAuthenticatedWebRequestsPerPeriod int `json:"throttle_authenticated_web_requests_per_period"` + ThrottleAuthenticatedWebPeriodInSeconds int64 `json:"throttle_authenticated_web_period_in_seconds"` + ThrottleAuthenticatedWebRequestsPerPeriod int64 `json:"throttle_authenticated_web_requests_per_period"` ThrottleIncidentManagementNotificationEnabled bool `json:"throttle_incident_management_notification_enabled"` - ThrottleIncidentManagementNotificationPerPeriod int `json:"throttle_incident_management_notification_per_period"` - ThrottleIncidentManagementNotificationPeriodInSeconds int `json:"throttle_incident_management_notification_period_in_seconds"` + ThrottleIncidentManagementNotificationPerPeriod int64 `json:"throttle_incident_management_notification_per_period"` + ThrottleIncidentManagementNotificationPeriodInSeconds int64 `json:"throttle_incident_management_notification_period_in_seconds"` ThrottleProtectedPathsEnabled bool `json:"throttle_protected_paths_enabled"` - ThrottleProtectedPathsPeriodInSeconds int `json:"throttle_protected_paths_period_in_seconds"` - ThrottleProtectedPathsRequestsPerPeriod int `json:"throttle_protected_paths_requests_per_period"` + ThrottleProtectedPathsPeriodInSeconds int64 `json:"throttle_protected_paths_period_in_seconds"` + ThrottleProtectedPathsRequestsPerPeriod int64 `json:"throttle_protected_paths_requests_per_period"` ThrottleUnauthenticatedAPIEnabled bool `json:"throttle_unauthenticated_api_enabled"` - ThrottleUnauthenticatedAPIPeriodInSeconds int `json:"throttle_unauthenticated_api_period_in_seconds"` - ThrottleUnauthenticatedAPIRequestsPerPeriod int `json:"throttle_unauthenticated_api_requests_per_period"` + ThrottleUnauthenticatedAPIPeriodInSeconds int64 `json:"throttle_unauthenticated_api_period_in_seconds"` + ThrottleUnauthenticatedAPIRequestsPerPeriod int64 `json:"throttle_unauthenticated_api_requests_per_period"` ThrottleUnauthenticatedDeprecatedAPIEnabled bool `json:"throttle_unauthenticated_deprecated_api_enabled"` - ThrottleUnauthenticatedDeprecatedAPIPeriodInSeconds int `json:"throttle_unauthenticated_deprecated_api_period_in_seconds"` - ThrottleUnauthenticatedDeprecatedAPIRequestsPerPeriod int `json:"throttle_unauthenticated_deprecated_api_requests_per_period"` + ThrottleUnauthenticatedDeprecatedAPIPeriodInSeconds int64 `json:"throttle_unauthenticated_deprecated_api_period_in_seconds"` + ThrottleUnauthenticatedDeprecatedAPIRequestsPerPeriod int64 `json:"throttle_unauthenticated_deprecated_api_requests_per_period"` ThrottleUnauthenticatedFilesAPIEnabled bool `json:"throttle_unauthenticated_files_api_enabled"` - ThrottleUnauthenticatedFilesAPIPeriodInSeconds int `json:"throttle_unauthenticated_files_api_period_in_seconds"` - ThrottleUnauthenticatedFilesAPIRequestsPerPeriod int `json:"throttle_unauthenticated_files_api_requests_per_period"` + ThrottleUnauthenticatedFilesAPIPeriodInSeconds int64 `json:"throttle_unauthenticated_files_api_period_in_seconds"` + ThrottleUnauthenticatedFilesAPIRequestsPerPeriod int64 `json:"throttle_unauthenticated_files_api_requests_per_period"` ThrottleUnauthenticatedGitLFSEnabled bool `json:"throttle_unauthenticated_git_lfs_enabled"` - ThrottleUnauthenticatedGitLFSPeriodInSeconds int `json:"throttle_unauthenticated_git_lfs_period_in_seconds"` - ThrottleUnauthenticatedGitLFSRequestsPerPeriod int `json:"throttle_unauthenticated_git_lfs_requests_per_period"` + ThrottleUnauthenticatedGitLFSPeriodInSeconds int64 `json:"throttle_unauthenticated_git_lfs_period_in_seconds"` + ThrottleUnauthenticatedGitLFSRequestsPerPeriod int64 `json:"throttle_unauthenticated_git_lfs_requests_per_period"` ThrottleUnauthenticatedPackagesAPIEnabled bool `json:"throttle_unauthenticated_packages_api_enabled"` - ThrottleUnauthenticatedPackagesAPIPeriodInSeconds int `json:"throttle_unauthenticated_packages_api_period_in_seconds"` - ThrottleUnauthenticatedPackagesAPIRequestsPerPeriod int `json:"throttle_unauthenticated_packages_api_requests_per_period"` + ThrottleUnauthenticatedPackagesAPIPeriodInSeconds int64 `json:"throttle_unauthenticated_packages_api_period_in_seconds"` + ThrottleUnauthenticatedPackagesAPIRequestsPerPeriod int64 `json:"throttle_unauthenticated_packages_api_requests_per_period"` ThrottleUnauthenticatedWebEnabled bool `json:"throttle_unauthenticated_web_enabled"` - ThrottleUnauthenticatedWebPeriodInSeconds int `json:"throttle_unauthenticated_web_period_in_seconds"` - ThrottleUnauthenticatedWebRequestsPerPeriod int `json:"throttle_unauthenticated_web_requests_per_period"` + ThrottleUnauthenticatedWebPeriodInSeconds int64 `json:"throttle_unauthenticated_web_period_in_seconds"` + ThrottleUnauthenticatedWebRequestsPerPeriod int64 `json:"throttle_unauthenticated_web_requests_per_period"` TimeTrackingLimitToHours bool `json:"time_tracking_limit_to_hours"` - TwoFactorGracePeriod int `json:"two_factor_grace_period"` - UnconfirmedUsersDeleteAfterDays int `json:"unconfirmed_users_delete_after_days"` + TwoFactorGracePeriod int64 `json:"two_factor_grace_period"` + UnconfirmedUsersDeleteAfterDays int64 `json:"unconfirmed_users_delete_after_days"` UniqueIPsLimitEnabled bool `json:"unique_ips_limit_enabled"` - UniqueIPsLimitPerUser int `json:"unique_ips_limit_per_user"` - UniqueIPsLimitTimeWindow int `json:"unique_ips_limit_time_window"` + UniqueIPsLimitPerUser int64 `json:"unique_ips_limit_per_user"` + UniqueIPsLimitTimeWindow int64 `json:"unique_ips_limit_time_window"` UpdateRunnerVersionsEnabled bool `json:"update_runner_versions_enabled"` UpdatedAt *time.Time `json:"updated_at"` UpdatingNameDisabledForUsers bool `json:"updating_name_disabled_for_users"` @@ -448,26 +448,26 @@ type Settings struct { UserDefaultsToPrivateProfile bool `json:"user_defaults_to_private_profile"` UserOauthApplications bool `json:"user_oauth_applications"` UserShowAddSSHKeyMessage bool `json:"user_show_add_ssh_key_message"` - UsersGetByIDLimit int `json:"users_get_by_id_limit"` + UsersGetByIDLimit int64 `json:"users_get_by_id_limit"` UsersGetByIDLimitAllowlistRaw string `json:"users_get_by_id_limit_allowlist_raw"` ValidRunnerRegistrars []string `json:"valid_runner_registrars"` VersionCheckEnabled bool `json:"version_check_enabled"` WebIDEClientsidePreviewEnabled bool `json:"web_ide_clientside_preview_enabled"` WhatsNewVariant string `json:"whats_new_variant"` - WikiPageMaxContentBytes int `json:"wiki_page_max_content_bytes"` + WikiPageMaxContentBytes int64 `json:"wiki_page_max_content_bytes"` // Deprecated: Use DefaultBranchProtectionDefaults instead. - DefaultBranchProtection int `json:"default_branch_protection"` + DefaultBranchProtection int64 `json:"default_branch_protection"` // Deprecated: Cannot be set through the API, always true HousekeepingBitmapsEnabled bool `json:"housekeeping_bitmaps_enabled"` // Deprecated: use HousekeepingOptimizeRepositoryPeriod instead - HousekeepingFullRepackPeriod int `json:"housekeeping_full_repack_period"` + HousekeepingFullRepackPeriod int64 `json:"housekeeping_full_repack_period"` // Deprecated: use HousekeepingOptimizeRepositoryPeriod instead - HousekeepingGcPeriod int `json:"housekeeping_gc_period"` + HousekeepingGcPeriod int64 `json:"housekeeping_gc_period"` // Deprecated: use HousekeepingOptimizeRepositoryPeriod instead - HousekeepingIncrementalRepackPeriod int `json:"housekeeping_incremental_repack_period"` + HousekeepingIncrementalRepackPeriod int64 `json:"housekeeping_incremental_repack_period"` // Deprecated: use PerformanceBarAllowedGroupPath instead - PerformanceBarAllowedGroupID int `json:"performance_bar_allowed_group_id"` + PerformanceBarAllowedGroupID int64 `json:"performance_bar_allowed_group_id"` // Deprecated: use PerformanceBarAllowedGroupPath: nil instead PerformanceBarEnabled bool `json:"performance_bar_enabled"` // Deprecated: Use AbuseNotificationEmail instead. @@ -479,11 +479,11 @@ type Settings struct { // Deprecated: Use ThrottleUnauthenticatedWebEnabled or ThrottleUnauthenticatedAPIEnabled instead. (Deprecated in GitLab 14.3) ThrottleUnauthenticatedEnabled bool `json:"throttle_unauthenticated_enabled"` // Deprecated: Use ThrottleUnauthenticatedWebPeriodInSeconds or ThrottleUnauthenticatedAPIPeriodInSeconds instead. (Deprecated in GitLab 14.3) - ThrottleUnauthenticatedPeriodInSeconds int `json:"throttle_unauthenticated_period_in_seconds"` + ThrottleUnauthenticatedPeriodInSeconds int64 `json:"throttle_unauthenticated_period_in_seconds"` // Deprecated: Use ThrottleUnauthenticatedWebRequestsPerPeriod or ThrottleUnauthenticatedAPIRequestsPerPeriod instead. (Deprecated in GitLab 14.3) - ThrottleUnauthenticatedRequestsPerPeriod int `json:"throttle_unauthenticated_requests_per_period"` + ThrottleUnauthenticatedRequestsPerPeriod int64 `json:"throttle_unauthenticated_requests_per_period"` // Deprecated: Replaced by SearchRateLimit in GitLab 14.9 (removed in 15.0). - UserEmailLookupLimit int `json:"user_email_lookup_limit"` + UserEmailLookupLimit int64 `json:"user_email_lookup_limit"` } // UnmarshalJSON implements the json.Unmarshaler interface. @@ -555,72 +555,72 @@ type UpdateSettingsOptions struct { AllowProjectCreationForGuestAndBelow *bool `url:"allow_project_creation_for_guest_and_below,omitempty" json:"allow_project_creation_for_guest_and_below,omitempty"` AllowRunnerRegistrationToken *bool `url:"allow_runner_registration_token,omitempty" json:"allow_runner_registration_token,omitempty"` ArchiveBuildsInHumanReadable *string `url:"archive_builds_in_human_readable,omitempty" json:"archive_builds_in_human_readable,omitempty"` - ASCIIDocMaxIncludes *int `url:"asciidoc_max_includes,omitempty" json:"asciidoc_max_includes,omitempty"` + ASCIIDocMaxIncludes *int64 `url:"asciidoc_max_includes,omitempty" json:"asciidoc_max_includes,omitempty"` AssetProxyAllowlist *[]string `url:"asset_proxy_allowlist,omitempty" json:"asset_proxy_allowlist,omitempty"` AssetProxyEnabled *bool `url:"asset_proxy_enabled,omitempty" json:"asset_proxy_enabled,omitempty"` AssetProxySecretKey *string `url:"asset_proxy_secret_key,omitempty" json:"asset_proxy_secret_key,omitempty"` AssetProxyURL *string `url:"asset_proxy_url,omitempty" json:"asset_proxy_url,omitempty"` AuthorizedKeysEnabled *bool `url:"authorized_keys_enabled,omitempty" json:"authorized_keys_enabled,omitempty"` AutoBanUserOnExcessiveProjectsDownload *bool `url:"auto_ban_user_on_excessive_projects_download,omitempty" json:"auto_ban_user_on_excessive_projects_download,omitempty"` - AutocompleteUsers *int `url:"autocomplete_users,omitempty" json:"autocomplete_users,omitempty"` - AutocompleteUsersUnauthenticated *int `url:"autocomplete_users_unauthenticated,omitempty" json:"autocomplete_users_unauthenticated,omitempty"` + AutocompleteUsers *int64 `url:"autocomplete_users,omitempty" json:"autocomplete_users,omitempty"` + AutocompleteUsersUnauthenticated *int64 `url:"autocomplete_users_unauthenticated,omitempty" json:"autocomplete_users_unauthenticated,omitempty"` AutoDevOpsDomain *string `url:"auto_devops_domain,omitempty" json:"auto_devops_domain,omitempty"` AutoDevOpsEnabled *bool `url:"auto_devops_enabled,omitempty" json:"auto_devops_enabled,omitempty"` AutomaticPurchasedStorageAllocation *bool `url:"automatic_purchased_storage_allocation,omitempty" json:"automatic_purchased_storage_allocation,omitempty"` - BulkImportConcurrentPipelineBatchLimit *int `url:"bulk_import_concurrent_pipeline_batch_limit,omitempty" json:"bulk_import_concurrent_pipeline_batch_limit,omitempty"` + BulkImportConcurrentPipelineBatchLimit *int64 `url:"bulk_import_concurrent_pipeline_batch_limit,omitempty" json:"bulk_import_concurrent_pipeline_batch_limit,omitempty"` BulkImportEnabled *bool `url:"bulk_import_enabled,omitempty" json:"bulk_import_enabled,omitempty"` - BulkImportMaxDownloadFileSize *int `url:"bulk_import_max_download_file_size,omitempty" json:"bulk_import_max_download_file_size,omitempty"` + BulkImportMaxDownloadFileSize *int64 `url:"bulk_import_max_download_file_size,omitempty" json:"bulk_import_max_download_file_size,omitempty"` CanCreateGroup *bool `url:"can_create_group,omitempty" json:"can_create_group,omitempty"` CanCreateOrganization *bool `url:"can_create_organization,omitempty" json:"can_create_organization,omitempty"` CheckNamespacePlan *bool `url:"check_namespace_plan,omitempty" json:"check_namespace_plan,omitempty"` CIJobLiveTraceEnabled *bool `url:"ci_job_live_trace_enabled,omitempty" json:"ci_job_live_trace_enabled,omitempty"` - CIMaxIncludes *int `url:"ci_max_includes,omitempty" json:"ci_max_includes,omitempty"` - CIMaxTotalYAMLSizeBytes *int `url:"ci_max_total_yaml_size_bytes,omitempty" json:"ci_max_total_yaml_size_bytes,omitempty"` - CIPartitionsSizeLimit *int `url:"ci_partitions_size_limit,omitempty" json:"ci_partitions_size_limit,omitempty"` + CIMaxIncludes *int64 `url:"ci_max_includes,omitempty" json:"ci_max_includes,omitempty"` + CIMaxTotalYAMLSizeBytes *int64 `url:"ci_max_total_yaml_size_bytes,omitempty" json:"ci_max_total_yaml_size_bytes,omitempty"` + CIPartitionsSizeLimit *int64 `url:"ci_partitions_size_limit,omitempty" json:"ci_partitions_size_limit,omitempty"` CommitEmailHostname *string `url:"commit_email_hostname,omitempty" json:"commit_email_hostname,omitempty"` - ConcurrentBitbucketImportJobsLimit *int `url:"concurrent_bitbucket_import_jobs_limit,omitempty" json:"concurrent_bitbucket_import_jobs_limit,omitempty"` - ConcurrentBitbucketServerImportJobsLimit *int `url:"concurrent_bitbucket_server_import_jobs_limit,omitempty" json:"concurrent_bitbucket_server_import_jobs_limit,omitempty"` - ConcurrentGitHubImportJobsLimit *int `url:"concurrent_github_import_jobs_limit,omitempty" json:"concurrent_github_import_jobs_limit,omitempty"` + ConcurrentBitbucketImportJobsLimit *int64 `url:"concurrent_bitbucket_import_jobs_limit,omitempty" json:"concurrent_bitbucket_import_jobs_limit,omitempty"` + ConcurrentBitbucketServerImportJobsLimit *int64 `url:"concurrent_bitbucket_server_import_jobs_limit,omitempty" json:"concurrent_bitbucket_server_import_jobs_limit,omitempty"` + ConcurrentGitHubImportJobsLimit *int64 `url:"concurrent_github_import_jobs_limit,omitempty" json:"concurrent_github_import_jobs_limit,omitempty"` ContainerExpirationPoliciesEnableHistoricEntries *bool `url:"container_expiration_policies_enable_historic_entries,omitempty" json:"container_expiration_policies_enable_historic_entries,omitempty"` - ContainerRegistryCleanupTagsServiceMaxListSize *int `url:"container_registry_cleanup_tags_service_max_list_size,omitempty" json:"container_registry_cleanup_tags_service_max_list_size,omitempty"` - ContainerRegistryDeleteTagsServiceTimeout *int `url:"container_registry_delete_tags_service_timeout,omitempty" json:"container_registry_delete_tags_service_timeout,omitempty"` + ContainerRegistryCleanupTagsServiceMaxListSize *int64 `url:"container_registry_cleanup_tags_service_max_list_size,omitempty" json:"container_registry_cleanup_tags_service_max_list_size,omitempty"` + ContainerRegistryDeleteTagsServiceTimeout *int64 `url:"container_registry_delete_tags_service_timeout,omitempty" json:"container_registry_delete_tags_service_timeout,omitempty"` ContainerRegistryExpirationPoliciesCaching *bool `url:"container_registry_expiration_policies_caching,omitempty" json:"container_registry_expiration_policies_caching,omitempty"` - ContainerRegistryExpirationPoliciesWorkerCapacity *int `url:"container_registry_expiration_policies_worker_capacity,omitempty" json:"container_registry_expiration_policies_worker_capacity,omitempty"` + ContainerRegistryExpirationPoliciesWorkerCapacity *int64 `url:"container_registry_expiration_policies_worker_capacity,omitempty" json:"container_registry_expiration_policies_worker_capacity,omitempty"` ContainerRegistryImportCreatedBefore *time.Time `url:"container_registry_import_created_before,omitempty" json:"container_registry_import_created_before,omitempty"` - ContainerRegistryImportMaxRetries *int `url:"container_registry_import_max_retries,omitempty" json:"container_registry_import_max_retries,omitempty"` - ContainerRegistryImportMaxStepDuration *int `url:"container_registry_import_max_step_duration,omitempty" json:"container_registry_import_max_step_duration,omitempty"` - ContainerRegistryImportMaxTagsCount *int `url:"container_registry_import_max_tags_count,omitempty" json:"container_registry_import_max_tags_count,omitempty"` - ContainerRegistryImportStartMaxRetries *int `url:"container_registry_import_start_max_retries,omitempty" json:"container_registry_import_start_max_retries,omitempty"` + ContainerRegistryImportMaxRetries *int64 `url:"container_registry_import_max_retries,omitempty" json:"container_registry_import_max_retries,omitempty"` + ContainerRegistryImportMaxStepDuration *int64 `url:"container_registry_import_max_step_duration,omitempty" json:"container_registry_import_max_step_duration,omitempty"` + ContainerRegistryImportMaxTagsCount *int64 `url:"container_registry_import_max_tags_count,omitempty" json:"container_registry_import_max_tags_count,omitempty"` + ContainerRegistryImportStartMaxRetries *int64 `url:"container_registry_import_start_max_retries,omitempty" json:"container_registry_import_start_max_retries,omitempty"` ContainerRegistryImportTargetPlan *string `url:"container_registry_import_target_plan,omitempty" json:"container_registry_import_target_plan,omitempty"` - ContainerRegistryTokenExpireDelay *int `url:"container_registry_token_expire_delay,omitempty" json:"container_registry_token_expire_delay,omitempty"` + ContainerRegistryTokenExpireDelay *int64 `url:"container_registry_token_expire_delay,omitempty" json:"container_registry_token_expire_delay,omitempty"` CustomHTTPCloneURLRoot *string `url:"custom_http_clone_url_root,omitempty" json:"custom_http_clone_url_root,omitempty"` DNSRebindingProtectionEnabled *bool `url:"dns_rebinding_protection_enabled,omitempty" json:"dns_rebinding_protection_enabled,omitempty"` - DSAKeyRestriction *int `url:"dsa_key_restriction,omitempty" json:"dsa_key_restriction,omitempty"` + DSAKeyRestriction *int64 `url:"dsa_key_restriction,omitempty" json:"dsa_key_restriction,omitempty"` DeactivateDormantUsers *bool `url:"deactivate_dormant_users,omitempty" json:"deactivate_dormant_users,omitempty"` - DeactivateDormantUsersPeriod *int `url:"deactivate_dormant_users_period,omitempty" json:"deactivate_dormant_users_period,omitempty"` - DecompressArchiveFileTimeout *int `url:"decompress_archive_file_timeout,omitempty" json:"decompress_archive_file_timeout,omitempty"` + DeactivateDormantUsersPeriod *int64 `url:"deactivate_dormant_users_period,omitempty" json:"deactivate_dormant_users_period,omitempty"` + DecompressArchiveFileTimeout *int64 `url:"decompress_archive_file_timeout,omitempty" json:"decompress_archive_file_timeout,omitempty"` DefaultArtifactsExpireIn *string `url:"default_artifacts_expire_in,omitempty" json:"default_artifacts_expire_in,omitempty"` DefaultBranchName *string `url:"default_branch_name,omitempty" json:"default_branch_name,omitempty"` DefaultBranchProtectionDefaults *DefaultBranchProtectionDefaultsOptions `url:"default_branch_protection_defaults,omitempty" json:"default_branch_protection_defaults,omitempty"` DefaultCiConfigPath *string `url:"default_ci_config_path,omitempty" json:"default_ci_config_path,omitempty"` DefaultGroupVisibility *VisibilityValue `url:"default_group_visibility,omitempty" json:"default_group_visibility,omitempty"` DefaultPreferredLanguage *string `url:"default_preferred_language,omitempty" json:"default_preferred_language,omitempty"` - DefaultProjectCreation *int `url:"default_project_creation,omitempty" json:"default_project_creation,omitempty"` + DefaultProjectCreation *int64 `url:"default_project_creation,omitempty" json:"default_project_creation,omitempty"` DefaultProjectDeletionProtection *bool `url:"default_project_deletion_protection,omitempty" json:"default_project_deletion_protection,omitempty"` DefaultProjectVisibility *VisibilityValue `url:"default_project_visibility,omitempty" json:"default_project_visibility,omitempty"` - DefaultProjectsLimit *int `url:"default_projects_limit,omitempty" json:"default_projects_limit,omitempty"` + DefaultProjectsLimit *int64 `url:"default_projects_limit,omitempty" json:"default_projects_limit,omitempty"` DefaultSnippetVisibility *VisibilityValue `url:"default_snippet_visibility,omitempty" json:"default_snippet_visibility,omitempty"` - DefaultSyntaxHighlightingTheme *int `url:"default_syntax_highlighting_theme,omitempty" json:"default_syntax_highlighting_theme,omitempty"` + DefaultSyntaxHighlightingTheme *int64 `url:"default_syntax_highlighting_theme,omitempty" json:"default_syntax_highlighting_theme,omitempty"` DelayedGroupDeletion *bool `url:"delayed_group_deletion,omitempty" json:"delayed_group_deletion,omitempty"` DelayedProjectDeletion *bool `url:"delayed_project_deletion,omitempty" json:"delayed_project_deletion,omitempty"` DeleteInactiveProjects *bool `url:"delete_inactive_projects,omitempty" json:"delete_inactive_projects,omitempty"` DeleteUnconfirmedUsers *bool `url:"delete_unconfirmed_users,omitempty" json:"delete_unconfirmed_users,omitempty"` - DeletionAdjournedPeriod *int `url:"deletion_adjourned_period,omitempty" json:"deletion_adjourned_period,omitempty"` + DeletionAdjournedPeriod *int64 `url:"deletion_adjourned_period,omitempty" json:"deletion_adjourned_period,omitempty"` DiagramsnetEnabled *bool `url:"diagramsnet_enabled,omitempty" json:"diagramsnet_enabled,omitempty"` DiagramsnetURL *string `url:"diagramsnet_url,omitempty" json:"diagramsnet_url,omitempty"` - DiffMaxFiles *int `url:"diff_max_files,omitempty" json:"diff_max_files,omitempty"` - DiffMaxLines *int `url:"diff_max_lines,omitempty" json:"diff_max_lines,omitempty"` - DiffMaxPatchBytes *int `url:"diff_max_patch_bytes,omitempty" json:"diff_max_patch_bytes,omitempty"` + DiffMaxFiles *int64 `url:"diff_max_files,omitempty" json:"diff_max_files,omitempty"` + DiffMaxLines *int64 `url:"diff_max_lines,omitempty" json:"diff_max_lines,omitempty"` + DiffMaxPatchBytes *int64 `url:"diff_max_patch_bytes,omitempty" json:"diff_max_patch_bytes,omitempty"` DisableFeedToken *bool `url:"disable_feed_token,omitempty" json:"disable_feed_token,omitempty"` DisableAdminOAuthScopes *bool `url:"disable_admin_oauth_scopes,omitempty" json:"disable_admin_oauth_scopes,omitempty"` DisableOverridingApproversPerMergeRequest *bool `url:"disable_overriding_approvers_per_merge_request,omitempty" json:"disable_overriding_approvers_per_merge_request,omitempty"` @@ -629,44 +629,44 @@ type UpdateSettingsOptions struct { DomainAllowlist *[]string `url:"domain_allowlist,omitempty" json:"domain_allowlist,omitempty"` DomainDenylist *[]string `url:"domain_denylist,omitempty" json:"domain_denylist,omitempty"` DomainDenylistEnabled *bool `url:"domain_denylist_enabled,omitempty" json:"domain_denylist_enabled,omitempty"` - DownstreamPipelineTriggerLimitPerProjectUserSHA *int `url:"downstream_pipeline_trigger_limit_per_project_user_sha,omitempty" json:"downstream_pipeline_trigger_limit_per_project_user_sha,omitempty"` + DownstreamPipelineTriggerLimitPerProjectUserSHA *int64 `url:"downstream_pipeline_trigger_limit_per_project_user_sha,omitempty" json:"downstream_pipeline_trigger_limit_per_project_user_sha,omitempty"` DuoFeaturesEnabled *bool `url:"duo_features_enabled,omitempty" json:"duo_features_enabled,omitempty"` - ECDSAKeyRestriction *int `url:"ecdsa_key_restriction,omitempty" json:"ecdsa_key_restriction,omitempty"` - ECDSASKKeyRestriction *int `url:"ecdsa_sk_key_restriction,omitempty" json:"ecdsa_sk_key_restriction,omitempty"` + ECDSAKeyRestriction *int64 `url:"ecdsa_key_restriction,omitempty" json:"ecdsa_key_restriction,omitempty"` + ECDSASKKeyRestriction *int64 `url:"ecdsa_sk_key_restriction,omitempty" json:"ecdsa_sk_key_restriction,omitempty"` EKSAccessKeyID *string `url:"eks_access_key_id,omitempty" json:"eks_access_key_id,omitempty"` EKSAccountID *string `url:"eks_account_id,omitempty" json:"eks_account_id,omitempty"` EKSIntegrationEnabled *bool `url:"eks_integration_enabled,omitempty" json:"eks_integration_enabled,omitempty"` EKSSecretAccessKey *string `url:"eks_secret_access_key,omitempty" json:"eks_secret_access_key,omitempty"` - Ed25519KeyRestriction *int `url:"ed25519_key_restriction,omitempty" json:"ed25519_key_restriction,omitempty"` - Ed25519SKKeyRestriction *int `url:"ed25519_sk_key_restriction,omitempty" json:"ed25519_sk_key_restriction,omitempty"` + Ed25519KeyRestriction *int64 `url:"ed25519_key_restriction,omitempty" json:"ed25519_key_restriction,omitempty"` + Ed25519SKKeyRestriction *int64 `url:"ed25519_sk_key_restriction,omitempty" json:"ed25519_sk_key_restriction,omitempty"` ElasticsearchAWS *bool `url:"elasticsearch_aws,omitempty" json:"elasticsearch_aws,omitempty"` ElasticsearchAWSAccessKey *string `url:"elasticsearch_aws_access_key,omitempty" json:"elasticsearch_aws_access_key,omitempty"` ElasticsearchAWSRegion *string `url:"elasticsearch_aws_region,omitempty" json:"elasticsearch_aws_region,omitempty"` ElasticsearchAWSSecretAccessKey *string `url:"elasticsearch_aws_secret_access_key,omitempty" json:"elasticsearch_aws_secret_access_key,omitempty"` ElasticsearchAnalyzersKuromojiEnabled *bool `url:"elasticsearch_analyzers_kuromoji_enabled,omitempty" json:"elasticsearch_analyzers_kuromoji_enabled,omitempty"` - ElasticsearchAnalyzersKuromojiSearch *int `url:"elasticsearch_analyzers_kuromoji_search,omitempty" json:"elasticsearch_analyzers_kuromoji_search,omitempty"` + ElasticsearchAnalyzersKuromojiSearch *int64 `url:"elasticsearch_analyzers_kuromoji_search,omitempty" json:"elasticsearch_analyzers_kuromoji_search,omitempty"` ElasticsearchAnalyzersSmartCNEnabled *bool `url:"elasticsearch_analyzers_smartcn_enabled,omitempty" json:"elasticsearch_analyzers_smartcn_enabled,omitempty"` - ElasticsearchAnalyzersSmartCNSearch *int `url:"elasticsearch_analyzers_smartcn_search,omitempty" json:"elasticsearch_analyzers_smartcn_search,omitempty"` - ElasticsearchClientRequestTimeout *int `url:"elasticsearch_client_request_timeout,omitempty" json:"elasticsearch_client_request_timeout,omitempty"` - ElasticsearchIndexedFieldLengthLimit *int `url:"elasticsearch_indexed_field_length_limit,omitempty" json:"elasticsearch_indexed_field_length_limit,omitempty"` - ElasticsearchIndexedFileSizeLimitKB *int `url:"elasticsearch_indexed_file_size_limit_kb,omitempty" json:"elasticsearch_indexed_file_size_limit_kb,omitempty"` + ElasticsearchAnalyzersSmartCNSearch *int64 `url:"elasticsearch_analyzers_smartcn_search,omitempty" json:"elasticsearch_analyzers_smartcn_search,omitempty"` + ElasticsearchClientRequestTimeout *int64 `url:"elasticsearch_client_request_timeout,omitempty" json:"elasticsearch_client_request_timeout,omitempty"` + ElasticsearchIndexedFieldLengthLimit *int64 `url:"elasticsearch_indexed_field_length_limit,omitempty" json:"elasticsearch_indexed_field_length_limit,omitempty"` + ElasticsearchIndexedFileSizeLimitKB *int64 `url:"elasticsearch_indexed_file_size_limit_kb,omitempty" json:"elasticsearch_indexed_file_size_limit_kb,omitempty"` ElasticsearchIndexing *bool `url:"elasticsearch_indexing,omitempty" json:"elasticsearch_indexing,omitempty"` ElasticsearchLimitIndexing *bool `url:"elasticsearch_limit_indexing,omitempty" json:"elasticsearch_limit_indexing,omitempty"` - ElasticsearchMaxBulkConcurrency *int `url:"elasticsearch_max_bulk_concurrency,omitempty" json:"elasticsearch_max_bulk_concurrency,omitempty"` - ElasticsearchMaxBulkSizeMB *int `url:"elasticsearch_max_bulk_size_mb,omitempty" json:"elasticsearch_max_bulk_size_mb,omitempty"` - ElasticsearchMaxCodeIndexingConcurrency *int `url:"elasticsearch_max_code_indexing_concurrency,omitempty" json:"elasticsearch_max_code_indexing_concurrency,omitempty"` - ElasticsearchNamespaceIDs *[]int `url:"elasticsearch_namespace_ids,omitempty" json:"elasticsearch_namespace_ids,omitempty"` + ElasticsearchMaxBulkConcurrency *int64 `url:"elasticsearch_max_bulk_concurrency,omitempty" json:"elasticsearch_max_bulk_concurrency,omitempty"` + ElasticsearchMaxBulkSizeMB *int64 `url:"elasticsearch_max_bulk_size_mb,omitempty" json:"elasticsearch_max_bulk_size_mb,omitempty"` + ElasticsearchMaxCodeIndexingConcurrency *int64 `url:"elasticsearch_max_code_indexing_concurrency,omitempty" json:"elasticsearch_max_code_indexing_concurrency,omitempty"` + ElasticsearchNamespaceIDs *[]int64 `url:"elasticsearch_namespace_ids,omitempty" json:"elasticsearch_namespace_ids,omitempty"` ElasticsearchPassword *string `url:"elasticsearch_password,omitempty" json:"elasticsearch_password,omitempty"` ElasticsearchPauseIndexing *bool `url:"elasticsearch_pause_indexing,omitempty" json:"elasticsearch_pause_indexing,omitempty"` - ElasticsearchProjectIDs *[]int `url:"elasticsearch_project_ids,omitempty" json:"elasticsearch_project_ids,omitempty"` - ElasticsearchReplicas *int `url:"elasticsearch_replicas,omitempty" json:"elasticsearch_replicas,omitempty"` + ElasticsearchProjectIDs *[]int64 `url:"elasticsearch_project_ids,omitempty" json:"elasticsearch_project_ids,omitempty"` + ElasticsearchReplicas *int64 `url:"elasticsearch_replicas,omitempty" json:"elasticsearch_replicas,omitempty"` ElasticsearchRequeueWorkers *bool `url:"elasticsearch_requeue_workers,omitempty" json:"elasticsearch_requeue_workers,omitempty"` - ElasticsearchRetryOnFailure *int `url:"elasticsearch_retry_on_failure,omitempty" json:"elasticsearch_retry_on_failure,omitempty"` + ElasticsearchRetryOnFailure *int64 `url:"elasticsearch_retry_on_failure,omitempty" json:"elasticsearch_retry_on_failure,omitempty"` ElasticsearchSearch *bool `url:"elasticsearch_search,omitempty" json:"elasticsearch_search,omitempty"` - ElasticsearchShards *int `url:"elasticsearch_shards,omitempty" json:"elasticsearch_shards,omitempty"` + ElasticsearchShards *int64 `url:"elasticsearch_shards,omitempty" json:"elasticsearch_shards,omitempty"` ElasticsearchURL *string `url:"elasticsearch_url,omitempty" json:"elasticsearch_url,omitempty"` ElasticsearchUsername *string `url:"elasticsearch_username,omitempty" json:"elasticsearch_username,omitempty"` - ElasticsearchWorkerNumberOfShards *int `url:"elasticsearch_worker_number_of_shards,omitempty" json:"elasticsearch_worker_number_of_shards,omitempty"` + ElasticsearchWorkerNumberOfShards *int64 `url:"elasticsearch_worker_number_of_shards,omitempty" json:"elasticsearch_worker_number_of_shards,omitempty"` EmailAdditionalText *string `url:"email_additional_text,omitempty" json:"email_additional_text,omitempty"` EmailAuthorInBody *bool `url:"email_author_in_body,omitempty" json:"email_author_in_body,omitempty"` EmailConfirmationSetting *string `url:"email_confirmation_setting,omitempty" json:"email_confirmation_setting,omitempty"` @@ -686,23 +686,23 @@ type UpdateSettingsOptions struct { ExternalAuthorizationServiceEnabled *bool `url:"external_authorization_service_enabled,omitempty" json:"external_authorization_service_enabled,omitempty"` ExternalAuthorizationServiceTimeout *float64 `url:"external_authorization_service_timeout,omitempty" json:"external_authorization_service_timeout,omitempty"` ExternalAuthorizationServiceURL *string `url:"external_authorization_service_url,omitempty" json:"external_authorization_service_url,omitempty"` - ExternalPipelineValidationServiceTimeout *int `url:"external_pipeline_validation_service_timeout,omitempty" json:"external_pipeline_validation_service_timeout,omitempty"` + ExternalPipelineValidationServiceTimeout *int64 `url:"external_pipeline_validation_service_timeout,omitempty" json:"external_pipeline_validation_service_timeout,omitempty"` ExternalPipelineValidationServiceToken *string `url:"external_pipeline_validation_service_token,omitempty" json:"external_pipeline_validation_service_token,omitempty"` ExternalPipelineValidationServiceURL *string `url:"external_pipeline_validation_service_url,omitempty" json:"external_pipeline_validation_service_url,omitempty"` - FailedLoginAttemptsUnlockPeriodInMinutes *int `url:"failed_login_attempts_unlock_period_in_minutes,omitempty" json:"failed_login_attempts_unlock_period_in_minutes,omitempty"` - FileTemplateProjectID *int `url:"file_template_project_id,omitempty" json:"file_template_project_id,omitempty"` - FirstDayOfWeek *int `url:"first_day_of_week,omitempty" json:"first_day_of_week,omitempty"` + FailedLoginAttemptsUnlockPeriodInMinutes *int64 `url:"failed_login_attempts_unlock_period_in_minutes,omitempty" json:"failed_login_attempts_unlock_period_in_minutes,omitempty"` + FileTemplateProjectID *int64 `url:"file_template_project_id,omitempty" json:"file_template_project_id,omitempty"` + FirstDayOfWeek *int64 `url:"first_day_of_week,omitempty" json:"first_day_of_week,omitempty"` FlocEnabled *bool `url:"floc_enabled,omitempty" json:"floc_enabled,omitempty"` GeoNodeAllowedIPs *string `url:"geo_node_allowed_ips,omitempty" json:"geo_node_allowed_ips,omitempty"` - GeoStatusTimeout *int `url:"geo_status_timeout,omitempty" json:"geo_status_timeout,omitempty"` - GitRateLimitUsersAlertlist *[]int `url:"git_rate_limit_users_alertlist,omitempty" json:"git_rate_limit_users_alertlist,omitempty"` - GitTwoFactorSessionExpiry *int `url:"git_two_factor_session_expiry,omitempty" json:"git_two_factor_session_expiry,omitempty"` - GitalyTimeoutDefault *int `url:"gitaly_timeout_default,omitempty" json:"gitaly_timeout_default,omitempty"` - GitalyTimeoutFast *int `url:"gitaly_timeout_fast,omitempty" json:"gitaly_timeout_fast,omitempty"` - GitalyTimeoutMedium *int `url:"gitaly_timeout_medium,omitempty" json:"gitaly_timeout_medium,omitempty"` + GeoStatusTimeout *int64 `url:"geo_status_timeout,omitempty" json:"geo_status_timeout,omitempty"` + GitRateLimitUsersAlertlist *[]int64 `url:"git_rate_limit_users_alertlist,omitempty" json:"git_rate_limit_users_alertlist,omitempty"` + GitTwoFactorSessionExpiry *int64 `url:"git_two_factor_session_expiry,omitempty" json:"git_two_factor_session_expiry,omitempty"` + GitalyTimeoutDefault *int64 `url:"gitaly_timeout_default,omitempty" json:"gitaly_timeout_default,omitempty"` + GitalyTimeoutFast *int64 `url:"gitaly_timeout_fast,omitempty" json:"gitaly_timeout_fast,omitempty"` + GitalyTimeoutMedium *int64 `url:"gitaly_timeout_medium,omitempty" json:"gitaly_timeout_medium,omitempty"` GitlabDedicatedInstance *bool `url:"gitlab_dedicated_instance,omitempty" json:"gitlab_dedicated_instance,omitempty"` GitlabEnvironmentToolkitInstance *bool `url:"gitlab_environment_toolkit_instance,omitempty" json:"gitlab_environment_toolkit_instance,omitempty"` - GitlabShellOperationLimit *int `url:"gitlab_shell_operation_limit,omitempty" json:"gitlab_shell_operation_limit,omitempty"` + GitlabShellOperationLimit *int64 `url:"gitlab_shell_operation_limit,omitempty" json:"gitlab_shell_operation_limit,omitempty"` GitpodEnabled *bool `url:"gitpod_enabled,omitempty" json:"gitpod_enabled,omitempty"` GitpodURL *string `url:"gitpod_url,omitempty" json:"gitpod_url,omitempty"` GitRateLimitUsersAllowlist *[]string `url:"git_rate_limit_users_allowlist,omitempty" json:"git_rate_limit_users_allowlist,omitempty"` @@ -710,11 +710,11 @@ type UpdateSettingsOptions struct { GrafanaEnabled *bool `url:"grafana_enabled,omitempty" json:"grafana_enabled,omitempty"` GrafanaURL *string `url:"grafana_url,omitempty" json:"grafana_url,omitempty"` GravatarEnabled *bool `url:"gravatar_enabled,omitempty" json:"gravatar_enabled,omitempty"` - GroupDownloadExportLimit *int `url:"group_download_export_limit,omitempty" json:"group_download_export_limit,omitempty"` - GroupExportLimit *int `url:"group_export_limit,omitempty" json:"group_export_limit,omitempty"` - GroupImportLimit *int `url:"group_import_limit,omitempty" json:"group_import_limit,omitempty"` + GroupDownloadExportLimit *int64 `url:"group_download_export_limit,omitempty" json:"group_download_export_limit,omitempty"` + GroupExportLimit *int64 `url:"group_export_limit,omitempty" json:"group_export_limit,omitempty"` + GroupImportLimit *int64 `url:"group_import_limit,omitempty" json:"group_import_limit,omitempty"` GroupOwnersCanManageDefaultBranchProtection *bool `url:"group_owners_can_manage_default_branch_protection,omitempty" json:"group_owners_can_manage_default_branch_protection,omitempty"` - GroupRunnerTokenExpirationInterval *int `url:"group_runner_token_expiration_interval,omitempty" json:"group_runner_token_expiration_interval,omitempty"` + GroupRunnerTokenExpirationInterval *int64 `url:"group_runner_token_expiration_interval,omitempty" json:"group_runner_token_expiration_interval,omitempty"` HTMLEmailsEnabled *bool `url:"html_emails_enabled,omitempty" json:"html_emails_enabled,omitempty"` HashedStorageEnabled *bool `url:"hashed_storage_enabled,omitempty" json:"hashed_storage_enabled,omitempty"` HelpPageDocumentationBaseURL *string `url:"help_page_documentation_base_url,omitempty" json:"help_page_documentation_base_url,omitempty"` @@ -725,15 +725,15 @@ type UpdateSettingsOptions struct { HideThirdPartyOffers *bool `url:"hide_third_party_offers,omitempty" json:"hide_third_party_offers,omitempty"` HomePageURL *string `url:"home_page_url,omitempty" json:"home_page_url,omitempty"` HousekeepingEnabled *bool `url:"housekeeping_enabled,omitempty" json:"housekeeping_enabled,omitempty"` - HousekeepingOptimizeRepositoryPeriod *int `url:"housekeeping_optimize_repository_period,omitempty" json:"housekeeping_optimize_repository_period,omitempty"` + HousekeepingOptimizeRepositoryPeriod *int64 `url:"housekeeping_optimize_repository_period,omitempty" json:"housekeeping_optimize_repository_period,omitempty"` ImportSources *[]string `url:"import_sources,omitempty" json:"import_sources,omitempty"` - InactiveProjectsDeleteAfterMonths *int `url:"inactive_projects_delete_after_months,omitempty" json:"inactive_projects_delete_after_months,omitempty"` - InactiveProjectsMinSizeMB *int `url:"inactive_projects_min_size_mb,omitempty" json:"inactive_projects_min_size_mb,omitempty"` - InactiveProjectsSendWarningEmailAfterMonths *int `url:"inactive_projects_send_warning_email_after_months,omitempty" json:"inactive_projects_send_warning_email_after_months,omitempty"` + InactiveProjectsDeleteAfterMonths *int64 `url:"inactive_projects_delete_after_months,omitempty" json:"inactive_projects_delete_after_months,omitempty"` + InactiveProjectsMinSizeMB *int64 `url:"inactive_projects_min_size_mb,omitempty" json:"inactive_projects_min_size_mb,omitempty"` + InactiveProjectsSendWarningEmailAfterMonths *int64 `url:"inactive_projects_send_warning_email_after_months,omitempty" json:"inactive_projects_send_warning_email_after_months,omitempty"` IncludeOptionalMetricsInServicePing *bool `url:"include_optional_metrics_in_service_ping,omitempty" json:"include_optional_metrics_in_service_ping,omitempty"` InProductMarketingEmailsEnabled *bool `url:"in_product_marketing_emails_enabled,omitempty" json:"in_product_marketing_emails_enabled,omitempty"` InvisibleCaptchaEnabled *bool `url:"invisible_captcha_enabled,omitempty" json:"invisible_captcha_enabled,omitempty"` - IssuesCreateLimit *int `url:"issues_create_limit,omitempty" json:"issues_create_limit,omitempty"` + IssuesCreateLimit *int64 `url:"issues_create_limit,omitempty" json:"issues_create_limit,omitempty"` JiraConnectApplicationKey *string `url:"jira_connect_application_key,omitempty" json:"jira_connect_application_key,omitempty"` JiraConnectPublicKeyStorageEnabled *bool `url:"jira_connect_public_key_storage_enabled,omitempty" json:"jira_connect_public_key_storage_enabled,omitempty"` JiraConnectProxyURL *string `url:"jira_connect_proxy_url,omitempty" json:"jira_connect_proxy_url,omitempty"` @@ -741,7 +741,7 @@ type UpdateSettingsOptions struct { KrokiEnabled *bool `url:"kroki_enabled,omitempty" json:"kroki_enabled,omitempty"` KrokiFormats *map[string]bool `url:"kroki_formats,omitempty" json:"kroki_formats,omitempty"` KrokiURL *string `url:"kroki_url,omitempty" json:"kroki_url,omitempty"` - LocalMarkdownVersion *int `url:"local_markdown_version,omitempty" json:"local_markdown_version,omitempty"` + LocalMarkdownVersion *int64 `url:"local_markdown_version,omitempty" json:"local_markdown_version,omitempty"` LockDuoFeaturesEnabled *bool `url:"lock_duo_features_enabled,omitempty" json:"lock_duo_features_enabled,omitempty"` LockMembershipsToLDAP *bool `url:"lock_memberships_to_ldap,omitempty" json:"lock_memberships_to_ldap,omitempty"` LoginRecaptchaProtectionEnabled *bool `url:"login_recaptcha_protection_enabled,omitempty" json:"login_recaptcha_protection_enabled,omitempty"` @@ -750,36 +750,36 @@ type UpdateSettingsOptions struct { MaintenanceMode *bool `url:"maintenance_mode,omitempty" json:"maintenance_mode,omitempty"` MaintenanceModeMessage *string `url:"maintenance_mode_message,omitempty" json:"maintenance_mode_message,omitempty"` MavenPackageRequestsForwarding *bool `url:"maven_package_requests_forwarding,omitempty" json:"maven_package_requests_forwarding,omitempty"` - MaxArtifactsSize *int `url:"max_artifacts_size,omitempty" json:"max_artifacts_size,omitempty"` - MaxAttachmentSize *int `url:"max_attachment_size,omitempty" json:"max_attachment_size,omitempty"` - MaxDecompressedArchiveSize *int `url:"max_decompressed_archive_size,omitempty" json:"max_decompressed_archive_size,omitempty"` - MaxExportSize *int `url:"max_export_size,omitempty" json:"max_export_size,omitempty"` - MaxImportRemoteFileSize *int `url:"max_import_remote_file_size,omitempty" json:"max_import_remote_file_size,omitempty"` - MaxImportSize *int `url:"max_import_size,omitempty" json:"max_import_size,omitempty"` - MaxLoginAttempts *int `url:"max_login_attempts,omitempty" json:"max_login_attempts,omitempty"` - MaxNumberOfRepositoryDownloads *int `url:"max_number_of_repository_downloads,omitempty" json:"max_number_of_repository_downloads,omitempty"` - MaxNumberOfRepositoryDownloadsWithinTimePeriod *int `url:"max_number_of_repository_downloads_within_time_period,omitempty" json:"max_number_of_repository_downloads_within_time_period,omitempty"` - MaxPagesSize *int `url:"max_pages_size,omitempty" json:"max_pages_size,omitempty"` - MaxPersonalAccessTokenLifetime *int `url:"max_personal_access_token_lifetime,omitempty" json:"max_personal_access_token_lifetime,omitempty"` - MaxSSHKeyLifetime *int `url:"max_ssh_key_lifetime,omitempty" json:"max_ssh_key_lifetime,omitempty"` - MaxTerraformStateSizeBytes *int `url:"max_terraform_state_size_bytes,omitempty" json:"max_terraform_state_size_bytes,omitempty"` - MaxYAMLDepth *int `url:"max_yaml_depth,omitempty" json:"max_yaml_depth,omitempty"` - MaxYAMLSizeBytes *int `url:"max_yaml_size_bytes,omitempty" json:"max_yaml_size_bytes,omitempty"` - MetricsMethodCallThreshold *int `url:"metrics_method_call_threshold,omitempty" json:"metrics_method_call_threshold,omitempty"` - MinimumPasswordLength *int `url:"minimum_password_length,omitempty" json:"minimum_password_length,omitempty"` + MaxArtifactsSize *int64 `url:"max_artifacts_size,omitempty" json:"max_artifacts_size,omitempty"` + MaxAttachmentSize *int64 `url:"max_attachment_size,omitempty" json:"max_attachment_size,omitempty"` + MaxDecompressedArchiveSize *int64 `url:"max_decompressed_archive_size,omitempty" json:"max_decompressed_archive_size,omitempty"` + MaxExportSize *int64 `url:"max_export_size,omitempty" json:"max_export_size,omitempty"` + MaxImportRemoteFileSize *int64 `url:"max_import_remote_file_size,omitempty" json:"max_import_remote_file_size,omitempty"` + MaxImportSize *int64 `url:"max_import_size,omitempty" json:"max_import_size,omitempty"` + MaxLoginAttempts *int64 `url:"max_login_attempts,omitempty" json:"max_login_attempts,omitempty"` + MaxNumberOfRepositoryDownloads *int64 `url:"max_number_of_repository_downloads,omitempty" json:"max_number_of_repository_downloads,omitempty"` + MaxNumberOfRepositoryDownloadsWithinTimePeriod *int64 `url:"max_number_of_repository_downloads_within_time_period,omitempty" json:"max_number_of_repository_downloads_within_time_period,omitempty"` + MaxPagesSize *int64 `url:"max_pages_size,omitempty" json:"max_pages_size,omitempty"` + MaxPersonalAccessTokenLifetime *int64 `url:"max_personal_access_token_lifetime,omitempty" json:"max_personal_access_token_lifetime,omitempty"` + MaxSSHKeyLifetime *int64 `url:"max_ssh_key_lifetime,omitempty" json:"max_ssh_key_lifetime,omitempty"` + MaxTerraformStateSizeBytes *int64 `url:"max_terraform_state_size_bytes,omitempty" json:"max_terraform_state_size_bytes,omitempty"` + MaxYAMLDepth *int64 `url:"max_yaml_depth,omitempty" json:"max_yaml_depth,omitempty"` + MaxYAMLSizeBytes *int64 `url:"max_yaml_size_bytes,omitempty" json:"max_yaml_size_bytes,omitempty"` + MetricsMethodCallThreshold *int64 `url:"metrics_method_call_threshold,omitempty" json:"metrics_method_call_threshold,omitempty"` + MinimumPasswordLength *int64 `url:"minimum_password_length,omitempty" json:"minimum_password_length,omitempty"` MirrorAvailable *bool `url:"mirror_available,omitempty" json:"mirror_available,omitempty"` - MirrorCapacityThreshold *int `url:"mirror_capacity_threshold,omitempty" json:"mirror_capacity_threshold,omitempty"` - MirrorMaxCapacity *int `url:"mirror_max_capacity,omitempty" json:"mirror_max_capacity,omitempty"` - MirrorMaxDelay *int `url:"mirror_max_delay,omitempty" json:"mirror_max_delay,omitempty"` + MirrorCapacityThreshold *int64 `url:"mirror_capacity_threshold,omitempty" json:"mirror_capacity_threshold,omitempty"` + MirrorMaxCapacity *int64 `url:"mirror_max_capacity,omitempty" json:"mirror_max_capacity,omitempty"` + MirrorMaxDelay *int64 `url:"mirror_max_delay,omitempty" json:"mirror_max_delay,omitempty"` NPMPackageRequestsForwarding *bool `url:"npm_package_requests_forwarding,omitempty" json:"npm_package_requests_forwarding,omitempty"` - NotesCreateLimit *int `url:"notes_create_limit,omitempty" json:"notes_create_limit,omitempty"` + NotesCreateLimit *int64 `url:"notes_create_limit,omitempty" json:"notes_create_limit,omitempty"` NotifyOnUnknownSignIn *bool `url:"notify_on_unknown_sign_in,omitempty" json:"notify_on_unknown_sign_in,omitempty"` NugetSkipMetadataURLValidation *bool `url:"nuget_skip_metadata_url_validation,omitempty" json:"nuget_skip_metadata_url_validation,omitempty"` OutboundLocalRequestsAllowlistRaw *string `url:"outbound_local_requests_allowlist_raw,omitempty" json:"outbound_local_requests_allowlist_raw,omitempty"` OutboundLocalRequestsWhitelist *[]string `url:"outbound_local_requests_whitelist,omitempty" json:"outbound_local_requests_whitelist,omitempty"` - PackageMetadataPURLTypes *[]int `url:"package_metadata_purl_types,omitempty" json:"package_metadata_purl_types,omitempty"` + PackageMetadataPURLTypes *[]int64 `url:"package_metadata_purl_types,omitempty" json:"package_metadata_purl_types,omitempty"` PackageRegistryAllowAnyoneToPullOption *bool `url:"package_registry_allow_anyone_to_pull_option,omitempty" json:"package_registry_allow_anyone_to_pull_option,omitempty"` - PackageRegistryCleanupPoliciesWorkerCapacity *int `url:"package_registry_cleanup_policies_worker_capacity,omitempty" json:"package_registry_cleanup_policies_worker_capacity,omitempty"` + PackageRegistryCleanupPoliciesWorkerCapacity *int64 `url:"package_registry_cleanup_policies_worker_capacity,omitempty" json:"package_registry_cleanup_policies_worker_capacity,omitempty"` PagesDomainVerificationEnabled *bool `url:"pages_domain_verification_enabled,omitempty" json:"pages_domain_verification_enabled,omitempty"` PasswordAuthenticationEnabledForGit *bool `url:"password_authentication_enabled_for_git,omitempty" json:"password_authentication_enabled_for_git,omitempty"` PasswordAuthenticationEnabledForWeb *bool `url:"password_authentication_enabled_for_web,omitempty" json:"password_authentication_enabled_for_web,omitempty"` @@ -791,49 +791,49 @@ type UpdateSettingsOptions struct { PersonalAccessTokenPrefix *string `url:"personal_access_token_prefix,omitempty" json:"personal_access_token_prefix,omitempty"` PlantumlEnabled *bool `url:"plantuml_enabled,omitempty" json:"plantuml_enabled,omitempty"` PlantumlURL *string `url:"plantuml_url,omitempty" json:"plantuml_url,omitempty"` - PipelineLimitPerProjectUserSha *int `url:"pipeline_limit_per_project_user_sha,omitempty" json:"pipeline_limit_per_project_user_sha,omitempty"` + PipelineLimitPerProjectUserSha *int64 `url:"pipeline_limit_per_project_user_sha,omitempty" json:"pipeline_limit_per_project_user_sha,omitempty"` PollingIntervalMultiplier *float64 `url:"polling_interval_multiplier,omitempty" json:"polling_interval_multiplier,omitempty"` PreventMergeRequestsAuthorApproval *bool `url:"prevent_merge_requests_author_approval,omitempty" json:"prevent_merge_requests_author_approval,omitempty"` PreventMergeRequestsCommittersApproval *bool `url:"prevent_merge_requests_committers_approval,omitempty" json:"prevent_merge_requests_committers_approval,omitempty"` - ProjectDownloadExportLimit *int `url:"project_download_export_limit,omitempty" json:"project_download_export_limit,omitempty"` + ProjectDownloadExportLimit *int64 `url:"project_download_export_limit,omitempty" json:"project_download_export_limit,omitempty"` ProjectExportEnabled *bool `url:"project_export_enabled,omitempty" json:"project_export_enabled,omitempty"` - ProjectExportLimit *int `url:"project_export_limit,omitempty" json:"project_export_limit,omitempty"` - ProjectImportLimit *int `url:"project_import_limit,omitempty" json:"project_import_limit,omitempty"` - ProjectJobsAPIRateLimit *int `url:"project_jobs_api_rate_limit,omitempty" json:"project_jobs_api_rate_limit,omitempty"` - ProjectRunnerTokenExpirationInterval *int `url:"project_runner_token_expiration_interval,omitempty" json:"project_runner_token_expiration_interval,omitempty"` - ProjectsAPIRateLimitUnauthenticated *int `url:"projects_api_rate_limit_unauthenticated,omitempty" json:"projects_api_rate_limit_unauthenticated,omitempty"` + ProjectExportLimit *int64 `url:"project_export_limit,omitempty" json:"project_export_limit,omitempty"` + ProjectImportLimit *int64 `url:"project_import_limit,omitempty" json:"project_import_limit,omitempty"` + ProjectJobsAPIRateLimit *int64 `url:"project_jobs_api_rate_limit,omitempty" json:"project_jobs_api_rate_limit,omitempty"` + ProjectRunnerTokenExpirationInterval *int64 `url:"project_runner_token_expiration_interval,omitempty" json:"project_runner_token_expiration_interval,omitempty"` + ProjectsAPIRateLimitUnauthenticated *int64 `url:"projects_api_rate_limit_unauthenticated,omitempty" json:"projects_api_rate_limit_unauthenticated,omitempty"` PrometheusMetricsEnabled *bool `url:"prometheus_metrics_enabled,omitempty" json:"prometheus_metrics_enabled,omitempty"` ProtectedCIVariables *bool `url:"protected_ci_variables,omitempty" json:"protected_ci_variables,omitempty"` PseudonymizerEnabled *bool `url:"pseudonymizer_enabled,omitempty" json:"pseudonymizer_enabled,omitempty"` - PushEventActivitiesLimit *int `url:"push_event_activities_limit,omitempty" json:"push_event_activities_limit,omitempty"` - PushEventHooksLimit *int `url:"push_event_hooks_limit,omitempty" json:"push_event_hooks_limit,omitempty"` + PushEventActivitiesLimit *int64 `url:"push_event_activities_limit,omitempty" json:"push_event_activities_limit,omitempty"` + PushEventHooksLimit *int64 `url:"push_event_hooks_limit,omitempty" json:"push_event_hooks_limit,omitempty"` PyPIPackageRequestsForwarding *bool `url:"pypi_package_requests_forwarding,omitempty" json:"pypi_package_requests_forwarding,omitempty"` - RSAKeyRestriction *int `url:"rsa_key_restriction,omitempty" json:"rsa_key_restriction,omitempty"` + RSAKeyRestriction *int64 `url:"rsa_key_restriction,omitempty" json:"rsa_key_restriction,omitempty"` RateLimitingResponseText *string `url:"rate_limiting_response_text,omitempty" json:"rate_limiting_response_text,omitempty"` - RawBlobRequestLimit *int `url:"raw_blob_request_limit,omitempty" json:"raw_blob_request_limit,omitempty"` + RawBlobRequestLimit *int64 `url:"raw_blob_request_limit,omitempty" json:"raw_blob_request_limit,omitempty"` RecaptchaEnabled *bool `url:"recaptcha_enabled,omitempty" json:"recaptcha_enabled,omitempty"` RecaptchaPrivateKey *string `url:"recaptcha_private_key,omitempty" json:"recaptcha_private_key,omitempty"` RecaptchaSiteKey *string `url:"recaptcha_site_key,omitempty" json:"recaptcha_site_key,omitempty"` - ReceiveMaxInputSize *int `url:"receive_max_input_size,omitempty" json:"receive_max_input_size,omitempty"` + ReceiveMaxInputSize *int64 `url:"receive_max_input_size,omitempty" json:"receive_max_input_size,omitempty"` ReceptiveClusterAgentsEnabled *bool `url:"receptive_cluster_agents_enabled,omitempty" json:"receptive_cluster_agents_enabled,omitempty"` RememberMeEnabled *bool `url:"remember_me_enabled,omitempty" json:"remember_me_enabled,omitempty"` RepositoryChecksEnabled *bool `url:"repository_checks_enabled,omitempty" json:"repository_checks_enabled,omitempty"` - RepositorySizeLimit *int `url:"repository_size_limit,omitempty" json:"repository_size_limit,omitempty"` + RepositorySizeLimit *int64 `url:"repository_size_limit,omitempty" json:"repository_size_limit,omitempty"` RepositoryStorages *[]string `url:"repository_storages,omitempty" json:"repository_storages,omitempty"` - RepositoryStoragesWeighted *map[string]int `url:"repository_storages_weighted,omitempty" json:"repository_storages_weighted,omitempty"` + RepositoryStoragesWeighted *map[string]int64 `url:"repository_storages_weighted,omitempty" json:"repository_storages_weighted,omitempty"` RequireAdminApprovalAfterUserSignup *bool `url:"require_admin_approval_after_user_signup,omitempty" json:"require_admin_approval_after_user_signup,omitempty"` RequireAdminTwoFactorAuthentication *bool `url:"require_admin_two_factor_authentication,omitempty" json:"require_admin_two_factor_authentication,omitempty"` RequirePersonalAccessTokenExpiry *bool `url:"require_personal_access_token_expiry,omitempty" json:"require_personal_access_token_expiry,omitempty"` RequireTwoFactorAuthentication *bool `url:"require_two_factor_authentication,omitempty" json:"require_two_factor_authentication,omitempty"` RestrictedVisibilityLevels *[]VisibilityValue `url:"restricted_visibility_levels,omitempty" json:"restricted_visibility_levels,omitempty"` - RunnerTokenExpirationInterval *int `url:"runner_token_expiration_interval,omitempty" json:"runner_token_expiration_interval,omitempty"` - SearchRateLimit *int `url:"search_rate_limit,omitempty" json:"search_rate_limit,omitempty"` - SearchRateLimitUnauthenticated *int `url:"search_rate_limit_unauthenticated,omitempty" json:"search_rate_limit_unauthenticated,omitempty"` + RunnerTokenExpirationInterval *int64 `url:"runner_token_expiration_interval,omitempty" json:"runner_token_expiration_interval,omitempty"` + SearchRateLimit *int64 `url:"search_rate_limit,omitempty" json:"search_rate_limit,omitempty"` + SearchRateLimitUnauthenticated *int64 `url:"search_rate_limit_unauthenticated,omitempty" json:"search_rate_limit_unauthenticated,omitempty"` SecretDetectionRevocationTokenTypesURL *string `url:"secret_detection_revocation_token_types_url,omitempty" json:"secret_detection_revocation_token_types_url,omitempty"` SecretDetectionTokenRevocationEnabled *bool `url:"secret_detection_token_revocation_enabled,omitempty" json:"secret_detection_token_revocation_enabled,omitempty"` SecretDetectionTokenRevocationToken *string `url:"secret_detection_token_revocation_token,omitempty" json:"secret_detection_token_revocation_token,omitempty"` SecretDetectionTokenRevocationURL *string `url:"secret_detection_token_revocation_url,omitempty" json:"secret_detection_token_revocation_url,omitempty"` - SecurityApprovalPoliciesLimit *int `url:"security_approval_policies_limit,omitempty" json:"security_approval_policies_limit,omitempty"` + SecurityApprovalPoliciesLimit *int64 `url:"security_approval_policies_limit,omitempty" json:"security_approval_policies_limit,omitempty"` SecurityPolicyGlobalGroupApproversEnabled *bool `url:"security_policy_global_group_approvers_enabled,omitempty" json:"security_policy_global_group_approvers_enabled,omitempty"` SecurityTXTContent *string `url:"security_txt_content,omitempty" json:"security_txt_content,omitempty"` SendUserConfirmationEmail *bool `url:"send_user_confirmation_email,omitempty" json:"send_user_confirmation_email,omitempty"` @@ -842,12 +842,12 @@ type UpdateSettingsOptions struct { SentryEnabled *string `url:"sentry_enabled,omitempty" json:"sentry_enabled,omitempty"` SentryEnvironment *string `url:"sentry_environment,omitempty" json:"sentry_environment,omitempty"` ServiceAccessTokensExpirationEnforced *bool `url:"service_access_tokens_expiration_enforced,omitempty" json:"service_access_tokens_expiration_enforced,omitempty"` - SessionExpireDelay *int `url:"session_expire_delay,omitempty" json:"session_expire_delay,omitempty"` + SessionExpireDelay *int64 `url:"session_expire_delay,omitempty" json:"session_expire_delay,omitempty"` SharedRunnersEnabled *bool `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"` - SharedRunnersMinutes *int `url:"shared_runners_minutes,omitempty" json:"shared_runners_minutes,omitempty"` + SharedRunnersMinutes *int64 `url:"shared_runners_minutes,omitempty" json:"shared_runners_minutes,omitempty"` SharedRunnersText *string `url:"shared_runners_text,omitempty" json:"shared_runners_text,omitempty"` - SidekiqJobLimiterCompressionThresholdBytes *int `url:"sidekiq_job_limiter_compression_threshold_bytes,omitempty" json:"sidekiq_job_limiter_compression_threshold_bytes,omitempty"` - SidekiqJobLimiterLimitBytes *int `url:"sidekiq_job_limiter_limit_bytes,omitempty" json:"sidekiq_job_limiter_limit_bytes,omitempty"` + SidekiqJobLimiterCompressionThresholdBytes *int64 `url:"sidekiq_job_limiter_compression_threshold_bytes,omitempty" json:"sidekiq_job_limiter_compression_threshold_bytes,omitempty"` + SidekiqJobLimiterLimitBytes *int64 `url:"sidekiq_job_limiter_limit_bytes,omitempty" json:"sidekiq_job_limiter_limit_bytes,omitempty"` SidekiqJobLimiterMode *string `url:"sidekiq_job_limiter_mode,omitempty" json:"sidekiq_job_limiter_mode,omitempty"` SignInText *string `url:"sign_in_text,omitempty" json:"sign_in_text,omitempty"` SignupEnabled *bool `url:"signup_enabled,omitempty" json:"signup_enabled,omitempty"` @@ -858,7 +858,7 @@ type UpdateSettingsOptions struct { SlackAppSecret *string `url:"slack_app_secret,omitempty" json:"slack_app_secret,omitempty"` SlackAppSigningSecret *string `url:"slack_app_signing_secret,omitempty" json:"slack_app_signing_secret,omitempty"` SlackAppVerificationToken *string `url:"slack_app_verification_token,omitempty" json:"slack_app_verification_token,omitempty"` - SnippetSizeLimit *int `url:"snippet_size_limit,omitempty" json:"snippet_size_limit,omitempty"` + SnippetSizeLimit *int64 `url:"snippet_size_limit,omitempty" json:"snippet_size_limit,omitempty"` SnowplowAppID *string `url:"snowplow_app_id,omitempty" json:"snowplow_app_id,omitempty"` SnowplowCollectorHostname *string `url:"snowplow_collector_hostname,omitempty" json:"snowplow_collector_hostname,omitempty"` SnowplowCookieDomain *string `url:"snowplow_cookie_domain,omitempty" json:"snowplow_cookie_domain,omitempty"` @@ -873,56 +873,56 @@ type UpdateSettingsOptions struct { StaticObjectsExternalStorageAuthToken *string `url:"static_objects_external_storage_auth_token,omitempty" json:"static_objects_external_storage_auth_token,omitempty"` StaticObjectsExternalStorageURL *string `url:"static_objects_external_storage_url,omitempty" json:"static_objects_external_storage_url,omitempty"` SuggestPipelineEnabled *bool `url:"suggest_pipeline_enabled,omitempty" json:"suggest_pipeline_enabled,omitempty"` - TerminalMaxSessionTime *int `url:"terminal_max_session_time,omitempty" json:"terminal_max_session_time,omitempty"` + TerminalMaxSessionTime *int64 `url:"terminal_max_session_time,omitempty" json:"terminal_max_session_time,omitempty"` Terms *string `url:"terms,omitempty" json:"terms,omitempty"` ThrottleAuthenticatedAPIEnabled *bool `url:"throttle_authenticated_api_enabled,omitempty" json:"throttle_authenticated_api_enabled,omitempty"` - ThrottleAuthenticatedAPIPeriodInSeconds *int `url:"throttle_authenticated_api_period_in_seconds,omitempty" json:"throttle_authenticated_api_period_in_seconds,omitempty"` - ThrottleAuthenticatedAPIRequestsPerPeriod *int `url:"throttle_authenticated_api_requests_per_period,omitempty" json:"throttle_authenticated_api_requests_per_period,omitempty"` + ThrottleAuthenticatedAPIPeriodInSeconds *int64 `url:"throttle_authenticated_api_period_in_seconds,omitempty" json:"throttle_authenticated_api_period_in_seconds,omitempty"` + ThrottleAuthenticatedAPIRequestsPerPeriod *int64 `url:"throttle_authenticated_api_requests_per_period,omitempty" json:"throttle_authenticated_api_requests_per_period,omitempty"` ThrottleAuthenticatedDeprecatedAPIEnabled *bool `url:"throttle_authenticated_deprecated_api_enabled,omitempty" json:"throttle_authenticated_deprecated_api_enabled,omitempty"` - ThrottleAuthenticatedDeprecatedAPIPeriodInSeconds *int `url:"throttle_authenticated_deprecated_api_period_in_seconds,omitempty" json:"throttle_authenticated_deprecated_api_period_in_seconds,omitempty"` - ThrottleAuthenticatedDeprecatedAPIRequestsPerPeriod *int `url:"throttle_authenticated_deprecated_api_requests_per_period,omitempty" json:"throttle_authenticated_deprecated_api_requests_per_period,omitempty"` + ThrottleAuthenticatedDeprecatedAPIPeriodInSeconds *int64 `url:"throttle_authenticated_deprecated_api_period_in_seconds,omitempty" json:"throttle_authenticated_deprecated_api_period_in_seconds,omitempty"` + ThrottleAuthenticatedDeprecatedAPIRequestsPerPeriod *int64 `url:"throttle_authenticated_deprecated_api_requests_per_period,omitempty" json:"throttle_authenticated_deprecated_api_requests_per_period,omitempty"` ThrottleAuthenticatedFilesAPIEnabled *bool `url:"throttle_authenticated_files_api_enabled,omitempty" json:"throttle_authenticated_files_api_enabled,omitempty"` - ThrottleAuthenticatedFilesAPIPeriodInSeconds *int `url:"throttle_authenticated_files_api_period_in_seconds,omitempty" json:"throttle_authenticated_files_api_period_in_seconds,omitempty"` - ThrottleAuthenticatedFilesAPIRequestsPerPeriod *int `url:"throttle_authenticated_files_api_requests_per_period,omitempty" json:"throttle_authenticated_files_api_requests_per_period,omitempty"` + ThrottleAuthenticatedFilesAPIPeriodInSeconds *int64 `url:"throttle_authenticated_files_api_period_in_seconds,omitempty" json:"throttle_authenticated_files_api_period_in_seconds,omitempty"` + ThrottleAuthenticatedFilesAPIRequestsPerPeriod *int64 `url:"throttle_authenticated_files_api_requests_per_period,omitempty" json:"throttle_authenticated_files_api_requests_per_period,omitempty"` ThrottleAuthenticatedGitLFSEnabled *bool `url:"throttle_authenticated_git_lfs_enabled,omitempty" json:"throttle_authenticated_git_lfs_enabled,omitempty"` - ThrottleAuthenticatedGitLFSPeriodInSeconds *int `url:"throttle_authenticated_git_lfs_period_in_seconds,omitempty" json:"throttle_authenticated_git_lfs_period_in_seconds,omitempty"` - ThrottleAuthenticatedGitLFSRequestsPerPeriod *int `url:"throttle_authenticated_git_lfs_requests_per_period,omitempty" json:"throttle_authenticated_git_lfs_requests_per_period,omitempty"` + ThrottleAuthenticatedGitLFSPeriodInSeconds *int64 `url:"throttle_authenticated_git_lfs_period_in_seconds,omitempty" json:"throttle_authenticated_git_lfs_period_in_seconds,omitempty"` + ThrottleAuthenticatedGitLFSRequestsPerPeriod *int64 `url:"throttle_authenticated_git_lfs_requests_per_period,omitempty" json:"throttle_authenticated_git_lfs_requests_per_period,omitempty"` ThrottleAuthenticatedPackagesAPIEnabled *bool `url:"throttle_authenticated_packages_api_enabled,omitempty" json:"throttle_authenticated_packages_api_enabled,omitempty"` - ThrottleAuthenticatedPackagesAPIPeriodInSeconds *int `url:"throttle_authenticated_packages_api_period_in_seconds,omitempty" json:"throttle_authenticated_packages_api_period_in_seconds,omitempty"` - ThrottleAuthenticatedPackagesAPIRequestsPerPeriod *int `url:"throttle_authenticated_packages_api_requests_per_period,omitempty" json:"throttle_authenticated_packages_api_requests_per_period,omitempty"` + ThrottleAuthenticatedPackagesAPIPeriodInSeconds *int64 `url:"throttle_authenticated_packages_api_period_in_seconds,omitempty" json:"throttle_authenticated_packages_api_period_in_seconds,omitempty"` + ThrottleAuthenticatedPackagesAPIRequestsPerPeriod *int64 `url:"throttle_authenticated_packages_api_requests_per_period,omitempty" json:"throttle_authenticated_packages_api_requests_per_period,omitempty"` ThrottleAuthenticatedWebEnabled *bool `url:"throttle_authenticated_web_enabled,omitempty" json:"throttle_authenticated_web_enabled,omitempty"` - ThrottleAuthenticatedWebPeriodInSeconds *int `url:"throttle_authenticated_web_period_in_seconds,omitempty" json:"throttle_authenticated_web_period_in_seconds,omitempty"` - ThrottleAuthenticatedWebRequestsPerPeriod *int `url:"throttle_authenticated_web_requests_per_period,omitempty" json:"throttle_authenticated_web_requests_per_period,omitempty"` + ThrottleAuthenticatedWebPeriodInSeconds *int64 `url:"throttle_authenticated_web_period_in_seconds,omitempty" json:"throttle_authenticated_web_period_in_seconds,omitempty"` + ThrottleAuthenticatedWebRequestsPerPeriod *int64 `url:"throttle_authenticated_web_requests_per_period,omitempty" json:"throttle_authenticated_web_requests_per_period,omitempty"` ThrottleIncidentManagementNotificationEnabled *bool `url:"throttle_incident_management_notification_enabled,omitempty" json:"throttle_incident_management_notification_enabled,omitempty"` - ThrottleIncidentManagementNotificationPerPeriod *int `url:"throttle_incident_management_notification_per_period,omitempty" json:"throttle_incident_management_notification_per_period,omitempty"` - ThrottleIncidentManagementNotificationPeriodInSeconds *int `url:"throttle_incident_management_notification_period_in_seconds,omitempty" json:"throttle_incident_management_notification_period_in_seconds,omitempty"` + ThrottleIncidentManagementNotificationPerPeriod *int64 `url:"throttle_incident_management_notification_per_period,omitempty" json:"throttle_incident_management_notification_per_period,omitempty"` + ThrottleIncidentManagementNotificationPeriodInSeconds *int64 `url:"throttle_incident_management_notification_period_in_seconds,omitempty" json:"throttle_incident_management_notification_period_in_seconds,omitempty"` ThrottleProtectedPathsEnabled *bool `url:"throttle_protected_paths_enabled_enabled,omitempty" json:"throttle_protected_paths_enabled,omitempty"` - ThrottleProtectedPathsPeriodInSeconds *int `url:"throttle_protected_paths_enabled_period_in_seconds,omitempty" json:"throttle_protected_paths_period_in_seconds,omitempty"` - ThrottleProtectedPathsRequestsPerPeriod *int `url:"throttle_protected_paths_enabled_requests_per_period,omitempty" json:"throttle_protected_paths_per_period,omitempty"` + ThrottleProtectedPathsPeriodInSeconds *int64 `url:"throttle_protected_paths_enabled_period_in_seconds,omitempty" json:"throttle_protected_paths_period_in_seconds,omitempty"` + ThrottleProtectedPathsRequestsPerPeriod *int64 `url:"throttle_protected_paths_enabled_requests_per_period,omitempty" json:"throttle_protected_paths_per_period,omitempty"` ThrottleUnauthenticatedAPIEnabled *bool `url:"throttle_unauthenticated_api_enabled,omitempty" json:"throttle_unauthenticated_api_enabled,omitempty"` - ThrottleUnauthenticatedAPIPeriodInSeconds *int `url:"throttle_unauthenticated_api_period_in_seconds,omitempty" json:"throttle_unauthenticated_api_period_in_seconds,omitempty"` - ThrottleUnauthenticatedAPIRequestsPerPeriod *int `url:"throttle_unauthenticated_api_requests_per_period,omitempty" json:"throttle_unauthenticated_api_requests_per_period,omitempty"` + ThrottleUnauthenticatedAPIPeriodInSeconds *int64 `url:"throttle_unauthenticated_api_period_in_seconds,omitempty" json:"throttle_unauthenticated_api_period_in_seconds,omitempty"` + ThrottleUnauthenticatedAPIRequestsPerPeriod *int64 `url:"throttle_unauthenticated_api_requests_per_period,omitempty" json:"throttle_unauthenticated_api_requests_per_period,omitempty"` ThrottleUnauthenticatedDeprecatedAPIEnabled *bool `url:"throttle_unauthenticated_deprecated_api_enabled,omitempty" json:"throttle_unauthenticated_deprecated_api_enabled,omitempty"` - ThrottleUnauthenticatedDeprecatedAPIPeriodInSeconds *int `url:"throttle_unauthenticated_deprecated_api_period_in_seconds,omitempty" json:"throttle_unauthenticated_deprecated_api_period_in_seconds,omitempty"` - ThrottleUnauthenticatedDeprecatedAPIRequestsPerPeriod *int `url:"throttle_unauthenticated_deprecated_api_requests_per_period,omitempty" json:"throttle_unauthenticated_deprecated_api_requests_per_period,omitempty"` + ThrottleUnauthenticatedDeprecatedAPIPeriodInSeconds *int64 `url:"throttle_unauthenticated_deprecated_api_period_in_seconds,omitempty" json:"throttle_unauthenticated_deprecated_api_period_in_seconds,omitempty"` + ThrottleUnauthenticatedDeprecatedAPIRequestsPerPeriod *int64 `url:"throttle_unauthenticated_deprecated_api_requests_per_period,omitempty" json:"throttle_unauthenticated_deprecated_api_requests_per_period,omitempty"` ThrottleUnauthenticatedFilesAPIEnabled *bool `url:"throttle_unauthenticated_files_api_enabled,omitempty" json:"throttle_unauthenticated_files_api_enabled,omitempty"` - ThrottleUnauthenticatedFilesAPIPeriodInSeconds *int `url:"throttle_unauthenticated_files_api_period_in_seconds,omitempty" json:"throttle_unauthenticated_files_api_period_in_seconds,omitempty"` - ThrottleUnauthenticatedFilesAPIRequestsPerPeriod *int `url:"throttle_unauthenticated_files_api_requests_per_period,omitempty" json:"throttle_unauthenticated_files_api_requests_per_period,omitempty"` + ThrottleUnauthenticatedFilesAPIPeriodInSeconds *int64 `url:"throttle_unauthenticated_files_api_period_in_seconds,omitempty" json:"throttle_unauthenticated_files_api_period_in_seconds,omitempty"` + ThrottleUnauthenticatedFilesAPIRequestsPerPeriod *int64 `url:"throttle_unauthenticated_files_api_requests_per_period,omitempty" json:"throttle_unauthenticated_files_api_requests_per_period,omitempty"` ThrottleUnauthenticatedGitLFSEnabled *bool `url:"throttle_unauthenticated_git_lfs_enabled,omitempty" json:"throttle_unauthenticated_git_lfs_enabled,omitempty"` - ThrottleUnauthenticatedGitLFSPeriodInSeconds *int `url:"throttle_unauthenticated_git_lfs_period_in_seconds,omitempty" json:"throttle_unauthenticated_git_lfs_period_in_seconds,omitempty"` - ThrottleUnauthenticatedGitLFSRequestsPerPeriod *int `url:"throttle_unauthenticated_git_lfs_requests_per_period,omitempty" json:"throttle_unauthenticated_git_lfs_requests_per_period,omitempty"` + ThrottleUnauthenticatedGitLFSPeriodInSeconds *int64 `url:"throttle_unauthenticated_git_lfs_period_in_seconds,omitempty" json:"throttle_unauthenticated_git_lfs_period_in_seconds,omitempty"` + ThrottleUnauthenticatedGitLFSRequestsPerPeriod *int64 `url:"throttle_unauthenticated_git_lfs_requests_per_period,omitempty" json:"throttle_unauthenticated_git_lfs_requests_per_period,omitempty"` ThrottleUnauthenticatedPackagesAPIEnabled *bool `url:"throttle_unauthenticated_packages_api_enabled,omitempty" json:"throttle_unauthenticated_packages_api_enabled,omitempty"` - ThrottleUnauthenticatedPackagesAPIPeriodInSeconds *int `url:"throttle_unauthenticated_packages_api_period_in_seconds,omitempty" json:"throttle_unauthenticated_packages_api_period_in_seconds,omitempty"` - ThrottleUnauthenticatedPackagesAPIRequestsPerPeriod *int `url:"throttle_unauthenticated_packages_api_requests_per_period,omitempty" json:"throttle_unauthenticated_packages_api_requests_per_period,omitempty"` + ThrottleUnauthenticatedPackagesAPIPeriodInSeconds *int64 `url:"throttle_unauthenticated_packages_api_period_in_seconds,omitempty" json:"throttle_unauthenticated_packages_api_period_in_seconds,omitempty"` + ThrottleUnauthenticatedPackagesAPIRequestsPerPeriod *int64 `url:"throttle_unauthenticated_packages_api_requests_per_period,omitempty" json:"throttle_unauthenticated_packages_api_requests_per_period,omitempty"` ThrottleUnauthenticatedWebEnabled *bool `url:"throttle_unauthenticated_web_enabled,omitempty" json:"throttle_unauthenticated_web_enabled,omitempty"` - ThrottleUnauthenticatedWebPeriodInSeconds *int `url:"throttle_unauthenticated_web_period_in_seconds,omitempty" json:"throttle_unauthenticated_web_period_in_seconds,omitempty"` - ThrottleUnauthenticatedWebRequestsPerPeriod *int `url:"throttle_unauthenticated_web_requests_per_period,omitempty" json:"throttle_unauthenticated_web_requests_per_period,omitempty"` + ThrottleUnauthenticatedWebPeriodInSeconds *int64 `url:"throttle_unauthenticated_web_period_in_seconds,omitempty" json:"throttle_unauthenticated_web_period_in_seconds,omitempty"` + ThrottleUnauthenticatedWebRequestsPerPeriod *int64 `url:"throttle_unauthenticated_web_requests_per_period,omitempty" json:"throttle_unauthenticated_web_requests_per_period,omitempty"` TimeTrackingLimitToHours *bool `url:"time_tracking_limit_to_hours,omitempty" json:"time_tracking_limit_to_hours,omitempty"` - TwoFactorGracePeriod *int `url:"two_factor_grace_period,omitempty" json:"two_factor_grace_period,omitempty"` - UnconfirmedUsersDeleteAfterDays *int `url:"unconfirmed_users_delete_after_days,omitempty" json:"unconfirmed_users_delete_after_days,omitempty"` + TwoFactorGracePeriod *int64 `url:"two_factor_grace_period,omitempty" json:"two_factor_grace_period,omitempty"` + UnconfirmedUsersDeleteAfterDays *int64 `url:"unconfirmed_users_delete_after_days,omitempty" json:"unconfirmed_users_delete_after_days,omitempty"` UniqueIPsLimitEnabled *bool `url:"unique_ips_limit_enabled,omitempty" json:"unique_ips_limit_enabled,omitempty"` - UniqueIPsLimitPerUser *int `url:"unique_ips_limit_per_user,omitempty" json:"unique_ips_limit_per_user,omitempty"` - UniqueIPsLimitTimeWindow *int `url:"unique_ips_limit_time_window,omitempty" json:"unique_ips_limit_time_window,omitempty"` + UniqueIPsLimitPerUser *int64 `url:"unique_ips_limit_per_user,omitempty" json:"unique_ips_limit_per_user,omitempty"` + UniqueIPsLimitTimeWindow *int64 `url:"unique_ips_limit_time_window,omitempty" json:"unique_ips_limit_time_window,omitempty"` UpdateRunnerVersionsEnabled *bool `url:"update_runner_versions_enabled,omitempty" json:"update_runner_versions_enabled,omitempty"` UpdatingNameDisabledForUsers *bool `url:"updating_name_disabled_for_users,omitempty" json:"updating_name_disabled_for_users,omitempty"` UsagePingEnabled *bool `url:"usage_ping_enabled,omitempty" json:"usage_ping_enabled,omitempty"` @@ -932,16 +932,16 @@ type UpdateSettingsOptions struct { UserDefaultExternal *bool `url:"user_default_external,omitempty" json:"user_default_external,omitempty"` UserDefaultInternalRegex *string `url:"user_default_internal_regex,omitempty" json:"user_default_internal_regex,omitempty"` UserDefaultsToPrivateProfile *bool `url:"user_defaults_to_private_profile,omitempty" json:"user_defaults_to_private_profile,omitempty"` - UserEmailLookupLimit *int `url:"user_email_lookup_limit,omitempty" json:"user_email_lookup_limit,omitempty"` + UserEmailLookupLimit *int64 `url:"user_email_lookup_limit,omitempty" json:"user_email_lookup_limit,omitempty"` UserOauthApplications *bool `url:"user_oauth_applications,omitempty" json:"user_oauth_applications,omitempty"` UserShowAddSSHKeyMessage *bool `url:"user_show_add_ssh_key_message,omitempty" json:"user_show_add_ssh_key_message,omitempty"` - UsersGetByIDLimit *int `url:"users_get_by_id_limit,omitempty" json:"users_get_by_id_limit,omitempty"` + UsersGetByIDLimit *int64 `url:"users_get_by_id_limit,omitempty" json:"users_get_by_id_limit,omitempty"` UsersGetByIDLimitAllowlistRaw *string `url:"users_get_by_id_limit_allowlist_raw,omitempty" json:"users_get_by_id_limit_allowlist_raw,omitempty"` ValidRunnerRegistrars *[]string `url:"valid_runner_registrars,omitempty" json:"valid_runner_registrars,omitempty"` VersionCheckEnabled *bool `url:"version_check_enabled,omitempty" json:"version_check_enabled,omitempty"` WebIDEClientsidePreviewEnabled *bool `url:"web_ide_clientside_preview_enabled,omitempty" json:"web_ide_clientside_preview_enabled,omitempty"` WhatsNewVariant *string `url:"whats_new_variant,omitempty" json:"whats_new_variant,omitempty"` - WikiPageMaxContentBytes *int `url:"wiki_page_max_content_bytes,omitempty" json:"wiki_page_max_content_bytes,omitempty"` + WikiPageMaxContentBytes *int64 `url:"wiki_page_max_content_bytes,omitempty" json:"wiki_page_max_content_bytes,omitempty"` // Deprecated: Use AbuseNotificationEmail instead. AdminNotificationEmail *string `url:"admin_notification_email,omitempty" json:"admin_notification_email,omitempty"` @@ -950,25 +950,25 @@ type UpdateSettingsOptions struct { // Deprecated: Use AssetProxyAllowlist instead. AssetProxyWhitelist *[]string `url:"asset_proxy_whitelist,omitempty" json:"asset_proxy_whitelist,omitempty"` // Deprecated: Use DefaultBranchProtectionDefaults instead. - DefaultBranchProtection *int `url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"` + DefaultBranchProtection *int64 `url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"` // Deprecated: Cannot be set through the API, always true HousekeepingBitmapsEnabled *bool `url:"housekeeping_bitmaps_enabled,omitempty" json:"housekeeping_bitmaps_enabled,omitempty"` // Deprecated: use HousekeepingOptimizeRepositoryPeriod instead - HousekeepingFullRepackPeriod *int `url:"housekeeping_full_repack_period,omitempty" json:"housekeeping_full_repack_period,omitempty"` + HousekeepingFullRepackPeriod *int64 `url:"housekeeping_full_repack_period,omitempty" json:"housekeeping_full_repack_period,omitempty"` // Deprecated: use HousekeepingOptimizeRepositoryPeriod instead - HousekeepingGcPeriod *int `url:"housekeeping_gc_period,omitempty" json:"housekeeping_gc_period,omitempty"` + HousekeepingGcPeriod *int64 `url:"housekeeping_gc_period,omitempty" json:"housekeeping_gc_period,omitempty"` // Deprecated: use HousekeepingOptimizeRepositoryPeriod instead - HousekeepingIncrementalRepackPeriod *int `url:"housekeeping_incremental_repack_period,omitempty" json:"housekeeping_incremental_repack_period,omitempty"` + HousekeepingIncrementalRepackPeriod *int64 `url:"housekeeping_incremental_repack_period,omitempty" json:"housekeeping_incremental_repack_period,omitempty"` // Deprecated: use PerformanceBarAllowedGroupPath instead - PerformanceBarAllowedGroupID *int `url:"performance_bar_allowed_group_id,omitempty" json:"performance_bar_allowed_group_id,omitempty"` + PerformanceBarAllowedGroupID *int64 `url:"performance_bar_allowed_group_id,omitempty" json:"performance_bar_allowed_group_id,omitempty"` // Deprecated: use PerformanceBarAllowedGroupPath: nil instead PerformanceBarEnabled *bool `url:"performance_bar_enabled,omitempty" json:"performance_bar_enabled,omitempty"` // Deprecated: Use ThrottleUnauthenticatedWebEnabled or ThrottleUnauthenticatedAPIEnabled instead. (Deprecated in GitLab 14.3) ThrottleUnauthenticatedEnabled *bool `url:"throttle_unauthenticated_enabled,omitempty" json:"throttle_unauthenticated_enabled,omitempty"` // Deprecated: Use ThrottleUnauthenticatedWebPeriodInSeconds or ThrottleUnauthenticatedAPIPeriodInSeconds instead. (Deprecated in GitLab 14.3) - ThrottleUnauthenticatedPeriodInSeconds *int `url:"throttle_unauthenticated_period_in_seconds,omitempty" json:"throttle_unauthenticated_period_in_seconds,omitempty"` + ThrottleUnauthenticatedPeriodInSeconds *int64 `url:"throttle_unauthenticated_period_in_seconds,omitempty" json:"throttle_unauthenticated_period_in_seconds,omitempty"` // Deprecated: Use ThrottleUnauthenticatedWebRequestsPerPeriod or ThrottleUnauthenticatedAPIRequestsPerPeriod instead. (Deprecated in GitLab 14.3) - ThrottleUnauthenticatedRequestsPerPeriod *int `url:"throttle_unauthenticated_requests_per_period,omitempty" json:"throttle_unauthenticated_requests_per_period,omitempty"` + ThrottleUnauthenticatedRequestsPerPeriod *int64 `url:"throttle_unauthenticated_requests_per_period,omitempty" json:"throttle_unauthenticated_requests_per_period,omitempty"` } // BranchProtectionDefaultsOptions represents default Git protected branch permissions options. @@ -976,10 +976,10 @@ type UpdateSettingsOptions struct { // GitLab API docs: // https://docs.gitlab.com/api/groups/#options-for-default_branch_protection_defaults type BranchProtectionDefaultsOptions struct { - AllowedToPush *[]int `url:"allowed_to_push,omitempty" json:"allowed_to_push,omitempty"` - AllowForcePush *bool `url:"allow_force_push,omitempty" json:"allow_force_push,omitempty"` - AllowedToMerge *[]int `url:"allowed_to_merge,omitempty" json:"allowed_to_merge,omitempty"` - DeveloperCanInitialPush *bool `url:"developer_can_initial_push,omitempty" json:"developer_can_initial_push,omitempty"` + AllowedToPush *[]int64 `url:"allowed_to_push,omitempty" json:"allowed_to_push,omitempty"` + AllowForcePush *bool `url:"allow_force_push,omitempty" json:"allow_force_push,omitempty"` + AllowedToMerge *[]int64 `url:"allowed_to_merge,omitempty" json:"allowed_to_merge,omitempty"` + DeveloperCanInitialPush *bool `url:"developer_can_initial_push,omitempty" json:"developer_can_initial_push,omitempty"` } // UpdateSettings updates the application settings. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/sidekiq_metrics.go b/vendor/gitlab.com/gitlab-org/api/client-go/sidekiq_metrics.go index 0a985847f..cc7296f17 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/sidekiq_metrics.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/sidekiq_metrics.go @@ -44,10 +44,16 @@ var _ SidekiqServiceInterface = (*SidekiqService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/sidekiq_metrics/#get-the-current-queue-metrics type QueueMetrics struct { - Queues map[string]struct { - Backlog int `json:"backlog"` - Latency int `json:"latency"` - } `json:"queues"` + Queues map[string]QueueMetricsQueue `json:"queues"` +} + +// QueueMetricsQueue represents the GitLab sidekiq queue metrics queue. +// +// GitLab API docs: +// https://docs.gitlab.com/api/sidekiq_metrics/#get-the-current-queue-metrics +type QueueMetricsQueue struct { + Backlog int64 `json:"backlog"` + Latency int64 `json:"latency"` } // GetQueueMetrics lists information about all the registered queues, @@ -75,16 +81,22 @@ func (s *SidekiqService) GetQueueMetrics(options ...RequestOptionFunc) (*QueueMe // GitLab API docs: // https://docs.gitlab.com/api/sidekiq_metrics/#get-the-current-process-metrics type ProcessMetrics struct { - Processes []struct { - Hostname string `json:"hostname"` - Pid int `json:"pid"` - Tag string `json:"tag"` - StartedAt *time.Time `json:"started_at"` - Queues []string `json:"queues"` - Labels []string `json:"labels"` - Concurrency int `json:"concurrency"` - Busy int `json:"busy"` - } `json:"processes"` + Processes []ProcessMetricsProcess `json:"processes"` +} + +// ProcessMetricsProcess represents the GitLab sidekiq process metrics process. +// +// GitLab API docs: +// https://docs.gitlab.com/api/sidekiq_metrics/#get-the-current-process-metrics +type ProcessMetricsProcess struct { + Hostname string `json:"hostname"` + Pid int64 `json:"pid"` + Tag string `json:"tag"` + StartedAt *time.Time `json:"started_at"` + Queues []string `json:"queues"` + Labels []string `json:"labels"` + Concurrency int64 `json:"concurrency"` + Busy int64 `json:"busy"` } // GetProcessMetrics lists information about all the Sidekiq workers registered @@ -112,11 +124,17 @@ func (s *SidekiqService) GetProcessMetrics(options ...RequestOptionFunc) (*Proce // GitLab API docs: // https://docs.gitlab.com/api/sidekiq_metrics/#get-the-current-job-statistics type JobStats struct { - Jobs struct { - Processed int `json:"processed"` - Failed int `json:"failed"` - Enqueued int `json:"enqueued"` - } `json:"jobs"` + Jobs JobStatsJobs `json:"jobs"` +} + +// JobStatsJobs represents the GitLab sidekiq job stats jobs. +// +// GitLab API docs: +// https://docs.gitlab.com/api/sidekiq_metrics/#get-the-current-job-statistics +type JobStatsJobs struct { + Processed int64 `json:"processed"` + Failed int64 `json:"failed"` + Enqueued int64 `json:"enqueued"` } // GetJobStats list information about the jobs that Sidekiq has performed. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/snippet_repository_storage_move.go b/vendor/gitlab.com/gitlab-org/api/client-go/snippet_repository_storage_move.go index b25c3a487..aa2eba690 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/snippet_repository_storage_move.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/snippet_repository_storage_move.go @@ -25,10 +25,10 @@ import ( type ( SnippetRepositoryStorageMoveServiceInterface interface { RetrieveAllStorageMoves(opts RetrieveAllSnippetStorageMovesOptions, options ...RequestOptionFunc) ([]*SnippetRepositoryStorageMove, *Response, error) - RetrieveAllStorageMovesForSnippet(snippet int, opts RetrieveAllSnippetStorageMovesOptions, options ...RequestOptionFunc) ([]*SnippetRepositoryStorageMove, *Response, error) - GetStorageMove(repositoryStorage int, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) - GetStorageMoveForSnippet(snippet int, repositoryStorage int, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) - ScheduleStorageMoveForSnippet(snippet int, opts ScheduleStorageMoveForSnippetOptions, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) + RetrieveAllStorageMovesForSnippet(snippet int64, opts RetrieveAllSnippetStorageMovesOptions, options ...RequestOptionFunc) ([]*SnippetRepositoryStorageMove, *Response, error) + GetStorageMove(repositoryStorage int64, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) + GetStorageMoveForSnippet(snippet int64, repositoryStorage int64, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) + ScheduleStorageMoveForSnippet(snippet int64, opts ScheduleStorageMoveForSnippetOptions, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) ScheduleAllStorageMoves(opts ScheduleAllSnippetStorageMovesOptions, options ...RequestOptionFunc) (*Response, error) } @@ -49,7 +49,7 @@ var _ SnippetRepositoryStorageMoveServiceInterface = (*SnippetRepositoryStorageM // GitLab API docs: // https://docs.gitlab.com/api/snippet_repository_storage_moves/ type SnippetRepositoryStorageMove struct { - ID int `json:"id"` + ID int64 `json:"id"` CreatedAt *time.Time `json:"created_at"` State string `json:"state"` SourceStorageName string `json:"source_storage_name"` @@ -58,13 +58,13 @@ type SnippetRepositoryStorageMove struct { } type RepositorySnippet struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` Description string `json:"description"` Visibility VisibilityValue `json:"visibility"` UpdatedAt *time.Time `json:"updated_at"` CreatedAt *time.Time `json:"created_at"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` WebURL string `json:"web_url"` RawURL string `json:"raw_url"` SSHURLToRepo string `json:"ssh_url_to_repo"` @@ -77,7 +77,9 @@ type RepositorySnippet struct { // GitLab API docs: // https://docs.gitlab.com/api/snippet_repository_storage_moves/#retrieve-all-snippet-repository-storage-moves // https://docs.gitlab.com/api/snippet_repository_storage_moves/#retrieve-all-repository-storage-moves-for-a-snippet -type RetrieveAllSnippetStorageMovesOptions ListOptions +type RetrieveAllSnippetStorageMovesOptions struct { + ListOptions +} // RetrieveAllStorageMoves retrieves all snippet repository storage moves // accessible by the authenticated user. @@ -104,7 +106,7 @@ func (s SnippetRepositoryStorageMoveService) RetrieveAllStorageMoves(opts Retrie // // GitLab API docs: // https://docs.gitlab.com/api/snippet_repository_storage_moves/#retrieve-all-repository-storage-moves-for-a-snippet -func (s SnippetRepositoryStorageMoveService) RetrieveAllStorageMovesForSnippet(snippet int, opts RetrieveAllSnippetStorageMovesOptions, options ...RequestOptionFunc) ([]*SnippetRepositoryStorageMove, *Response, error) { +func (s SnippetRepositoryStorageMoveService) RetrieveAllStorageMovesForSnippet(snippet int64, opts RetrieveAllSnippetStorageMovesOptions, options ...RequestOptionFunc) ([]*SnippetRepositoryStorageMove, *Response, error) { u := fmt.Sprintf("snippets/%d/repository_storage_moves", snippet) req, err := s.client.NewRequest(http.MethodGet, u, opts, options) @@ -125,7 +127,7 @@ func (s SnippetRepositoryStorageMoveService) RetrieveAllStorageMovesForSnippet(s // // GitLab API docs: // https://docs.gitlab.com/api/snippet_repository_storage_moves/#get-a-single-snippet-repository-storage-move -func (s SnippetRepositoryStorageMoveService) GetStorageMove(repositoryStorage int, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) { +func (s SnippetRepositoryStorageMoveService) GetStorageMove(repositoryStorage int64, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) { u := fmt.Sprintf("snippet_repository_storage_moves/%d", repositoryStorage) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -146,7 +148,7 @@ func (s SnippetRepositoryStorageMoveService) GetStorageMove(repositoryStorage in // // GitLab API docs: // https://docs.gitlab.com/api/snippet_repository_storage_moves/#get-a-single-repository-storage-move-for-a-snippet -func (s SnippetRepositoryStorageMoveService) GetStorageMoveForSnippet(snippet int, repositoryStorage int, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) { +func (s SnippetRepositoryStorageMoveService) GetStorageMoveForSnippet(snippet int64, repositoryStorage int64, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) { u := fmt.Sprintf("snippets/%d/repository_storage_moves/%d", snippet, repositoryStorage) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -176,7 +178,7 @@ type ScheduleStorageMoveForSnippetOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/snippet_repository_storage_moves/#schedule-a-repository-storage-move-for-a-snippet -func (s SnippetRepositoryStorageMoveService) ScheduleStorageMoveForSnippet(snippet int, opts ScheduleStorageMoveForSnippetOptions, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) { +func (s SnippetRepositoryStorageMoveService) ScheduleStorageMoveForSnippet(snippet int64, opts ScheduleStorageMoveForSnippetOptions, options ...RequestOptionFunc) (*SnippetRepositoryStorageMove, *Response, error) { u := fmt.Sprintf("snippets/%d/repository_storage_moves", snippet) req, err := s.client.NewRequest(http.MethodPost, u, opts, options) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/snippets.go b/vendor/gitlab.com/gitlab-org/api/client-go/snippets.go index 1c175852f..899fba681 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/snippets.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/snippets.go @@ -26,12 +26,12 @@ import ( type ( SnippetsServiceInterface interface { ListSnippets(opt *ListSnippetsOptions, options ...RequestOptionFunc) ([]*Snippet, *Response, error) - GetSnippet(snippet int, options ...RequestOptionFunc) (*Snippet, *Response, error) - SnippetContent(snippet int, options ...RequestOptionFunc) ([]byte, *Response, error) - SnippetFileContent(snippet int, ref, filename string, options ...RequestOptionFunc) ([]byte, *Response, error) + GetSnippet(snippet int64, options ...RequestOptionFunc) (*Snippet, *Response, error) + SnippetContent(snippet int64, options ...RequestOptionFunc) ([]byte, *Response, error) + SnippetFileContent(snippet int64, ref, filename string, options ...RequestOptionFunc) ([]byte, *Response, error) CreateSnippet(opt *CreateSnippetOptions, options ...RequestOptionFunc) (*Snippet, *Response, error) - UpdateSnippet(snippet int, opt *UpdateSnippetOptions, options ...RequestOptionFunc) (*Snippet, *Response, error) - DeleteSnippet(snippet int, options ...RequestOptionFunc) (*Response, error) + UpdateSnippet(snippet int64, opt *UpdateSnippetOptions, options ...RequestOptionFunc) (*Snippet, *Response, error) + DeleteSnippet(snippet int64, options ...RequestOptionFunc) (*Response, error) ExploreSnippets(opt *ExploreSnippetsOptions, options ...RequestOptionFunc) ([]*Snippet, *Response, error) ListAllSnippets(opt *ListAllSnippetsOptions, options ...RequestOptionFunc) ([]*Snippet, *Response, error) } @@ -51,40 +51,60 @@ var _ SnippetsServiceInterface = (*SnippetsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/snippets/ type Snippet struct { - ID int `json:"id"` - Title string `json:"title"` - FileName string `json:"file_name"` - Description string `json:"description"` - Visibility string `json:"visibility"` - Author struct { - ID int `json:"id"` - Username string `json:"username"` - Email string `json:"email"` - Name string `json:"name"` - State string `json:"state"` - CreatedAt *time.Time `json:"created_at"` - } `json:"author"` - UpdatedAt *time.Time `json:"updated_at"` - CreatedAt *time.Time `json:"created_at"` - ProjectID int `json:"project_id"` - WebURL string `json:"web_url"` - RawURL string `json:"raw_url"` - Files []struct { - Path string `json:"path"` - RawURL string `json:"raw_url"` - } `json:"files"` - RepositoryStorage string `json:"repository_storage"` + ID int64 `json:"id"` + Title string `json:"title"` + FileName string `json:"file_name"` + Description string `json:"description"` + Visibility string `json:"visibility"` + Author SnippetAuthor `json:"author"` + UpdatedAt *time.Time `json:"updated_at"` + CreatedAt *time.Time `json:"created_at"` + ProjectID int64 `json:"project_id"` + WebURL string `json:"web_url"` + RawURL string `json:"raw_url"` + Files []SnippetFile `json:"files"` + RepositoryStorage string `json:"repository_storage"` } func (s Snippet) String() string { return Stringify(s) } +// SnippetAuthor represents a GitLab snippet author. +// +// GitLab API docs: https://docs.gitlab.com/api/snippets/ +type SnippetAuthor struct { + ID int64 `json:"id"` + Username string `json:"username"` + Email string `json:"email"` + Name string `json:"name"` + State string `json:"state"` + CreatedAt *time.Time `json:"created_at"` +} + +func (a SnippetAuthor) String() string { + return Stringify(a) +} + +// SnippetFile represents a GitLab snippet file. +// +// GitLab API docs: https://docs.gitlab.com/api/snippets/ +type SnippetFile struct { + Path string `json:"path"` + RawURL string `json:"raw_url"` +} + +func (f SnippetFile) String() string { + return Stringify(f) +} + // ListSnippetsOptions represents the available ListSnippets() options. // // GitLab API docs: // https://docs.gitlab.com/api/snippets/#list-all-snippets-for-current-user -type ListSnippetsOptions ListOptions +type ListSnippetsOptions struct { + ListOptions +} // ListSnippets gets a list of snippets. // @@ -107,7 +127,7 @@ func (s *SnippetsService) ListSnippets(opt *ListSnippetsOptions, options ...Requ // // GitLab API docs: // https://docs.gitlab.com/api/snippets/#get-a-single-snippet -func (s *SnippetsService) GetSnippet(snippet int, options ...RequestOptionFunc) (*Snippet, *Response, error) { +func (s *SnippetsService) GetSnippet(snippet int64, options ...RequestOptionFunc) (*Snippet, *Response, error) { res, resp, err := do[*Snippet](s.client, withMethod(http.MethodGet), withPath("snippets/%d", snippet), @@ -124,7 +144,7 @@ func (s *SnippetsService) GetSnippet(snippet int, options ...RequestOptionFunc) // // GitLab API docs: // https://docs.gitlab.com/api/snippets/#single-snippet-contents -func (s *SnippetsService) SnippetContent(snippet int, options ...RequestOptionFunc) ([]byte, *Response, error) { +func (s *SnippetsService) SnippetContent(snippet int64, options ...RequestOptionFunc) ([]byte, *Response, error) { u := fmt.Sprintf("snippets/%d/raw", snippet) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -145,7 +165,7 @@ func (s *SnippetsService) SnippetContent(snippet int, options ...RequestOptionFu // // GitLab API docs: // https://docs.gitlab.com/api/snippets/#snippet-repository-file-content -func (s *SnippetsService) SnippetFileContent(snippet int, ref, filename string, options ...RequestOptionFunc) ([]byte, *Response, error) { +func (s *SnippetsService) SnippetFileContent(snippet int64, ref, filename string, options ...RequestOptionFunc) ([]byte, *Response, error) { filepath := PathEscape(filename) u := fmt.Sprintf("snippets/%d/files/%s/%s/raw", snippet, ref, filepath) @@ -232,7 +252,7 @@ type UpdateSnippetOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/snippets/#update-snippet -func (s *SnippetsService) UpdateSnippet(snippet int, opt *UpdateSnippetOptions, options ...RequestOptionFunc) (*Snippet, *Response, error) { +func (s *SnippetsService) UpdateSnippet(snippet int64, opt *UpdateSnippetOptions, options ...RequestOptionFunc) (*Snippet, *Response, error) { res, resp, err := do[*Snippet](s.client, withMethod(http.MethodPut), withPath("snippets/%d", snippet), @@ -251,7 +271,7 @@ func (s *SnippetsService) UpdateSnippet(snippet int, opt *UpdateSnippetOptions, // // GitLab API docs: // https://docs.gitlab.com/api/snippets/#delete-snippet -func (s *SnippetsService) DeleteSnippet(snippet int, options ...RequestOptionFunc) (*Response, error) { +func (s *SnippetsService) DeleteSnippet(snippet int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("snippets/%d", snippet), @@ -265,7 +285,9 @@ func (s *SnippetsService) DeleteSnippet(snippet int, options ...RequestOptionFun // // GitLab API docs: // https://docs.gitlab.com/api/snippets/#list-all-public-snippets -type ExploreSnippetsOptions ListOptions +type ExploreSnippetsOptions struct { + ListOptions +} // ExploreSnippets gets the list of public snippets. // diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/system_hooks.go b/vendor/gitlab.com/gitlab-org/api/client-go/system_hooks.go index 3f778ec0f..a74914f9c 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/system_hooks.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/system_hooks.go @@ -25,10 +25,10 @@ import ( type ( SystemHooksServiceInterface interface { ListHooks(options ...RequestOptionFunc) ([]*Hook, *Response, error) - GetHook(hook int, options ...RequestOptionFunc) (*Hook, *Response, error) + GetHook(hook int64, options ...RequestOptionFunc) (*Hook, *Response, error) AddHook(opt *AddHookOptions, options ...RequestOptionFunc) (*Hook, *Response, error) - TestHook(hook int, options ...RequestOptionFunc) (*HookEvent, *Response, error) - DeleteHook(hook int, options ...RequestOptionFunc) (*Response, error) + TestHook(hook int64, options ...RequestOptionFunc) (*HookEvent, *Response, error) + DeleteHook(hook int64, options ...RequestOptionFunc) (*Response, error) } // SystemHooksService handles communication with the system hooks related @@ -46,7 +46,7 @@ var _ SystemHooksServiceInterface = (*SystemHooksService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/system_hooks/ type Hook struct { - ID int `json:"id"` + ID int64 `json:"id"` URL string `json:"url"` CreatedAt *time.Time `json:"created_at"` PushEvents bool `json:"push_events"` @@ -83,7 +83,7 @@ func (s *SystemHooksService) ListHooks(options ...RequestOptionFunc) ([]*Hook, * // // GitLab API docs: // https://docs.gitlab.com/api/system_hooks/#get-system-hook -func (s *SystemHooksService) GetHook(hook int, options ...RequestOptionFunc) (*Hook, *Response, error) { +func (s *SystemHooksService) GetHook(hook int64, options ...RequestOptionFunc) (*Hook, *Response, error) { u := fmt.Sprintf("hooks/%d", hook) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -140,7 +140,7 @@ type HookEvent struct { EventName string `json:"event_name"` Name string `json:"name"` Path string `json:"path"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` OwnerName string `json:"owner_name"` OwnerEmail string `json:"owner_email"` } @@ -153,7 +153,7 @@ func (h HookEvent) String() string { // // GitLab API docs: // https://docs.gitlab.com/api/system_hooks/#test-system-hook -func (s *SystemHooksService) TestHook(hook int, options ...RequestOptionFunc) (*HookEvent, *Response, error) { +func (s *SystemHooksService) TestHook(hook int64, options ...RequestOptionFunc) (*HookEvent, *Response, error) { u := fmt.Sprintf("hooks/%d", hook) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -176,7 +176,7 @@ func (s *SystemHooksService) TestHook(hook int, options ...RequestOptionFunc) (* // // GitLab API docs: // https://docs.gitlab.com/api/system_hooks/#delete-system-hook -func (s *SystemHooksService) DeleteHook(hook int, options ...RequestOptionFunc) (*Response, error) { +func (s *SystemHooksService) DeleteHook(hook int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("hooks/%d", hook) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/tags.go b/vendor/gitlab.com/gitlab-org/api/client-go/tags.go index aec5f3d6b..5df51a3e5 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/tags.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/tags.go @@ -67,7 +67,7 @@ type X509Signature struct { } type X509Certificate struct { - ID int `json:"id"` + ID int64 `json:"id"` Subject string `json:"subject"` SubjectKeyIdentifier string `json:"subject_key_identifier"` Email string `json:"email"` @@ -77,10 +77,10 @@ type X509Certificate struct { } type X509Issuer struct { - ID int `json:"id"` + ID int64 `json:"id"` Subject string `json:"subject"` SubjectKeyIdentifier string `json:"subject_key_identifier"` - CrlUrl string `json:"crl_url"` + CrlURL string `json:"crl_url"` } // ReleaseNote represents a GitLab version release. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/time_stats.go b/vendor/gitlab.com/gitlab-org/api/client-go/time_stats.go index 580acf1a6..9b0c9846f 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/time_stats.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/time_stats.go @@ -35,8 +35,8 @@ type timeStatsService struct { type TimeStats struct { HumanTimeEstimate string `json:"human_time_estimate"` HumanTotalTimeSpent string `json:"human_total_time_spent"` - TimeEstimate int `json:"time_estimate"` - TotalTimeSpent int `json:"total_time_spent"` + TimeEstimate int64 `json:"time_estimate"` + TotalTimeSpent int64 `json:"total_time_spent"` } func (t TimeStats) String() string { @@ -54,7 +54,7 @@ type SetTimeEstimateOptions struct { // setTimeEstimate sets the time estimate for a single project issue. // // GitLab docs: https://docs.gitlab.com/api/issues/#set-a-time-estimate-for-an-issue -func (s *timeStatsService) setTimeEstimate(pid any, entity string, issue int, opt *SetTimeEstimateOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *timeStatsService) setTimeEstimate(pid any, entity string, issue int64, opt *SetTimeEstimateOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -78,7 +78,7 @@ func (s *timeStatsService) setTimeEstimate(pid any, entity string, issue int, op // resetTimeEstimate resets the time estimate for a single project issue. // // GitLab docs: https://docs.gitlab.com/api/issues/#reset-the-time-estimate-for-an-issue -func (s *timeStatsService) resetTimeEstimate(pid any, entity string, issue int, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *timeStatsService) resetTimeEstimate(pid any, entity string, issue int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -110,7 +110,7 @@ type AddSpentTimeOptions struct { // addSpentTime adds spent time for a single project issue. // // GitLab docs: https://docs.gitlab.com/api/issues/#add-spent-time-for-an-issue -func (s *timeStatsService) addSpentTime(pid any, entity string, issue int, opt *AddSpentTimeOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *timeStatsService) addSpentTime(pid any, entity string, issue int64, opt *AddSpentTimeOptions, options ...RequestOptionFunc) (*TimeStats, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -134,7 +134,7 @@ func (s *timeStatsService) addSpentTime(pid any, entity string, issue int, opt * // resetSpentTime resets the spent time for a single project issue. // // GitLab docs: https://docs.gitlab.com/api/issues/#reset-spent-time-for-an-issue -func (s *timeStatsService) resetSpentTime(pid any, entity string, issue int, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *timeStatsService) resetSpentTime(pid any, entity string, issue int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -158,7 +158,7 @@ func (s *timeStatsService) resetSpentTime(pid any, entity string, issue int, opt // getTimeSpent gets the spent time for a single project issue. // // GitLab docs: https://docs.gitlab.com/api/issues/#get-time-tracking-stats -func (s *timeStatsService) getTimeSpent(pid any, entity string, issue int, options ...RequestOptionFunc) (*TimeStats, *Response, error) { +func (s *timeStatsService) getTimeSpent(pid any, entity string, issue int64, options ...RequestOptionFunc) (*TimeStats, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/todos.go b/vendor/gitlab.com/gitlab-org/api/client-go/todos.go index 643a456fe..e0949e699 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/todos.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/todos.go @@ -24,8 +24,19 @@ import ( type ( TodosServiceInterface interface { + // ListTodos lists all todos created by authenticated user. + // When no filter is applied, it returns all pending todos for the current user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/todos/#get-a-list-of-to-do-items ListTodos(opt *ListTodosOptions, options ...RequestOptionFunc) ([]*Todo, *Response, error) - MarkTodoAsDone(id int, options ...RequestOptionFunc) (*Response, error) + // MarkTodoAsDone marks a single pending todo given by its ID for the current user as done. + // + // GitLab API docs: https://docs.gitlab.com/api/todos/#mark-a-to-do-item-as-done + MarkTodoAsDone(id int64, options ...RequestOptionFunc) (*Response, error) + // MarkAllTodosAsDone marks all pending todos for the current user as done. + // + // GitLab API docs: https://docs.gitlab.com/api/todos/#mark-all-to-do-items-as-done MarkAllTodosAsDone(options ...RequestOptionFunc) (*Response, error) } @@ -44,7 +55,7 @@ var _ TodosServiceInterface = (*TodosService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/todos/ type Todo struct { - ID int `json:"id"` + ID int64 `json:"id"` Project *BasicProject `json:"project"` Author *BasicUser `json:"author"` ActionName TodoAction `json:"action_name"` @@ -67,19 +78,19 @@ type TodoTarget struct { Author *BasicUser `json:"author"` CreatedAt *time.Time `json:"created_at"` Description string `json:"description"` - Downvotes int `json:"downvotes"` + Downvotes int64 `json:"downvotes"` ID any `json:"id"` - IID int `json:"iid"` + IID int64 `json:"iid"` Labels []string `json:"labels"` Milestone *Milestone `json:"milestone"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` State string `json:"state"` Subscribed bool `json:"subscribed"` TaskCompletionStatus *TasksCompletionStatus `json:"task_completion_status"` Title string `json:"title"` UpdatedAt *time.Time `json:"updated_at"` - Upvotes int `json:"upvotes"` - UserNotesCount int `json:"user_notes_count"` + Upvotes int64 `json:"upvotes"` + UserNotesCount int64 `json:"user_notes_count"` WebURL string `json:"web_url"` // Only available for type Issue @@ -87,13 +98,13 @@ type TodoTarget struct { DueDate string `json:"due_date"` HasTasks bool `json:"has_tasks"` Links *IssueLinks `json:"_links"` - MovedToID int `json:"moved_to_id"` + MovedToID int64 `json:"moved_to_id"` TimeStats *TimeStats `json:"time_stats"` - Weight int `json:"weight"` + Weight int64 `json:"weight"` // Only available for type MergeRequest MergedAt *time.Time `json:"merged_at"` - ApprovalsBeforeMerge int `json:"approvals_before_merge"` + ApprovalsBeforeMerge int64 `json:"approvals_before_merge"` ForceRemoveSourceBranch bool `json:"force_remove_source_branch"` MergeCommitSHA string `json:"merge_commit_sha"` MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"` @@ -103,10 +114,10 @@ type TodoTarget struct { SHA string `json:"sha"` ShouldRemoveSourceBranch bool `json:"should_remove_source_branch"` SourceBranch string `json:"source_branch"` - SourceProjectID int `json:"source_project_id"` + SourceProjectID int64 `json:"source_project_id"` Squash bool `json:"squash"` TargetBranch string `json:"target_branch"` - TargetProjectID int `json:"target_project_id"` + TargetProjectID int64 `json:"target_project_id"` WorkInProgress bool `json:"work_in_progress"` // Only available for type DesignManagement::Design @@ -120,18 +131,13 @@ type TodoTarget struct { type ListTodosOptions struct { ListOptions Action *TodoAction `url:"action,omitempty" json:"action,omitempty"` - AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` - ProjectID *int `url:"project_id,omitempty" json:"project_id,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` + AuthorID *int64 `url:"author_id,omitempty" json:"author_id,omitempty"` + ProjectID *int64 `url:"project_id,omitempty" json:"project_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` State *string `url:"state,omitempty" json:"state,omitempty"` Type *string `url:"type,omitempty" json:"type,omitempty"` } -// ListTodos lists all todos created by authenticated user. -// When no filter is applied, it returns all pending todos for the current user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/todos/#get-a-list-of-to-do-items func (s *TodosService) ListTodos(opt *ListTodosOptions, options ...RequestOptionFunc) ([]*Todo, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "todos", opt, options) if err != nil { @@ -147,10 +153,7 @@ func (s *TodosService) ListTodos(opt *ListTodosOptions, options ...RequestOption return t, resp, nil } -// MarkTodoAsDone marks a single pending todo given by its ID for the current user as done. -// -// GitLab API docs: https://docs.gitlab.com/api/todos/#mark-a-to-do-item-as-done -func (s *TodosService) MarkTodoAsDone(id int, options ...RequestOptionFunc) (*Response, error) { +func (s *TodosService) MarkTodoAsDone(id int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("todos/%d/mark_as_done", id) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -161,9 +164,6 @@ func (s *TodosService) MarkTodoAsDone(id int, options ...RequestOptionFunc) (*Re return s.client.Do(req, nil) } -// MarkAllTodosAsDone marks all pending todos for the current user as done. -// -// GitLab API docs: https://docs.gitlab.com/api/todos/#mark-all-to-do-items-as-done func (s *TodosService) MarkAllTodosAsDone(options ...RequestOptionFunc) (*Response, error) { req, err := s.client.NewRequest(http.MethodPost, "todos/mark_as_done", nil, options) if err != nil { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/topics.go b/vendor/gitlab.com/gitlab-org/api/client-go/topics.go index 2c7ebad8b..e10555ef6 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/topics.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/topics.go @@ -27,11 +27,33 @@ import ( type ( TopicsServiceInterface interface { + // ListTopics returns a list of project topics in the GitLab instance ordered + // by number of associated projects. + // + // GitLab API docs: https://docs.gitlab.com/api/topics/#list-topics ListTopics(opt *ListTopicsOptions, options ...RequestOptionFunc) ([]*Topic, *Response, error) - GetTopic(topic int, options ...RequestOptionFunc) (*Topic, *Response, error) + // GetTopic gets a project topic by ID. + // + // GitLab API docs: https://docs.gitlab.com/api/topics/#get-a-topic + GetTopic(topic int64, options ...RequestOptionFunc) (*Topic, *Response, error) + // CreateTopic creates a new project topic. + // + // GitLab API docs: + // https://docs.gitlab.com/api/topics/#create-a-project-topic CreateTopic(opt *CreateTopicOptions, options ...RequestOptionFunc) (*Topic, *Response, error) - UpdateTopic(topic int, opt *UpdateTopicOptions, options ...RequestOptionFunc) (*Topic, *Response, error) - DeleteTopic(topic int, options ...RequestOptionFunc) (*Response, error) + // UpdateTopic updates a project topic. Only available to administrators. + // + // To remove a topic avatar set the TopicAvatar.Filename to an empty string + // and set TopicAvatar.Image to nil. + // + // GitLab API docs: + // https://docs.gitlab.com/api/topics/#update-a-project-topic + UpdateTopic(topic int64, opt *UpdateTopicOptions, options ...RequestOptionFunc) (*Topic, *Response, error) + // DeleteTopic deletes a project topic. Only available to administrators. + // + // GitLab API docs: + // https://docs.gitlab.com/api/topics/#delete-a-project-topic + DeleteTopic(topic int64, options ...RequestOptionFunc) (*Response, error) } // TopicsService handles communication with the topics related methods @@ -49,7 +71,7 @@ var _ TopicsServiceInterface = (*TopicsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/topics/ type Topic struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Title string `json:"title"` Description string `json:"description"` @@ -69,10 +91,6 @@ type ListTopicsOptions struct { Search *string `url:"search,omitempty" json:"search,omitempty"` } -// ListTopics returns a list of project topics in the GitLab instance ordered -// by number of associated projects. -// -// GitLab API docs: https://docs.gitlab.com/api/topics/#list-topics func (s *TopicsService) ListTopics(opt *ListTopicsOptions, options ...RequestOptionFunc) ([]*Topic, *Response, error) { res, resp, err := do[[]*Topic](s.client, withMethod(http.MethodGet), @@ -86,10 +104,7 @@ func (s *TopicsService) ListTopics(opt *ListTopicsOptions, options ...RequestOpt return res, resp, nil } -// GetTopic gets a project topic by ID. -// -// GitLab API docs: https://docs.gitlab.com/api/topics/#get-a-topic -func (s *TopicsService) GetTopic(topic int, options ...RequestOptionFunc) (*Topic, *Response, error) { +func (s *TopicsService) GetTopic(topic int64, options ...RequestOptionFunc) (*Topic, *Response, error) { res, resp, err := do[*Topic](s.client, withMethod(http.MethodGet), withPath("topics/%d", topic), @@ -128,10 +143,6 @@ func (a *TopicAvatar) MarshalJSON() ([]byte, error) { return json.Marshal((*alias)(a)) } -// CreateTopic creates a new project topic. -// -// GitLab API docs: -// https://docs.gitlab.com/api/topics/#create-a-project-topic func (s *TopicsService) CreateTopic(opt *CreateTopicOptions, options ...RequestOptionFunc) (*Topic, *Response, error) { var err error var req *retryablehttp.Request @@ -173,14 +184,7 @@ type UpdateTopicOptions struct { Avatar *TopicAvatar `url:"-" json:"avatar,omitempty"` } -// UpdateTopic updates a project topic. Only available to administrators. -// -// To remove a topic avatar set the TopicAvatar.Filename to an empty string -// and set TopicAvatar.Image to nil. -// -// GitLab API docs: -// https://docs.gitlab.com/api/topics/#update-a-project-topic -func (s *TopicsService) UpdateTopic(topic int, opt *UpdateTopicOptions, options ...RequestOptionFunc) (*Topic, *Response, error) { +func (s *TopicsService) UpdateTopic(topic int64, opt *UpdateTopicOptions, options ...RequestOptionFunc) (*Topic, *Response, error) { var err error var req *retryablehttp.Request @@ -210,11 +214,7 @@ func (s *TopicsService) UpdateTopic(topic int, opt *UpdateTopicOptions, options return t, resp, nil } -// DeleteTopic deletes a project topic. Only available to administrators. -// -// GitLab API docs: -// https://docs.gitlab.com/api/topics/#delete-a-project-topic -func (s *TopicsService) DeleteTopic(topic int, options ...RequestOptionFunc) (*Response, error) { +func (s *TopicsService) DeleteTopic(topic int64, options ...RequestOptionFunc) (*Response, error) { _, resp, err := do[none](s.client, withMethod(http.MethodDelete), withPath("topics/%d", topic), diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/types.go b/vendor/gitlab.com/gitlab-org/api/client-go/types.go index ebfb67d1c..453261826 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/types.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/types.go @@ -103,7 +103,7 @@ type ApproverIDsValue struct { // ApproverIDs is a helper routine that creates a new ApproverIDsValue. func ApproverIDs(v any) *ApproverIDsValue { switch v.(type) { - case UserIDValue, []int: + case UserIDValue, []int64: return &ApproverIDsValue{value: v} default: panic("Unsupported value passed as approver ID") @@ -115,11 +115,11 @@ func (a *ApproverIDsValue) EncodeValues(key string, v *url.Values) error { switch value := a.value.(type) { case UserIDValue: v.Set(key, string(value)) - case []int: + case []int64: v.Del(key) v.Del(key + "[]") for _, id := range value { - v.Add(key+"[]", strconv.Itoa(id)) + v.Add(key+"[]", strconv.FormatInt(id, 10)) } } return nil @@ -143,7 +143,7 @@ type AssigneeIDValue struct { // AssigneeID is a helper routine that creates a new AssigneeIDValue. func AssigneeID(v any) *AssigneeIDValue { switch v.(type) { - case UserIDValue, int: + case UserIDValue, int, int64: return &AssigneeIDValue{value: v} default: panic("Unsupported value passed as assignee ID") @@ -157,6 +157,8 @@ func (a *AssigneeIDValue) EncodeValues(key string, v *url.Values) error { v.Set(key, string(value)) case int: v.Set(key, strconv.Itoa(value)) + case int64: + v.Set(key, strconv.FormatInt(value, 10)) } return nil } @@ -179,7 +181,7 @@ type ReviewerIDValue struct { // ReviewerID is a helper routine that creates a new ReviewerIDValue. func ReviewerID(v any) *ReviewerIDValue { switch v.(type) { - case UserIDValue, int: + case UserIDValue, int, int64: return &ReviewerIDValue{value: v} default: panic("Unsupported value passed as reviewer ID") @@ -193,6 +195,8 @@ func (a *ReviewerIDValue) EncodeValues(key string, v *url.Values) error { v.Set(key, string(value)) case int: v.Set(key, strconv.Itoa(value)) + case int64: + v.Set(key, strconv.FormatInt(value, 10)) } return nil } @@ -477,10 +481,18 @@ func (t *ISOTime) UnmarshalJSON(data []byte) error { return nil } - isotime, err := time.Parse(`"`+iso8601+`"`, string(data)) - *t = ISOTime(isotime) + // Try parsing as datetime first (ISO 8601 with time) + isotime, err := time.Parse(`"`+time.RFC3339+`"`, string(data)) + if err != nil { + // If that fails, try parsing as date-only + isotime, err = time.Parse(`"`+iso8601+`"`, string(data)) + if err != nil { + return err + } + } - return err + *t = ISOTime(isotime) + return nil } // EncodeValues implements the query.Encoder interface. @@ -775,8 +787,8 @@ const ( // TasksCompletionStatus represents tasks of the issue/merge request. type TasksCompletionStatus struct { - Count int `json:"count"` - CompletedCount int `json:"completed_count"` + Count int64 `json:"count"` + CompletedCount int64 `json:"completed_count"` } // TodoAction represents the available actions that can be performed on a todo. diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/usage_data.go b/vendor/gitlab.com/gitlab-org/api/client-go/usage_data.go index 788522a64..2bf73d920 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/usage_data.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/usage_data.go @@ -9,11 +9,35 @@ import ( type ( UsageDataServiceInterface interface { + // GetServicePing gets the current service ping data. + // + // GitLab API docs: + // https://docs.gitlab.com/api/usage_data/#export-service-ping-data GetServicePing(options ...RequestOptionFunc) (*ServicePingData, *Response, error) + // GetMetricDefinitionsAsYAML gets all metric definitions as a single YAML file. + // + // GitLab API docs: + // https://docs.gitlab.com/api/usage_data/#export-metric-definitions-as-a-single-yaml-file GetMetricDefinitionsAsYAML(options ...RequestOptionFunc) (io.Reader, *Response, error) + // GetQueries gets all raw SQL queries used to compute service ping. + // + // GitLab API docs: + // https://docs.gitlab.com/api/usage_data/#export-service-ping-sql-queries GetQueries(options ...RequestOptionFunc) (*ServicePingQueries, *Response, error) - GetNonSQLMetrics(options ...RequestOptionFunc) (*ServicePingNonSqlMetrics, *Response, error) + // GetNonSQLMetrics gets all non-SQL metrics data used in the service ping. + // + // GitLab API docs: + // https://docs.gitlab.com/api/usage_data/#usagedatanonsqlmetrics-api + GetNonSQLMetrics(options ...RequestOptionFunc) (*ServicePingNonSQLMetrics, *Response, error) + // TrackEvent tracks an internal GitLab event. + // + // GitLab API docs: + // https://docs.gitlab.com/api/usage_data/#events-tracking-api TrackEvent(opt *TrackEventOptions, options ...RequestOptionFunc) (*Response, error) + // TrackEvents tracks multiple internal GitLab events. + // + // GitLab API docs: + // https://docs.gitlab.com/api/usage_data/#events-tracking-api TrackEvents(opt *TrackEventsOptions, options ...RequestOptionFunc) (*Response, error) } @@ -30,13 +54,9 @@ type ( type ServicePingData struct { RecordedAt *time.Time `json:"recorded_at"` License map[string]string `json:"license"` - Counts map[string]int `json:"counts"` + Counts map[string]int64 `json:"counts"` } -// GetServicePing gets the current service ping data. -// -// GitLab API docs: -// https://docs.gitlab.com/api/usage_data/#export-service-ping-data func (s *UsageDataService) GetServicePing(options ...RequestOptionFunc) (*ServicePingData, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "usage_data/service_ping", nil, options) if err != nil { @@ -52,10 +72,6 @@ func (s *UsageDataService) GetServicePing(options ...RequestOptionFunc) (*Servic return sp, resp, nil } -// GetMetricDefinitionsAsYAML gets all metric definitions as a single YAML file. -// -// GitLab API docs: -// https://docs.gitlab.com/api/usage_data/#export-metric-definitions-as-a-single-yaml-file func (s *UsageDataService) GetMetricDefinitionsAsYAML(options ...RequestOptionFunc) (io.Reader, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "usage_data/metric_definitions", nil, options) if err != nil { @@ -85,13 +101,13 @@ type ServicePingQueries struct { LicenseMD5 string `json:"license_md5"` LicenseSHA256 string `json:"license_sha256"` LicenseID string `json:"license_id"` - HistoricalMaxUsers int `json:"historical_max_users"` + HistoricalMaxUsers int64 `json:"historical_max_users"` Licensee map[string]string `json:"licensee"` - LicenseUserCount int `json:"license_user_count"` + LicenseUserCount int64 `json:"license_user_count"` LicenseStartsAt string `json:"license_starts_at"` LicenseExpiresAt string `json:"license_expires_at"` LicensePlan string `json:"license_plan"` - LicenseAddOns map[string]int `json:"license_add_ons"` + LicenseAddOns map[string]int64 `json:"license_add_ons"` LicenseTrial string `json:"license_trial"` LicenseSubscriptionID string `json:"license_subscription_id"` License map[string]string `json:"license"` @@ -99,10 +115,6 @@ type ServicePingQueries struct { Counts map[string]string `json:"counts"` } -// GetQueries gets all raw SQL queries used to compute service ping. -// -// GitLab API docs: -// https://docs.gitlab.com/api/usage_data/#export-service-ping-sql-queries func (s *UsageDataService) GetQueries(options ...RequestOptionFunc) (*ServicePingQueries, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "usage_data/queries", nil, options) if err != nil { @@ -118,42 +130,38 @@ func (s *UsageDataService) GetQueries(options ...RequestOptionFunc) (*ServicePin return sq, resp, nil } -// ServicePingNonSqlMetrics represents the non-SQL metrics used in service ping. -type ServicePingNonSqlMetrics struct { +// ServicePingNonSQLMetrics represents the non-SQL metrics used in service ping. +type ServicePingNonSQLMetrics struct { RecordedAt string `json:"recorded_at"` UUID string `json:"uuid"` Hostname string `json:"hostname"` Version string `json:"version"` InstallationType string `json:"installation_type"` - ActiveUserCount int `json:"active_user_count"` + ActiveUserCount int64 `json:"active_user_count"` Edition string `json:"edition"` LicenseMD5 string `json:"license_md5"` LicenseSHA256 string `json:"license_sha256"` LicenseID string `json:"license_id"` - HistoricalMaxUsers int `json:"historical_max_users"` + HistoricalMaxUsers int64 `json:"historical_max_users"` Licensee map[string]string `json:"licensee"` - LicenseUserCount int `json:"license_user_count"` + LicenseUserCount int64 `json:"license_user_count"` LicenseStartsAt string `json:"license_starts_at"` LicenseExpiresAt string `json:"license_expires_at"` LicensePlan string `json:"license_plan"` - LicenseAddOns map[string]int `json:"license_add_ons"` + LicenseAddOns map[string]int64 `json:"license_add_ons"` LicenseTrial string `json:"license_trial"` LicenseSubscriptionID string `json:"license_subscription_id"` License map[string]string `json:"license"` Settings map[string]string `json:"settings"` } -// GetNonSQLMetrics gets all non-SQL metrics data used in the service ping. -// -// GitLab API docs: -// https://docs.gitlab.com/api/usage_data/#usagedatanonsqlmetrics-api -func (s *UsageDataService) GetNonSQLMetrics(options ...RequestOptionFunc) (*ServicePingNonSqlMetrics, *Response, error) { +func (s *UsageDataService) GetNonSQLMetrics(options ...RequestOptionFunc) (*ServicePingNonSQLMetrics, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "usage_data/non_sql_metrics", nil, options) if err != nil { return nil, nil, err } - nsm := new(ServicePingNonSqlMetrics) + nsm := new(ServicePingNonSQLMetrics) resp, err := s.client.Do(req, nsm) if err != nil { return nil, resp, err @@ -166,15 +174,11 @@ func (s *UsageDataService) GetNonSQLMetrics(options ...RequestOptionFunc) (*Serv type TrackEventOptions struct { Event string `json:"event" url:"event"` SendToSnowplow *bool `json:"send_to_snowplow,omitempty" url:"send_to_snowplow,omitempty"` - NamespaceID *int `json:"namespace_id,omitempty" url:"namespace_id,omitempty"` - ProjectID *int `json:"project_id,omitempty" url:"project_id,omitempty"` + NamespaceID *int64 `json:"namespace_id,omitempty" url:"namespace_id,omitempty"` + ProjectID *int64 `json:"project_id,omitempty" url:"project_id,omitempty"` AdditionalProperties map[string]string `json:"additional_properties,omitempty" url:"additional_properties,omitempty"` } -// TrackEvent tracks an internal GitLab event. -// -// GitLab API docs: -// https://docs.gitlab.com/api/usage_data/#events-tracking-api func (s *UsageDataService) TrackEvent(opt *TrackEventOptions, options ...RequestOptionFunc) (*Response, error) { req, err := s.client.NewRequest(http.MethodPost, "usage_data/track_event", opt, options) if err != nil { @@ -189,10 +193,6 @@ type TrackEventsOptions struct { Events []TrackEventOptions `json:"events" url:"events"` } -// TrackEvents tracks multiple internal GitLab events. -// -// GitLab API docs: -// https://docs.gitlab.com/api/usage_data/#events-tracking-api func (s *UsageDataService) TrackEvents(opt *TrackEventsOptions, options ...RequestOptionFunc) (*Response, error) { req, err := s.client.NewRequest(http.MethodPost, "usage_data/track_events", opt, options) if err != nil { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/users.go b/vendor/gitlab.com/gitlab-org/api/client-go/users.go index bdbdd9899..f20992b4b 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/users.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/users.go @@ -31,61 +31,275 @@ import ( type ( UsersServiceInterface interface { + // ListUsers gets a list of users. + // + // GitLab API docs: https://docs.gitlab.com/api/users/#list-users ListUsers(opt *ListUsersOptions, options ...RequestOptionFunc) ([]*User, *Response, error) - GetUser(user int, opt GetUsersOptions, options ...RequestOptionFunc) (*User, *Response, error) + // GetUser gets a single user. + // + // GitLab API docs: https://docs.gitlab.com/api/users/#get-a-single-user + GetUser(user int64, opt GetUsersOptions, options ...RequestOptionFunc) (*User, *Response, error) + // CreateUser creates a new user. Note only administrators can create new users. + // + // GitLab API docs: https://docs.gitlab.com/api/users/#create-a-user CreateUser(opt *CreateUserOptions, options ...RequestOptionFunc) (*User, *Response, error) - ModifyUser(user int, opt *ModifyUserOptions, options ...RequestOptionFunc) (*User, *Response, error) - DeleteUser(user int, options ...RequestOptionFunc) (*Response, error) + // ModifyUser modifies an existing user. Only administrators can change attributes + // of a user. + // + // GitLab API docs: https://docs.gitlab.com/api/users/#modify-a-user + ModifyUser(user int64, opt *ModifyUserOptions, options ...RequestOptionFunc) (*User, *Response, error) + // DeleteUser deletes a user. Available only for administrators. This is an + // idempotent function, calling this function for a non-existent user id still + // returns a status code 200 OK. The JSON response differs if the user was + // actually deleted or not. In the former the user is returned and in the + // latter not. + // + // GitLab API docs: https://docs.gitlab.com/api/users/#delete-a-user + DeleteUser(user int64, options ...RequestOptionFunc) (*Response, error) + // CurrentUser gets currently authenticated user. + // + // GitLab API docs: https://docs.gitlab.com/api/users/#get-the-current-user CurrentUser(options ...RequestOptionFunc) (*User, *Response, error) + // CurrentUserStatus retrieves the user status + // + // GitLab API docs: + // https://docs.gitlab.com/api/users/#get-your-user-status CurrentUserStatus(options ...RequestOptionFunc) (*UserStatus, *Response, error) + // GetUserStatus retrieves a user's status. + // + // uid can be either a user ID (int) or a username (string); will trim one "@" character off the username, if present. + // Other types will cause an error to be returned. + // + // GitLab API docs: + // https://docs.gitlab.com/api/users/#get-the-status-of-a-user GetUserStatus(uid any, options ...RequestOptionFunc) (*UserStatus, *Response, error) + // SetUserStatus sets the user's status + // + // GitLab API docs: + // https://docs.gitlab.com/api/users/#set-your-user-status SetUserStatus(opt *UserStatusOptions, options ...RequestOptionFunc) (*UserStatus, *Response, error) - GetUserAssociationsCount(user int, options ...RequestOptionFunc) (*UserAssociationsCount, *Response, error) + // GetUserAssociationsCount gets a list of a specified user's associations. + // + // GitLab API docs: + // https://docs.gitlab.com/api/users/#get-a-count-of-a-users-projects-groups-issues-and-merge-requests + GetUserAssociationsCount(user int64, options ...RequestOptionFunc) (*UserAssociationsCount, *Response, error) + // ListSSHKeys gets a list of currently authenticated user's SSH keys. + // + // GitLab API docs: https://docs.gitlab.com/api/user_keys/#list-all-ssh-keys ListSSHKeys(opt *ListSSHKeysOptions, options ...RequestOptionFunc) ([]*SSHKey, *Response, error) + // ListSSHKeysForUser gets a list of a specified user's SSH keys. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_keys/#list-all-ssh-keys-for-a-user ListSSHKeysForUser(uid any, opt *ListSSHKeysForUserOptions, options ...RequestOptionFunc) ([]*SSHKey, *Response, error) - GetSSHKey(key int, options ...RequestOptionFunc) (*SSHKey, *Response, error) - GetSSHKeyForUser(user int, key int, options ...RequestOptionFunc) (*SSHKey, *Response, error) + // GetSSHKey gets a single key. + // + // GitLab API docs: https://docs.gitlab.com/api/user_keys/#get-an-ssh-key + GetSSHKey(key int64, options ...RequestOptionFunc) (*SSHKey, *Response, error) + // GetSSHKeyForUser gets a single key for a given user. + // + // GitLab API docs: https://docs.gitlab.com/api/user_keys/#get-an-ssh-key-for-a-user + GetSSHKeyForUser(user int64, key int64, options ...RequestOptionFunc) (*SSHKey, *Response, error) + // AddSSHKey creates a new key owned by the currently authenticated user. + // + // GitLab API docs: https://docs.gitlab.com/api/user_keys/#add-an-ssh-key AddSSHKey(opt *AddSSHKeyOptions, options ...RequestOptionFunc) (*SSHKey, *Response, error) - AddSSHKeyForUser(user int, opt *AddSSHKeyOptions, options ...RequestOptionFunc) (*SSHKey, *Response, error) - DeleteSSHKey(key int, options ...RequestOptionFunc) (*Response, error) - DeleteSSHKeyForUser(user, key int, options ...RequestOptionFunc) (*Response, error) + // AddSSHKeyForUser creates new key owned by specified user. Available only for + // admin. + // + // GitLab API docs: https://docs.gitlab.com/api/user_keys/#add-an-ssh-key-for-a-user + AddSSHKeyForUser(user int64, opt *AddSSHKeyOptions, options ...RequestOptionFunc) (*SSHKey, *Response, error) + // DeleteSSHKey deletes key owned by currently authenticated user. This is an + // idempotent function and calling it on a key that is already deleted or not + // available results in 200 OK. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_keys/#delete-an-ssh-key + DeleteSSHKey(key int64, options ...RequestOptionFunc) (*Response, error) + // DeleteSSHKeyForUser deletes key owned by a specified user. Available only + // for admin. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_keys/#delete-an-ssh-key-for-a-user + DeleteSSHKeyForUser(user, key int64, options ...RequestOptionFunc) (*Response, error) + // ListGPGKeys gets a list of currently authenticated user’s GPG keys. + // + // GitLab API docs: https://docs.gitlab.com/api/user_keys/#list-all-gpg-keys ListGPGKeys(options ...RequestOptionFunc) ([]*GPGKey, *Response, error) - GetGPGKey(key int, options ...RequestOptionFunc) (*GPGKey, *Response, error) + // GetGPGKey gets a specific GPG key of currently authenticated user. + // + // GitLab API docs: https://docs.gitlab.com/api/user_keys/#get-a-gpg-key + GetGPGKey(key int64, options ...RequestOptionFunc) (*GPGKey, *Response, error) + // AddGPGKey creates a new GPG key owned by the currently authenticated user. + // + // GitLab API docs: https://docs.gitlab.com/api/user_keys/#add-a-gpg-key AddGPGKey(opt *AddGPGKeyOptions, options ...RequestOptionFunc) (*GPGKey, *Response, error) - DeleteGPGKey(key int, options ...RequestOptionFunc) (*Response, error) - ListGPGKeysForUser(user int, options ...RequestOptionFunc) ([]*GPGKey, *Response, error) - GetGPGKeyForUser(user, key int, options ...RequestOptionFunc) (*GPGKey, *Response, error) - AddGPGKeyForUser(user int, opt *AddGPGKeyOptions, options ...RequestOptionFunc) (*GPGKey, *Response, error) - DeleteGPGKeyForUser(user, key int, options ...RequestOptionFunc) (*Response, error) + // DeleteGPGKey deletes a GPG key owned by currently authenticated user. + // + // GitLab API docs: https://docs.gitlab.com/api/user_keys/#delete-a-gpg-key + DeleteGPGKey(key int64, options ...RequestOptionFunc) (*Response, error) + // ListGPGKeysForUser gets a list of a specified user’s GPG keys. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_keys/#list-all-gpg-keys-for-a-user + ListGPGKeysForUser(user int64, options ...RequestOptionFunc) ([]*GPGKey, *Response, error) + // GetGPGKeyForUser gets a specific GPG key for a given user. + // + // GitLab API docs: https://docs.gitlab.com/api/user_keys/#get-a-gpg-key-for-a-user + GetGPGKeyForUser(user, key int64, options ...RequestOptionFunc) (*GPGKey, *Response, error) + // AddGPGKeyForUser creates new GPG key owned by the specified user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_keys/#add-a-gpg-key-for-a-user + AddGPGKeyForUser(user int64, opt *AddGPGKeyOptions, options ...RequestOptionFunc) (*GPGKey, *Response, error) + // DeleteGPGKeyForUser deletes a GPG key owned by a specified user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_keys/#delete-a-gpg-key-for-a-user + DeleteGPGKeyForUser(user, key int64, options ...RequestOptionFunc) (*Response, error) + // ListEmails gets a list of currently authenticated user's Emails. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_email_addresses/#list-all-email-addresses ListEmails(options ...RequestOptionFunc) ([]*Email, *Response, error) - ListEmailsForUser(user int, opt *ListEmailsForUserOptions, options ...RequestOptionFunc) ([]*Email, *Response, error) - GetEmail(email int, options ...RequestOptionFunc) (*Email, *Response, error) + // ListEmailsForUser gets a list of a specified user's Emails. Available + // only for admin + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_email_addresses/#list-all-email-addresses-for-a-user + ListEmailsForUser(user int64, opt *ListEmailsForUserOptions, options ...RequestOptionFunc) ([]*Email, *Response, error) + // GetEmail gets a single email. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_email_addresses/#get-details-on-an-email-address + GetEmail(email int64, options ...RequestOptionFunc) (*Email, *Response, error) + // AddEmail creates a new email owned by the currently authenticated user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_email_addresses/#add-an-email-address AddEmail(opt *AddEmailOptions, options ...RequestOptionFunc) (*Email, *Response, error) - AddEmailForUser(user int, opt *AddEmailOptions, options ...RequestOptionFunc) (*Email, *Response, error) - DeleteEmail(email int, options ...RequestOptionFunc) (*Response, error) - DeleteEmailForUser(user, email int, options ...RequestOptionFunc) (*Response, error) - BlockUser(user int, options ...RequestOptionFunc) error - UnblockUser(user int, options ...RequestOptionFunc) error - BanUser(user int, options ...RequestOptionFunc) error - UnbanUser(user int, options ...RequestOptionFunc) error - DeactivateUser(user int, options ...RequestOptionFunc) error - ActivateUser(user int, options ...RequestOptionFunc) error - ApproveUser(user int, options ...RequestOptionFunc) error - RejectUser(user int, options ...RequestOptionFunc) error - GetAllImpersonationTokens(user int, opt *GetAllImpersonationTokensOptions, options ...RequestOptionFunc) ([]*ImpersonationToken, *Response, error) - GetImpersonationToken(user, token int, options ...RequestOptionFunc) (*ImpersonationToken, *Response, error) - CreateImpersonationToken(user int, opt *CreateImpersonationTokenOptions, options ...RequestOptionFunc) (*ImpersonationToken, *Response, error) - RevokeImpersonationToken(user, token int, options ...RequestOptionFunc) (*Response, error) - CreatePersonalAccessToken(user int, opt *CreatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) + // AddEmailForUser creates new email owned by specified user. Available only for + // admin. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_email_addresses/#add-an-email-address-for-a-user + AddEmailForUser(user int64, opt *AddEmailOptions, options ...RequestOptionFunc) (*Email, *Response, error) + // DeleteEmail deletes email owned by currently authenticated user. This is an + // idempotent function and calling it on a key that is already deleted or not + // available results in 200 OK. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_email_addresses/#delete-an-email-address + DeleteEmail(email int64, options ...RequestOptionFunc) (*Response, error) + // DeleteEmailForUser deletes email owned by a specified user. Available only + // for admin. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_email_addresses/#delete-an-email-address-for-a-user + DeleteEmailForUser(user, email int64, options ...RequestOptionFunc) (*Response, error) + // BlockUser blocks the specified user. Available only for admin. + // + // GitLab API docs: https://docs.gitlab.com/api/user_moderation/#block-access-to-a-user + BlockUser(user int64, options ...RequestOptionFunc) error + // UnblockUser unblocks the specified user. Available only for admin. + // + // GitLab API docs: https://docs.gitlab.com/api/user_moderation/#unblock-access-to-a-user + UnblockUser(user int64, options ...RequestOptionFunc) error + // BanUser bans the specified user. Available only for admin. + // + // GitLab API docs: https://docs.gitlab.com/api/user_moderation/#ban-a-user + BanUser(user int64, options ...RequestOptionFunc) error + // UnbanUser unbans the specified user. Available only for admin. + // + // GitLab API docs: https://docs.gitlab.com/api/user_moderation/#unban-a-user + UnbanUser(user int64, options ...RequestOptionFunc) error + // DeactivateUser deactivate the specified user. Available only for admin. + // + // GitLab API docs: https://docs.gitlab.com/api/user_moderation/#deactivate-a-user + DeactivateUser(user int64, options ...RequestOptionFunc) error + // ActivateUser activate the specified user. Available only for admin. + // + // GitLab API docs: https://docs.gitlab.com/api/user_moderation/#reactivate-a-user + ActivateUser(user int64, options ...RequestOptionFunc) error + // ApproveUser approve the specified user. Available only for admin. + // + // GitLab API docs: https://docs.gitlab.com/api/user_moderation/#approve-access-to-a-user + ApproveUser(user int64, options ...RequestOptionFunc) error + // RejectUser reject the specified user. Available only for admin. + // + // GitLab API docs: https://docs.gitlab.com/api/user_moderation/#reject-access-to-a-user + RejectUser(user int64, options ...RequestOptionFunc) error + // GetAllImpersonationTokens retrieves all impersonation tokens of a user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_tokens/#list-all-impersonation-tokens-for-a-user + GetAllImpersonationTokens(user int64, opt *GetAllImpersonationTokensOptions, options ...RequestOptionFunc) ([]*ImpersonationToken, *Response, error) + // GetImpersonationToken retrieves an impersonation token of a user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_tokens/#get-an-impersonation-token-for-a-user + GetImpersonationToken(user, token int64, options ...RequestOptionFunc) (*ImpersonationToken, *Response, error) + // CreateImpersonationToken creates an impersonation token. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_tokens/#create-an-impersonation-token + CreateImpersonationToken(user int64, opt *CreateImpersonationTokenOptions, options ...RequestOptionFunc) (*ImpersonationToken, *Response, error) + // RevokeImpersonationToken revokes an impersonation token. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_tokens/#revoke-an-impersonation-token + RevokeImpersonationToken(user, token int64, options ...RequestOptionFunc) (*Response, error) + // CreatePersonalAccessToken creates a personal access token. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_tokens/#create-a-personal-access-token-for-a-user + CreatePersonalAccessToken(user int64, opt *CreatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) + // CreatePersonalAccessTokenForCurrentUser creates a personal access token with limited scopes for the currently authenticated user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_tokens/#create-a-personal-access-token CreatePersonalAccessTokenForCurrentUser(opt *CreatePersonalAccessTokenForCurrentUserOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) + // GetUserActivities retrieves user activities (admin only) + // + // GitLab API docs: + // https://docs.gitlab.com/api/users/#list-a-users-activity GetUserActivities(opt *GetUserActivitiesOptions, options ...RequestOptionFunc) ([]*UserActivity, *Response, error) - GetUserMemberships(user int, opt *GetUserMembershipOptions, options ...RequestOptionFunc) ([]*UserMembership, *Response, error) - DisableTwoFactor(user int, options ...RequestOptionFunc) error + // GetUserMemberships retrieves a list of the user's memberships. + // + // GitLab API docs: + // https://docs.gitlab.com/api/users/#list-projects-and-groups-that-a-user-is-a-member-of + GetUserMemberships(user int64, opt *GetUserMembershipOptions, options ...RequestOptionFunc) ([]*UserMembership, *Response, error) + // DisableTwoFactor disables two factor authentication for the specified user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/users/#disable-two-factor-authentication-for-a-user + DisableTwoFactor(user int64, options ...RequestOptionFunc) error + // CreateUserRunner creates a runner linked to the current user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/users/#create-a-runner-linked-to-a-user CreateUserRunner(opts *CreateUserRunnerOptions, options ...RequestOptionFunc) (*UserRunner, *Response, error) + // CreateServiceAccountUser creates a new service account user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_service_accounts/#create-a-service-account-user CreateServiceAccountUser(opts *CreateServiceAccountUserOptions, options ...RequestOptionFunc) (*User, *Response, error) + // ListServiceAccounts lists all service accounts. + // + // GitLab API docs: + // https://docs.gitlab.com/api/user_service_accounts/#list-all-service-account-users ListServiceAccounts(opt *ListServiceAccountsOptions, options ...RequestOptionFunc) ([]*ServiceAccount, *Response, error) + // UploadAvatar uploads an avatar to the current user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/users/#upload-an-avatar-for-yourself UploadAvatar(avatar io.Reader, filename string, options ...RequestOptionFunc) (*User, *Response, error) - DeleteUserIdentity(user int, provider string, options ...RequestOptionFunc) (*Response, error) + // DeleteUserIdentity deletes a user's authentication identity using the provider + // name associated with that identity. Only available for administrators. + // + // GitLab API docs: + // https://docs.gitlab.com/api/users/#delete-authentication-identity-from-a-user + DeleteUserIdentity(user int64, provider string, options ...RequestOptionFunc) (*Response, error) // events.go ListUserContributionEvents(uid any, opt *ListContributionEventsOptions, options ...RequestOptionFunc) ([]*ContributionEvent, *Response, error) @@ -120,7 +334,7 @@ var ( // BasicUser included in other service responses (such as merge requests, pipelines, etc). type BasicUser struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Name string `json:"name"` State string `json:"state"` @@ -135,7 +349,7 @@ type BasicUser struct { // GitLab API docs: // https://docs.gitlab.com/api/user_service_accounts/ type ServiceAccount struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Name string `json:"name"` } @@ -144,7 +358,7 @@ type ServiceAccount struct { // // GitLab API docs: https://docs.gitlab.com/api/users/ type User struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Email string `json:"email"` Name string `json:"name"` @@ -163,16 +377,16 @@ type User struct { JobTitle string `json:"job_title"` ExternUID string `json:"extern_uid"` Provider string `json:"provider"` - ThemeID int `json:"theme_id"` + ThemeID int64 `json:"theme_id"` LastActivityOn *ISOTime `json:"last_activity_on"` - ColorSchemeID int `json:"color_scheme_id"` + ColorSchemeID int64 `json:"color_scheme_id"` IsAdmin bool `json:"is_admin"` IsAuditor bool `json:"is_auditor"` AvatarURL string `json:"avatar_url"` CanCreateGroup bool `json:"can_create_group"` CanCreateProject bool `json:"can_create_project"` CanCreateOrganization bool `json:"can_create_organization"` - ProjectsLimit int `json:"projects_limit"` + ProjectsLimit int64 `json:"projects_limit"` CurrentSignInAt *time.Time `json:"current_sign_in_at"` CurrentSignInIP *net.IP `json:"current_sign_in_ip"` LastSignInAt *time.Time `json:"last_sign_in_at"` @@ -183,11 +397,11 @@ type User struct { Identities []*UserIdentity `json:"identities"` External bool `json:"external"` PrivateProfile bool `json:"private_profile"` - SharedRunnersMinutesLimit int `json:"shared_runners_minutes_limit"` - ExtraSharedRunnersMinutesLimit int `json:"extra_shared_runners_minutes_limit"` + SharedRunnersMinutesLimit int64 `json:"shared_runners_minutes_limit"` + ExtraSharedRunnersMinutesLimit int64 `json:"extra_shared_runners_minutes_limit"` UsingLicenseSeat bool `json:"using_license_seat"` CustomAttributes []*CustomAttribute `json:"custom_attributes"` - NamespaceID int `json:"namespace_id"` + NamespaceID int64 `json:"namespace_id"` Locked bool `json:"locked"` CreatedBy *BasicUser `json:"created_by"` } @@ -246,9 +460,6 @@ type ListUsersOptions struct { WithoutProjectBots *bool `url:"without_project_bots,omitempty" json:"without_project_bots,omitempty"` } -// ListUsers gets a list of users. -// -// GitLab API docs: https://docs.gitlab.com/api/users/#list-users func (s *UsersService) ListUsers(opt *ListUsersOptions, options ...RequestOptionFunc) ([]*User, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "users", opt, options) if err != nil { @@ -271,10 +482,7 @@ type GetUsersOptions struct { WithCustomAttributes *bool `url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"` } -// GetUser gets a single user. -// -// GitLab API docs: https://docs.gitlab.com/api/users/#get-a-single-user -func (s *UsersService) GetUser(user int, opt GetUsersOptions, options ...RequestOptionFunc) (*User, *Response, error) { +func (s *UsersService) GetUser(user int64, opt GetUsersOptions, options ...RequestOptionFunc) (*User, *Response, error) { u := fmt.Sprintf("users/%d", user) req, err := s.client.NewRequest(http.MethodGet, u, opt, options) @@ -311,20 +519,18 @@ type CreateUserOptions struct { Organization *string `url:"organization,omitempty" json:"organization,omitempty"` Password *string `url:"password,omitempty" json:"password,omitempty"` PrivateProfile *bool `url:"private_profile,omitempty" json:"private_profile,omitempty"` - ProjectsLimit *int `url:"projects_limit,omitempty" json:"projects_limit,omitempty"` + ProjectsLimit *int64 `url:"projects_limit,omitempty" json:"projects_limit,omitempty"` Provider *string `url:"provider,omitempty" json:"provider,omitempty"` ResetPassword *bool `url:"reset_password,omitempty" json:"reset_password,omitempty"` SkipConfirmation *bool `url:"skip_confirmation,omitempty" json:"skip_confirmation,omitempty"` Skype *string `url:"skype,omitempty" json:"skype,omitempty"` - ThemeID *int `url:"theme_id,omitempty" json:"theme_id,omitempty"` + ThemeID *int64 `url:"theme_id,omitempty" json:"theme_id,omitempty"` Twitter *string `url:"twitter,omitempty" json:"twitter,omitempty"` Username *string `url:"username,omitempty" json:"username,omitempty"` WebsiteURL *string `url:"website_url,omitempty" json:"website_url,omitempty"` + ViewDiffsFileByFile *bool `url:"view_diffs_file_by_file,omitempty" json:"view_diffs_file_by_file,omitempty"` } -// CreateUser creates a new user. Note only administrators can create new users. -// -// GitLab API docs: https://docs.gitlab.com/api/users/#create-a-user func (s *UsersService) CreateUser(opt *CreateUserOptions, options ...RequestOptionFunc) (*User, *Response, error) { var err error var req *retryablehttp.Request @@ -359,38 +565,35 @@ func (s *UsersService) CreateUser(opt *CreateUserOptions, options ...RequestOpti // // GitLab API docs: https://docs.gitlab.com/api/users/#modify-a-user type ModifyUserOptions struct { - Admin *bool `url:"admin,omitempty" json:"admin,omitempty"` - Avatar *UserAvatar `url:"-" json:"avatar,omitempty"` - Bio *string `url:"bio,omitempty" json:"bio,omitempty"` - CanCreateGroup *bool `url:"can_create_group,omitempty" json:"can_create_group,omitempty"` - CommitEmail *string `url:"commit_email,omitempty" json:"commit_email,omitempty"` - Email *string `url:"email,omitempty" json:"email,omitempty"` - External *bool `url:"external,omitempty" json:"external,omitempty"` - ExternUID *string `url:"extern_uid,omitempty" json:"extern_uid,omitempty"` - JobTitle *string `url:"job_title,omitempty" json:"job_title,omitempty"` - Linkedin *string `url:"linkedin,omitempty" json:"linkedin,omitempty"` - Location *string `url:"location,omitempty" json:"location,omitempty"` - Name *string `url:"name,omitempty" json:"name,omitempty"` - Note *string `url:"note,omitempty" json:"note,omitempty"` - Organization *string `url:"organization,omitempty" json:"organization,omitempty"` - Password *string `url:"password,omitempty" json:"password,omitempty"` - PrivateProfile *bool `url:"private_profile,omitempty" json:"private_profile,omitempty"` - ProjectsLimit *int `url:"projects_limit,omitempty" json:"projects_limit,omitempty"` - Provider *string `url:"provider,omitempty" json:"provider,omitempty"` - PublicEmail *string `url:"public_email,omitempty" json:"public_email,omitempty"` - SkipReconfirmation *bool `url:"skip_reconfirmation,omitempty" json:"skip_reconfirmation,omitempty"` - Skype *string `url:"skype,omitempty" json:"skype,omitempty"` - ThemeID *int `url:"theme_id,omitempty" json:"theme_id,omitempty"` - Twitter *string `url:"twitter,omitempty" json:"twitter,omitempty"` - Username *string `url:"username,omitempty" json:"username,omitempty"` - WebsiteURL *string `url:"website_url,omitempty" json:"website_url,omitempty"` -} - -// ModifyUser modifies an existing user. Only administrators can change attributes -// of a user. -// -// GitLab API docs: https://docs.gitlab.com/api/users/#modify-a-user -func (s *UsersService) ModifyUser(user int, opt *ModifyUserOptions, options ...RequestOptionFunc) (*User, *Response, error) { + Admin *bool `url:"admin,omitempty" json:"admin,omitempty"` + Avatar *UserAvatar `url:"-" json:"avatar,omitempty"` + Bio *string `url:"bio,omitempty" json:"bio,omitempty"` + CanCreateGroup *bool `url:"can_create_group,omitempty" json:"can_create_group,omitempty"` + CommitEmail *string `url:"commit_email,omitempty" json:"commit_email,omitempty"` + Email *string `url:"email,omitempty" json:"email,omitempty"` + External *bool `url:"external,omitempty" json:"external,omitempty"` + ExternUID *string `url:"extern_uid,omitempty" json:"extern_uid,omitempty"` + JobTitle *string `url:"job_title,omitempty" json:"job_title,omitempty"` + Linkedin *string `url:"linkedin,omitempty" json:"linkedin,omitempty"` + Location *string `url:"location,omitempty" json:"location,omitempty"` + Name *string `url:"name,omitempty" json:"name,omitempty"` + Note *string `url:"note,omitempty" json:"note,omitempty"` + Organization *string `url:"organization,omitempty" json:"organization,omitempty"` + Password *string `url:"password,omitempty" json:"password,omitempty"` + PrivateProfile *bool `url:"private_profile,omitempty" json:"private_profile,omitempty"` + ProjectsLimit *int64 `url:"projects_limit,omitempty" json:"projects_limit,omitempty"` + Provider *string `url:"provider,omitempty" json:"provider,omitempty"` + PublicEmail *string `url:"public_email,omitempty" json:"public_email,omitempty"` + SkipReconfirmation *bool `url:"skip_reconfirmation,omitempty" json:"skip_reconfirmation,omitempty"` + Skype *string `url:"skype,omitempty" json:"skype,omitempty"` + ThemeID *int64 `url:"theme_id,omitempty" json:"theme_id,omitempty"` + Twitter *string `url:"twitter,omitempty" json:"twitter,omitempty"` + Username *string `url:"username,omitempty" json:"username,omitempty"` + WebsiteURL *string `url:"website_url,omitempty" json:"website_url,omitempty"` + ViewDiffsFileByFile *bool `url:"view_diffs_file_by_file,omitempty" json:"view_diffs_file_by_file,omitempty"` +} + +func (s *UsersService) ModifyUser(user int64, opt *ModifyUserOptions, options ...RequestOptionFunc) (*User, *Response, error) { var err error var req *retryablehttp.Request u := fmt.Sprintf("users/%d", user) @@ -421,14 +624,7 @@ func (s *UsersService) ModifyUser(user int, opt *ModifyUserOptions, options ...R return usr, resp, nil } -// DeleteUser deletes a user. Available only for administrators. This is an -// idempotent function, calling this function for a non-existent user id still -// returns a status code 200 OK. The JSON response differs if the user was -// actually deleted or not. In the former the user is returned and in the -// latter not. -// -// GitLab API docs: https://docs.gitlab.com/api/users/#delete-a-user -func (s *UsersService) DeleteUser(user int, options ...RequestOptionFunc) (*Response, error) { +func (s *UsersService) DeleteUser(user int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("users/%d", user) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -439,9 +635,6 @@ func (s *UsersService) DeleteUser(user int, options ...RequestOptionFunc) (*Resp return s.client.Do(req, nil) } -// CurrentUser gets currently authenticated user. -// -// GitLab API docs: https://docs.gitlab.com/api/users/#get-the-current-user func (s *UsersService) CurrentUser(options ...RequestOptionFunc) (*User, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "user", nil, options) if err != nil { @@ -469,10 +662,6 @@ type UserStatus struct { ClearStatusAt *time.Time `json:"clear_status_at"` } -// CurrentUserStatus retrieves the user status -// -// GitLab API docs: -// https://docs.gitlab.com/api/users/#get-your-user-status func (s *UsersService) CurrentUserStatus(options ...RequestOptionFunc) (*UserStatus, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "user/status", nil, options) if err != nil { @@ -488,13 +677,6 @@ func (s *UsersService) CurrentUserStatus(options ...RequestOptionFunc) (*UserSta return status, resp, nil } -// GetUserStatus retrieves a user's status. -// -// uid can be either a user ID (int) or a username (string); will trim one "@" character off the username, if present. -// Other types will cause an error to be returned. -// -// GitLab API docs: -// https://docs.gitlab.com/api/users/#get-the-status-of-a-user func (s *UsersService) GetUserStatus(uid any, options ...RequestOptionFunc) (*UserStatus, *Response, error) { user, err := parseID(uid) if err != nil { @@ -528,10 +710,6 @@ type UserStatusOptions struct { ClearStatusAfter *ClearStatusAfterValue `url:"clear_status_after,omitempty" json:"clear_status_after,omitempty"` } -// SetUserStatus sets the user's status -// -// GitLab API docs: -// https://docs.gitlab.com/api/users/#set-your-user-status func (s *UsersService) SetUserStatus(opt *UserStatusOptions, options ...RequestOptionFunc) (*UserStatus, *Response, error) { req, err := s.client.NewRequest(http.MethodPut, "user/status", opt, options) if err != nil { @@ -552,17 +730,17 @@ func (s *UsersService) SetUserStatus(opt *UserStatusOptions, options ...RequestO // GitLab API docs: // https://docs.gitlab.com/api/users/#get-a-count-of-a-users-projects-groups-issues-and-merge-requests type UserAssociationsCount struct { - GroupsCount int `json:"groups_count"` - ProjectsCount int `json:"projects_count"` - IssuesCount int `json:"issues_count"` - MergeRequestsCount int `json:"merge_requests_count"` + GroupsCount int64 `json:"groups_count"` + ProjectsCount int64 `json:"projects_count"` + IssuesCount int64 `json:"issues_count"` + MergeRequestsCount int64 `json:"merge_requests_count"` } // GetUserAssociationsCount gets a list of a specified user associations. // // GitLab API docs: // https://docs.gitlab.com/api/users/#get-a-count-of-a-users-projects-groups-issues-and-merge-requests -func (s *UsersService) GetUserAssociationsCount(user int, options ...RequestOptionFunc) (*UserAssociationsCount, *Response, error) { +func (s *UsersService) GetUserAssociationsCount(user int64, options ...RequestOptionFunc) (*UserAssociationsCount, *Response, error) { u := fmt.Sprintf("users/%d/associations_count", user) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -583,7 +761,7 @@ func (s *UsersService) GetUserAssociationsCount(user int, options ...RequestOpti // // GitLab API docs: https://docs.gitlab.com/api/user_keys/#list-all-ssh-keys type SSHKey struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` Key string `json:"key"` CreatedAt *time.Time `json:"created_at"` @@ -594,11 +772,10 @@ type SSHKey struct { // ListSSHKeysOptions represents the available ListSSHKeys options. // // GitLab API docs: https://docs.gitlab.com/api/user_keys/#list-all-ssh-keys -type ListSSHKeysOptions ListOptions +type ListSSHKeysOptions struct { + ListOptions +} -// ListSSHKeys gets a list of currently authenticated user's SSH keys. -// -// GitLab API docs: https://docs.gitlab.com/api/user_keys/#list-all-ssh-keys func (s *UsersService) ListSSHKeys(opt *ListSSHKeysOptions, options ...RequestOptionFunc) ([]*SSHKey, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "user/keys", opt, options) if err != nil { @@ -618,12 +795,10 @@ func (s *UsersService) ListSSHKeys(opt *ListSSHKeysOptions, options ...RequestOp // // GitLab API docs: // https://docs.gitlab.com/api/user_keys/#list-all-ssh-keys-for-a-user -type ListSSHKeysForUserOptions ListOptions +type ListSSHKeysForUserOptions struct { + ListOptions +} -// ListSSHKeysForUser gets a list of a specified user's SSH keys. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_keys/#list-all-ssh-keys-for-a-user func (s *UsersService) ListSSHKeysForUser(uid any, opt *ListSSHKeysForUserOptions, options ...RequestOptionFunc) ([]*SSHKey, *Response, error) { user, err := parseID(uid) if err != nil { @@ -645,10 +820,7 @@ func (s *UsersService) ListSSHKeysForUser(uid any, opt *ListSSHKeysForUserOption return k, resp, nil } -// GetSSHKey gets a single key. -// -// GitLab API docs: https://docs.gitlab.com/api/user_keys/#get-an-ssh-key -func (s *UsersService) GetSSHKey(key int, options ...RequestOptionFunc) (*SSHKey, *Response, error) { +func (s *UsersService) GetSSHKey(key int64, options ...RequestOptionFunc) (*SSHKey, *Response, error) { u := fmt.Sprintf("user/keys/%d", key) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -665,10 +837,7 @@ func (s *UsersService) GetSSHKey(key int, options ...RequestOptionFunc) (*SSHKey return k, resp, nil } -// GetSSHKeyForUser gets a single key for a given user. -// -// GitLab API docs: https://docs.gitlab.com/api/user_keys/#get-an-ssh-key-for-a-user -func (s *UsersService) GetSSHKeyForUser(user int, key int, options ...RequestOptionFunc) (*SSHKey, *Response, error) { +func (s *UsersService) GetSSHKeyForUser(user int64, key int64, options ...RequestOptionFunc) (*SSHKey, *Response, error) { u := fmt.Sprintf("users/%d/keys/%d", user, key) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -695,9 +864,6 @@ type AddSSHKeyOptions struct { UsageType *string `url:"usage_type,omitempty" json:"usage_type,omitempty"` } -// AddSSHKey creates a new key owned by the currently authenticated user. -// -// GitLab API docs: https://docs.gitlab.com/api/user_keys/#add-an-ssh-key func (s *UsersService) AddSSHKey(opt *AddSSHKeyOptions, options ...RequestOptionFunc) (*SSHKey, *Response, error) { req, err := s.client.NewRequest(http.MethodPost, "user/keys", opt, options) if err != nil { @@ -713,11 +879,7 @@ func (s *UsersService) AddSSHKey(opt *AddSSHKeyOptions, options ...RequestOption return k, resp, nil } -// AddSSHKeyForUser creates new key owned by specified user. Available only for -// admin. -// -// GitLab API docs: https://docs.gitlab.com/api/user_keys/#add-an-ssh-key-for-a-user -func (s *UsersService) AddSSHKeyForUser(user int, opt *AddSSHKeyOptions, options ...RequestOptionFunc) (*SSHKey, *Response, error) { +func (s *UsersService) AddSSHKeyForUser(user int64, opt *AddSSHKeyOptions, options ...RequestOptionFunc) (*SSHKey, *Response, error) { u := fmt.Sprintf("users/%d/keys", user) req, err := s.client.NewRequest(http.MethodPost, u, opt, options) @@ -734,13 +896,7 @@ func (s *UsersService) AddSSHKeyForUser(user int, opt *AddSSHKeyOptions, options return k, resp, nil } -// DeleteSSHKey deletes key owned by currently authenticated user. This is an -// idempotent function and calling it on a key that is already deleted or not -// available results in 200 OK. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_keys/#delete-an-ssh-key -func (s *UsersService) DeleteSSHKey(key int, options ...RequestOptionFunc) (*Response, error) { +func (s *UsersService) DeleteSSHKey(key int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("user/keys/%d", key) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -751,12 +907,7 @@ func (s *UsersService) DeleteSSHKey(key int, options ...RequestOptionFunc) (*Res return s.client.Do(req, nil) } -// DeleteSSHKeyForUser deletes key owned by a specified user. Available only -// for admin. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_keys/#delete-an-ssh-key-for-a-user -func (s *UsersService) DeleteSSHKeyForUser(user, key int, options ...RequestOptionFunc) (*Response, error) { +func (s *UsersService) DeleteSSHKeyForUser(user, key int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("users/%d/keys/%d", user, key) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -771,14 +922,11 @@ func (s *UsersService) DeleteSSHKeyForUser(user, key int, options ...RequestOpti // // GitLab API docs: https://docs.gitlab.com/api/user_keys/#list-all-gpg-keys type GPGKey struct { - ID int `json:"id"` + ID int64 `json:"id"` Key string `json:"key"` CreatedAt *time.Time `json:"created_at"` } -// ListGPGKeys gets a list of currently authenticated user’s GPG keys. -// -// GitLab API docs: https://docs.gitlab.com/api/user_keys/#list-all-gpg-keys func (s *UsersService) ListGPGKeys(options ...RequestOptionFunc) ([]*GPGKey, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "user/gpg_keys", nil, options) if err != nil { @@ -794,10 +942,7 @@ func (s *UsersService) ListGPGKeys(options ...RequestOptionFunc) ([]*GPGKey, *Re return ks, resp, nil } -// GetGPGKey gets a specific GPG key of currently authenticated user. -// -// GitLab API docs: https://docs.gitlab.com/api/user_keys/#get-a-gpg-key -func (s *UsersService) GetGPGKey(key int, options ...RequestOptionFunc) (*GPGKey, *Response, error) { +func (s *UsersService) GetGPGKey(key int64, options ...RequestOptionFunc) (*GPGKey, *Response, error) { u := fmt.Sprintf("user/gpg_keys/%d", key) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -821,9 +966,6 @@ type AddGPGKeyOptions struct { Key *string `url:"key,omitempty" json:"key,omitempty"` } -// AddGPGKey creates a new GPG key owned by the currently authenticated user. -// -// GitLab API docs: https://docs.gitlab.com/api/user_keys/#add-a-gpg-key func (s *UsersService) AddGPGKey(opt *AddGPGKeyOptions, options ...RequestOptionFunc) (*GPGKey, *Response, error) { req, err := s.client.NewRequest(http.MethodPost, "user/gpg_keys", opt, options) if err != nil { @@ -839,10 +981,7 @@ func (s *UsersService) AddGPGKey(opt *AddGPGKeyOptions, options ...RequestOption return k, resp, nil } -// DeleteGPGKey deletes a GPG key owned by currently authenticated user. -// -// GitLab API docs: https://docs.gitlab.com/api/user_keys/#delete-a-gpg-key -func (s *UsersService) DeleteGPGKey(key int, options ...RequestOptionFunc) (*Response, error) { +func (s *UsersService) DeleteGPGKey(key int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("user/gpg_keys/%d", key) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -853,11 +992,7 @@ func (s *UsersService) DeleteGPGKey(key int, options ...RequestOptionFunc) (*Res return s.client.Do(req, nil) } -// ListGPGKeysForUser gets a list of a specified user’s GPG keys. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_keys/#list-all-gpg-keys-for-a-user -func (s *UsersService) ListGPGKeysForUser(user int, options ...RequestOptionFunc) ([]*GPGKey, *Response, error) { +func (s *UsersService) ListGPGKeysForUser(user int64, options ...RequestOptionFunc) ([]*GPGKey, *Response, error) { u := fmt.Sprintf("users/%d/gpg_keys", user) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -874,10 +1009,7 @@ func (s *UsersService) ListGPGKeysForUser(user int, options ...RequestOptionFunc return ks, resp, nil } -// GetGPGKeyForUser gets a specific GPG key for a given user. -// -// GitLab API docs: https://docs.gitlab.com/api/user_keys/#get-a-gpg-key-for-a-user -func (s *UsersService) GetGPGKeyForUser(user, key int, options ...RequestOptionFunc) (*GPGKey, *Response, error) { +func (s *UsersService) GetGPGKeyForUser(user, key int64, options ...RequestOptionFunc) (*GPGKey, *Response, error) { u := fmt.Sprintf("users/%d/gpg_keys/%d", user, key) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -894,11 +1026,7 @@ func (s *UsersService) GetGPGKeyForUser(user, key int, options ...RequestOptionF return k, resp, nil } -// AddGPGKeyForUser creates new GPG key owned by the specified user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_keys/#add-a-gpg-key-for-a-user -func (s *UsersService) AddGPGKeyForUser(user int, opt *AddGPGKeyOptions, options ...RequestOptionFunc) (*GPGKey, *Response, error) { +func (s *UsersService) AddGPGKeyForUser(user int64, opt *AddGPGKeyOptions, options ...RequestOptionFunc) (*GPGKey, *Response, error) { u := fmt.Sprintf("users/%d/gpg_keys", user) req, err := s.client.NewRequest(http.MethodPost, u, opt, options) @@ -915,11 +1043,7 @@ func (s *UsersService) AddGPGKeyForUser(user int, opt *AddGPGKeyOptions, options return k, resp, nil } -// DeleteGPGKeyForUser deletes a GPG key owned by a specified user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_keys/#delete-a-gpg-key-for-a-user -func (s *UsersService) DeleteGPGKeyForUser(user, key int, options ...RequestOptionFunc) (*Response, error) { +func (s *UsersService) DeleteGPGKeyForUser(user, key int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("users/%d/gpg_keys/%d", user, key) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -935,15 +1059,11 @@ func (s *UsersService) DeleteGPGKeyForUser(user, key int, options ...RequestOpti // GitLab API docs: // https://docs.gitlab.com/api/user_email_addresses/#list-all-email-addresses type Email struct { - ID int `json:"id"` + ID int64 `json:"id"` Email string `json:"email"` ConfirmedAt *time.Time `json:"confirmed_at"` } -// ListEmails gets a list of currently authenticated user's Emails. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_email_addresses/#list-all-email-addresses func (s *UsersService) ListEmails(options ...RequestOptionFunc) ([]*Email, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "user/emails", nil, options) if err != nil { @@ -963,14 +1083,11 @@ func (s *UsersService) ListEmails(options ...RequestOptionFunc) ([]*Email, *Resp // // GitLab API docs: // https://docs.gitlab.com/api/user_email_addresses/#list-all-email-addresses-for-a-user -type ListEmailsForUserOptions ListOptions +type ListEmailsForUserOptions struct { + ListOptions +} -// ListEmailsForUser gets a list of a specified user's Emails. Available -// only for admin -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_email_addresses/#list-all-email-addresses-for-a-user -func (s *UsersService) ListEmailsForUser(user int, opt *ListEmailsForUserOptions, options ...RequestOptionFunc) ([]*Email, *Response, error) { +func (s *UsersService) ListEmailsForUser(user int64, opt *ListEmailsForUserOptions, options ...RequestOptionFunc) ([]*Email, *Response, error) { u := fmt.Sprintf("users/%d/emails", user) req, err := s.client.NewRequest(http.MethodGet, u, opt, options) @@ -987,11 +1104,7 @@ func (s *UsersService) ListEmailsForUser(user int, opt *ListEmailsForUserOptions return e, resp, nil } -// GetEmail gets a single email. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_email_addresses/#get-details-on-an-email-address -func (s *UsersService) GetEmail(email int, options ...RequestOptionFunc) (*Email, *Response, error) { +func (s *UsersService) GetEmail(email int64, options ...RequestOptionFunc) (*Email, *Response, error) { u := fmt.Sprintf("user/emails/%d", email) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -1017,10 +1130,6 @@ type AddEmailOptions struct { SkipConfirmation *bool `url:"skip_confirmation,omitempty" json:"skip_confirmation,omitempty"` } -// AddEmail creates a new email owned by the currently authenticated user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_email_addresses/#add-an-email-address func (s *UsersService) AddEmail(opt *AddEmailOptions, options ...RequestOptionFunc) (*Email, *Response, error) { req, err := s.client.NewRequest(http.MethodPost, "user/emails", opt, options) if err != nil { @@ -1036,12 +1145,7 @@ func (s *UsersService) AddEmail(opt *AddEmailOptions, options ...RequestOptionFu return e, resp, nil } -// AddEmailForUser creates new email owned by specified user. Available only for -// admin. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_email_addresses/#add-an-email-address-for-a-user -func (s *UsersService) AddEmailForUser(user int, opt *AddEmailOptions, options ...RequestOptionFunc) (*Email, *Response, error) { +func (s *UsersService) AddEmailForUser(user int64, opt *AddEmailOptions, options ...RequestOptionFunc) (*Email, *Response, error) { u := fmt.Sprintf("users/%d/emails", user) req, err := s.client.NewRequest(http.MethodPost, u, opt, options) @@ -1058,13 +1162,7 @@ func (s *UsersService) AddEmailForUser(user int, opt *AddEmailOptions, options . return e, resp, nil } -// DeleteEmail deletes email owned by currently authenticated user. This is an -// idempotent function and calling it on a key that is already deleted or not -// available results in 200 OK. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_email_addresses/#delete-an-email-address -func (s *UsersService) DeleteEmail(email int, options ...RequestOptionFunc) (*Response, error) { +func (s *UsersService) DeleteEmail(email int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("user/emails/%d", email) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -1075,12 +1173,7 @@ func (s *UsersService) DeleteEmail(email int, options ...RequestOptionFunc) (*Re return s.client.Do(req, nil) } -// DeleteEmailForUser deletes email owned by a specified user. Available only -// for admin. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_email_addresses/#delete-an-email-address-for-a-user -func (s *UsersService) DeleteEmailForUser(user, email int, options ...RequestOptionFunc) (*Response, error) { +func (s *UsersService) DeleteEmailForUser(user, email int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("users/%d/emails/%d", user, email) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -1091,10 +1184,7 @@ func (s *UsersService) DeleteEmailForUser(user, email int, options ...RequestOpt return s.client.Do(req, nil) } -// BlockUser blocks the specified user. Available only for admin. -// -// GitLab API docs: https://docs.gitlab.com/api/user_moderation/#block-access-to-a-user -func (s *UsersService) BlockUser(user int, options ...RequestOptionFunc) error { +func (s *UsersService) BlockUser(user int64, options ...RequestOptionFunc) error { u := fmt.Sprintf("users/%d/block", user) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -1102,27 +1192,15 @@ func (s *UsersService) BlockUser(user int, options ...RequestOptionFunc) error { return err } - resp, err := s.client.Do(req, nil) - if err != nil && resp == nil { - return err + _, doErr := s.client.Do(req, nil) + if doErr != nil { + return doErr } - switch resp.StatusCode { - case 201: - return nil - case 403: - return ErrUserBlockPrevented - case 404: - return ErrUserNotFound - default: - return fmt.Errorf("%w: %d", errUnexpectedResultCode, resp.StatusCode) - } + return nil } -// UnblockUser unblocks the specified user. Available only for admin. -// -// GitLab API docs: https://docs.gitlab.com/api/user_moderation/#unblock-access-to-a-user -func (s *UsersService) UnblockUser(user int, options ...RequestOptionFunc) error { +func (s *UsersService) UnblockUser(user int64, options ...RequestOptionFunc) error { u := fmt.Sprintf("users/%d/unblock", user) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -1147,10 +1225,7 @@ func (s *UsersService) UnblockUser(user int, options ...RequestOptionFunc) error } } -// BanUser bans the specified user. Available only for admin. -// -// GitLab API docs: https://docs.gitlab.com/api/user_moderation/#ban-a-user -func (s *UsersService) BanUser(user int, options ...RequestOptionFunc) error { +func (s *UsersService) BanUser(user int64, options ...RequestOptionFunc) error { u := fmt.Sprintf("users/%d/ban", user) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -1173,10 +1248,7 @@ func (s *UsersService) BanUser(user int, options ...RequestOptionFunc) error { } } -// UnbanUser unbans the specified user. Available only for admin. -// -// GitLab API docs: https://docs.gitlab.com/api/user_moderation/#unban-a-user -func (s *UsersService) UnbanUser(user int, options ...RequestOptionFunc) error { +func (s *UsersService) UnbanUser(user int64, options ...RequestOptionFunc) error { u := fmt.Sprintf("users/%d/unban", user) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -1199,10 +1271,7 @@ func (s *UsersService) UnbanUser(user int, options ...RequestOptionFunc) error { } } -// DeactivateUser deactivate the specified user. Available only for admin. -// -// GitLab API docs: https://docs.gitlab.com/api/user_moderation/#deactivate-a-user -func (s *UsersService) DeactivateUser(user int, options ...RequestOptionFunc) error { +func (s *UsersService) DeactivateUser(user int64, options ...RequestOptionFunc) error { u := fmt.Sprintf("users/%d/deactivate", user) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -1227,10 +1296,7 @@ func (s *UsersService) DeactivateUser(user int, options ...RequestOptionFunc) er } } -// ActivateUser activate the specified user. Available only for admin. -// -// GitLab API docs: https://docs.gitlab.com/api/user_moderation/#reactivate-a-user -func (s *UsersService) ActivateUser(user int, options ...RequestOptionFunc) error { +func (s *UsersService) ActivateUser(user int64, options ...RequestOptionFunc) error { u := fmt.Sprintf("users/%d/activate", user) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -1255,10 +1321,7 @@ func (s *UsersService) ActivateUser(user int, options ...RequestOptionFunc) erro } } -// ApproveUser approve the specified user. Available only for admin. -// -// GitLab API docs: https://docs.gitlab.com/api/user_moderation/#approve-access-to-a-user -func (s *UsersService) ApproveUser(user int, options ...RequestOptionFunc) error { +func (s *UsersService) ApproveUser(user int64, options ...RequestOptionFunc) error { u := fmt.Sprintf("users/%d/approve", user) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -1283,10 +1346,7 @@ func (s *UsersService) ApproveUser(user int, options ...RequestOptionFunc) error } } -// RejectUser reject the specified user. Available only for admin. -// -// GitLab API docs: https://docs.gitlab.com/api/user_moderation/#reject-access-to-a-user -func (s *UsersService) RejectUser(user int, options ...RequestOptionFunc) error { +func (s *UsersService) RejectUser(user int64, options ...RequestOptionFunc) error { u := fmt.Sprintf("users/%d/reject", user) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -1318,7 +1378,7 @@ func (s *UsersService) RejectUser(user int, options ...RequestOptionFunc) error // GitLab API docs: // https://docs.gitlab.com/api/user_tokens/#list-all-impersonation-tokens-for-a-user type ImpersonationToken struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Active bool `json:"active"` Token string `json:"token"` @@ -1339,11 +1399,7 @@ type GetAllImpersonationTokensOptions struct { State *string `url:"state,omitempty" json:"state,omitempty"` } -// GetAllImpersonationTokens retrieves all impersonation tokens of a user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_tokens/#list-all-impersonation-tokens-for-a-user -func (s *UsersService) GetAllImpersonationTokens(user int, opt *GetAllImpersonationTokensOptions, options ...RequestOptionFunc) ([]*ImpersonationToken, *Response, error) { +func (s *UsersService) GetAllImpersonationTokens(user int64, opt *GetAllImpersonationTokensOptions, options ...RequestOptionFunc) ([]*ImpersonationToken, *Response, error) { u := fmt.Sprintf("users/%d/impersonation_tokens", user) req, err := s.client.NewRequest(http.MethodGet, u, opt, options) @@ -1360,11 +1416,7 @@ func (s *UsersService) GetAllImpersonationTokens(user int, opt *GetAllImpersonat return ts, resp, nil } -// GetImpersonationToken retrieves an impersonation token of a user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_tokens/#get-an-impersonation-token-for-a-user -func (s *UsersService) GetImpersonationToken(user, token int, options ...RequestOptionFunc) (*ImpersonationToken, *Response, error) { +func (s *UsersService) GetImpersonationToken(user, token int64, options ...RequestOptionFunc) (*ImpersonationToken, *Response, error) { u := fmt.Sprintf("users/%d/impersonation_tokens/%d", user, token) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -1392,11 +1444,7 @@ type CreateImpersonationTokenOptions struct { ExpiresAt *time.Time `url:"expires_at,omitempty" json:"expires_at,omitempty"` } -// CreateImpersonationToken creates an impersonation token. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_tokens/#create-an-impersonation-token -func (s *UsersService) CreateImpersonationToken(user int, opt *CreateImpersonationTokenOptions, options ...RequestOptionFunc) (*ImpersonationToken, *Response, error) { +func (s *UsersService) CreateImpersonationToken(user int64, opt *CreateImpersonationTokenOptions, options ...RequestOptionFunc) (*ImpersonationToken, *Response, error) { u := fmt.Sprintf("users/%d/impersonation_tokens", user) req, err := s.client.NewRequest(http.MethodPost, u, opt, options) @@ -1413,11 +1461,7 @@ func (s *UsersService) CreateImpersonationToken(user int, opt *CreateImpersonati return t, resp, nil } -// RevokeImpersonationToken revokes an impersonation token. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_tokens/#revoke-an-impersonation-token -func (s *UsersService) RevokeImpersonationToken(user, token int, options ...RequestOptionFunc) (*Response, error) { +func (s *UsersService) RevokeImpersonationToken(user, token int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("users/%d/impersonation_tokens/%d", user, token) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -1440,11 +1484,7 @@ type CreatePersonalAccessTokenOptions struct { Scopes *[]string `url:"scopes,omitempty" json:"scopes,omitempty"` } -// CreatePersonalAccessToken creates a personal access token. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_tokens/#create-a-personal-access-token-for-a-user -func (s *UsersService) CreatePersonalAccessToken(user int, opt *CreatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { +func (s *UsersService) CreatePersonalAccessToken(user int64, opt *CreatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { u := fmt.Sprintf("users/%d/personal_access_tokens", user) req, err := s.client.NewRequest(http.MethodPost, u, opt, options) @@ -1473,10 +1513,6 @@ type CreatePersonalAccessTokenForCurrentUserOptions struct { ExpiresAt *ISOTime `url:"expires_at,omitempty" json:"expires_at,omitempty"` } -// CreatePersonalAccessTokenForCurrentUser creates a personal access token with limited scopes for the currently authenticated user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_tokens/#create-a-personal-access-token func (s *UsersService) CreatePersonalAccessTokenForCurrentUser(opt *CreatePersonalAccessTokenForCurrentUserOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) { u := "user/personal_access_tokens" @@ -1512,10 +1548,6 @@ type GetUserActivitiesOptions struct { From *ISOTime `url:"from,omitempty" json:"from,omitempty"` } -// GetUserActivities retrieves user activities (admin only) -// -// GitLab API docs: -// https://docs.gitlab.com/api/users/#list-a-users-activity func (s *UsersService) GetUserActivities(opt *GetUserActivitiesOptions, options ...RequestOptionFunc) ([]*UserActivity, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "user/activities", opt, options) if err != nil { @@ -1536,7 +1568,7 @@ func (s *UsersService) GetUserActivities(opt *GetUserActivitiesOptions, options // GitLab API docs: // https://docs.gitlab.com/api/users/#list-projects-and-groups-that-a-user-is-a-member-of type UserMembership struct { - SourceID int `json:"source_id"` + SourceID int64 `json:"source_id"` SourceName string `json:"source_name"` SourceType string `json:"source_type"` AccessLevel AccessLevelValue `json:"access_level"` @@ -1551,11 +1583,7 @@ type GetUserMembershipOptions struct { Type *string `url:"type,omitempty" json:"type,omitempty"` } -// GetUserMemberships retrieves a list of the user's memberships. -// -// GitLab API docs: -// https://docs.gitlab.com/api/users/#list-projects-and-groups-that-a-user-is-a-member-of -func (s *UsersService) GetUserMemberships(user int, opt *GetUserMembershipOptions, options ...RequestOptionFunc) ([]*UserMembership, *Response, error) { +func (s *UsersService) GetUserMemberships(user int64, opt *GetUserMembershipOptions, options ...RequestOptionFunc) ([]*UserMembership, *Response, error) { u := fmt.Sprintf("users/%d/memberships", user) req, err := s.client.NewRequest(http.MethodGet, u, opt, options) @@ -1572,11 +1600,7 @@ func (s *UsersService) GetUserMemberships(user int, opt *GetUserMembershipOption return m, resp, nil } -// DisableTwoFactor disables two factor authentication for the specified user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/users/#disable-two-factor-authentication-for-a-user -func (s *UsersService) DisableTwoFactor(user int, options ...RequestOptionFunc) error { +func (s *UsersService) DisableTwoFactor(user int64, options ...RequestOptionFunc) error { u := fmt.Sprintf("users/%d/disable_two_factor", user) req, err := s.client.NewRequest(http.MethodPatch, u, nil, options) @@ -1608,7 +1632,7 @@ func (s *UsersService) DisableTwoFactor(user int, options ...RequestOptionFunc) // GitLab API docs: // https://docs.gitlab.com/api/users/#create-a-runner-linked-to-a-user type UserRunner struct { - ID int `json:"id"` + ID int64 `json:"id"` Token string `json:"token"` TokenExpiresAt *time.Time `json:"token_expires_at"` } @@ -1619,22 +1643,18 @@ type UserRunner struct { // https://docs.gitlab.com/api/users/#create-a-runner-linked-to-a-user type CreateUserRunnerOptions struct { RunnerType *string `url:"runner_type,omitempty" json:"runner_type,omitempty"` - GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"` - ProjectID *int `url:"project_id,omitempty" json:"project_id,omitempty"` + GroupID *int64 `url:"group_id,omitempty" json:"group_id,omitempty"` + ProjectID *int64 `url:"project_id,omitempty" json:"project_id,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"` Paused *bool `url:"paused,omitempty" json:"paused,omitempty"` Locked *bool `url:"locked,omitempty" json:"locked,omitempty"` RunUntagged *bool `url:"run_untagged,omitempty" json:"run_untagged,omitempty"` TagList *[]string `url:"tag_list,omitempty" json:"tag_list,omitempty"` AccessLevel *string `url:"access_level,omitempty" json:"access_level,omitempty"` - MaximumTimeout *int `url:"maximum_timeout,omitempty" json:"maximum_timeout,omitempty"` + MaximumTimeout *int64 `url:"maximum_timeout,omitempty" json:"maximum_timeout,omitempty"` MaintenanceNote *string `url:"maintenance_note,omitempty" json:"maintenance_note,omitempty"` } -// CreateUserRunner creates a runner linked to the current user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/users/#create-a-runner-linked-to-a-user func (s *UsersService) CreateUserRunner(opts *CreateUserRunnerOptions, options ...RequestOptionFunc) (*UserRunner, *Response, error) { req, err := s.client.NewRequest(http.MethodPost, "user/runners", opts, options) if err != nil { @@ -1660,10 +1680,6 @@ type CreateServiceAccountUserOptions struct { Email *string `url:"email,omitempty" json:"email,omitempty"` } -// CreateServiceAccountUser creates a new service account user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_service_accounts/#create-a-service-account-user func (s *UsersService) CreateServiceAccountUser(opts *CreateServiceAccountUserOptions, options ...RequestOptionFunc) (*User, *Response, error) { req, err := s.client.NewRequest(http.MethodPost, "service_accounts", opts, options) if err != nil { @@ -1679,10 +1695,6 @@ func (s *UsersService) CreateServiceAccountUser(opts *CreateServiceAccountUserOp return usr, resp, nil } -// ListServiceAccounts lists all service accounts. -// -// GitLab API docs: -// https://docs.gitlab.com/api/user_service_accounts/#list-all-service-account-users func (s *UsersService) ListServiceAccounts(opt *ListServiceAccountsOptions, options ...RequestOptionFunc) ([]*ServiceAccount, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "service_accounts", opt, options) if err != nil { @@ -1698,10 +1710,6 @@ func (s *UsersService) ListServiceAccounts(opt *ListServiceAccountsOptions, opti return sas, resp, nil } -// UploadAvatar uploads an avatar to the current user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/users/#upload-an-avatar-for-yourself func (s *UsersService) UploadAvatar(avatar io.Reader, filename string, options ...RequestOptionFunc) (*User, *Response, error) { u := "user/avatar" @@ -1727,12 +1735,7 @@ func (s *UsersService) UploadAvatar(avatar io.Reader, filename string, options . return usr, resp, nil } -// DeleteUserIdentity deletes a user's authentication identity using the provider -// name associated with that identity. Only available for administrators. -// -// GitLab API docs: -// https://docs.gitlab.com/api/users/#delete-authentication-identity-from-a-user -func (s *UsersService) DeleteUserIdentity(user int, provider string, options ...RequestOptionFunc) (*Response, error) { +func (s *UsersService) DeleteUserIdentity(user int64, provider string, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("users/%d/identities/%s", user, provider) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/validate.go b/vendor/gitlab.com/gitlab-org/api/client-go/validate.go index 9b05ad4ab..ee1906b36 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/validate.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/validate.go @@ -23,7 +23,15 @@ import ( type ( ValidateServiceInterface interface { + // ProjectNamespaceLint validates .gitlab-ci.yml content by project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/lint/#validate-sample-cicd-configuration ProjectNamespaceLint(pid any, opt *ProjectNamespaceLintOptions, options ...RequestOptionFunc) (*ProjectLintResult, *Response, error) + // ProjectLint validates .gitlab-ci.yml content by project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/lint/#validate-a-projects-cicd-configuration ProjectLint(pid any, opt *ProjectLintOptions, options ...RequestOptionFunc) (*ProjectLintResult, *Response, error) } @@ -86,10 +94,6 @@ type ProjectNamespaceLintOptions struct { Ref *string `url:"ref,omitempty" json:"ref,omitempty"` } -// ProjectNamespaceLint validates .gitlab-ci.yml content by project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/lint/#validate-sample-cicd-configuration func (s *ValidateService) ProjectNamespaceLint(pid any, opt *ProjectNamespaceLintOptions, options ...RequestOptionFunc) (*ProjectLintResult, *Response, error) { project, err := parseID(pid) if err != nil { @@ -123,10 +127,6 @@ type ProjectLintOptions struct { Ref *string `url:"ref,omitempty" json:"ref,omitempty"` } -// ProjectLint validates .gitlab-ci.yml content by project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/lint/#validate-a-projects-cicd-configuration func (s *ValidateService) ProjectLint(pid any, opt *ProjectLintOptions, options ...RequestOptionFunc) (*ProjectLintResult, *Response, error) { project, err := parseID(pid) if err != nil { diff --git a/vendor/gitlab.com/gitlab-org/api/client-go/wikis.go b/vendor/gitlab.com/gitlab-org/api/client-go/wikis.go index 1c14f4210..63faccdf5 100644 --- a/vendor/gitlab.com/gitlab-org/api/client-go/wikis.go +++ b/vendor/gitlab.com/gitlab-org/api/client-go/wikis.go @@ -24,11 +24,38 @@ import ( type ( WikisServiceInterface interface { + // ListWikis lists all pages of the wiki of the given project id. + // When with_content is set, it also returns the content of the pages. + // + // GitLab API docs: + // https://docs.gitlab.com/api/wikis/#list-wiki-pages ListWikis(pid any, opt *ListWikisOptions, options ...RequestOptionFunc) ([]*Wiki, *Response, error) + // GetWikiPage gets a wiki page for a given project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/wikis/#get-a-wiki-page GetWikiPage(pid any, slug string, opt *GetWikiPageOptions, options ...RequestOptionFunc) (*Wiki, *Response, error) + // CreateWikiPage creates a new wiki page for the given repository with + // the given title, slug, and content. + // + // GitLab API docs: + // https://docs.gitlab.com/api/wikis/#create-a-new-wiki-page CreateWikiPage(pid any, opt *CreateWikiPageOptions, options ...RequestOptionFunc) (*Wiki, *Response, error) + // EditWikiPage Updates an existing wiki page. At least one parameter is + // required to update the wiki page. + // + // GitLab API docs: + // https://docs.gitlab.com/api/wikis/#edit-an-existing-wiki-page EditWikiPage(pid any, slug string, opt *EditWikiPageOptions, options ...RequestOptionFunc) (*Wiki, *Response, error) + // DeleteWikiPage deletes a wiki page with a given slug. + // + // GitLab API docs: + // https://docs.gitlab.com/api/wikis/#delete-a-wiki-page DeleteWikiPage(pid any, slug string, options ...RequestOptionFunc) (*Response, error) + // UploadWikiAttachment uploads a file to the attachment folder inside the wiki’s repository. The attachment folder is the uploads folder. + // + // GitLab API docs: + // https://docs.gitlab.com/api/wikis/#upload-an-attachment-to-the-wiki-repository UploadWikiAttachment(pid any, content io.Reader, filename string, opt *UploadWikiAttachmentOptions, options ...RequestOptionFunc) (*WikiAttachment, *Response, error) } @@ -92,11 +119,6 @@ type ListWikisOptions struct { WithContent *bool `url:"with_content,omitempty" json:"with_content,omitempty"` } -// ListWikis lists all pages of the wiki of the given project id. -// When with_content is set, it also returns the content of the pages. -// -// GitLab API docs: -// https://docs.gitlab.com/api/wikis/#list-wiki-pages func (s *WikisService) ListWikis(pid any, opt *ListWikisOptions, options ...RequestOptionFunc) ([]*Wiki, *Response, error) { project, err := parseID(pid) if err != nil { @@ -127,10 +149,6 @@ type GetWikiPageOptions struct { Version *string `url:"version,omitempty" json:"version,omitempty"` } -// GetWikiPage gets a wiki page for a given project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/wikis/#get-a-wiki-page func (s *WikisService) GetWikiPage(pid any, slug string, opt *GetWikiPageOptions, options ...RequestOptionFunc) (*Wiki, *Response, error) { project, err := parseID(pid) if err != nil { @@ -162,11 +180,6 @@ type CreateWikiPageOptions struct { Format *WikiFormatValue `url:"format,omitempty" json:"format,omitempty"` } -// CreateWikiPage creates a new wiki page for the given repository with -// the given title, slug, and content. -// -// GitLab API docs: -// https://docs.gitlab.com/api/wikis/#create-a-new-wiki-page func (s *WikisService) CreateWikiPage(pid any, opt *CreateWikiPageOptions, options ...RequestOptionFunc) (*Wiki, *Response, error) { project, err := parseID(pid) if err != nil { @@ -198,11 +211,6 @@ type EditWikiPageOptions struct { Format *WikiFormatValue `url:"format,omitempty" json:"format,omitempty"` } -// EditWikiPage Updates an existing wiki page. At least one parameter is -// required to update the wiki page. -// -// GitLab API docs: -// https://docs.gitlab.com/api/wikis/#edit-an-existing-wiki-page func (s *WikisService) EditWikiPage(pid any, slug string, opt *EditWikiPageOptions, options ...RequestOptionFunc) (*Wiki, *Response, error) { project, err := parseID(pid) if err != nil { @@ -224,10 +232,6 @@ func (s *WikisService) EditWikiPage(pid any, slug string, opt *EditWikiPageOptio return w, resp, nil } -// DeleteWikiPage deletes a wiki page with a given slug. -// -// GitLab API docs: -// https://docs.gitlab.com/api/wikis/#delete-a-wiki-page func (s *WikisService) DeleteWikiPage(pid any, slug string, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -251,10 +255,6 @@ type UploadWikiAttachmentOptions struct { Branch *string `url:"branch,omitempty" json:"branch,omitempty"` } -// UploadWikiAttachment uploads a file to the attachment folder inside the wiki’s repository. The attachment folder is the uploads folder. -// -// GitLab API docs: -// https://docs.gitlab.com/api/wikis/#upload-an-attachment-to-the-wiki-repository func (s *WikisService) UploadWikiAttachment(pid any, content io.Reader, filename string, opt *UploadWikiAttachmentOptions, options ...RequestOptionFunc) (*WikiAttachment, *Response, error) { project, err := parseID(pid) if err != nil { diff --git a/vendor/golang.org/x/exp/constraints/constraints.go b/vendor/golang.org/x/exp/constraints/constraints.go deleted file mode 100644 index 9d260bab1..000000000 --- a/vendor/golang.org/x/exp/constraints/constraints.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package constraints defines a set of useful constraints to be used -// with type parameters. -package constraints - -import "cmp" - -// Signed is a constraint that permits any signed integer type. -// If future releases of Go add new predeclared signed integer types, -// this constraint will be modified to include them. -type Signed interface { - ~int | ~int8 | ~int16 | ~int32 | ~int64 -} - -// Unsigned is a constraint that permits any unsigned integer type. -// If future releases of Go add new predeclared unsigned integer types, -// this constraint will be modified to include them. -type Unsigned interface { - ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr -} - -// Integer is a constraint that permits any integer type. -// If future releases of Go add new predeclared integer types, -// this constraint will be modified to include them. -type Integer interface { - Signed | Unsigned -} - -// Float is a constraint that permits any floating-point type. -// If future releases of Go add new predeclared floating-point types, -// this constraint will be modified to include them. -type Float interface { - ~float32 | ~float64 -} - -// Complex is a constraint that permits any complex numeric type. -// If future releases of Go add new predeclared complex numeric types, -// this constraint will be modified to include them. -type Complex interface { - ~complex64 | ~complex128 -} - -// Ordered is a constraint that permits any ordered type: any type -// that supports the operators < <= >= >. -// If future releases of Go add new ordered types, -// this constraint will be modified to include them. -// -// This type is redundant since Go 1.21 introduced [cmp.Ordered]. -// -//go:fix inline -type Ordered = cmp.Ordered diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go index 2f45dbc86..f69fd7546 100644 --- a/vendor/golang.org/x/sync/errgroup/errgroup.go +++ b/vendor/golang.org/x/sync/errgroup/errgroup.go @@ -144,8 +144,8 @@ func (g *Group) SetLimit(n int) { g.sem = nil return } - if len(g.sem) != 0 { - panic(fmt.Errorf("errgroup: modify limit while %v goroutines in the group are still active", len(g.sem))) + if active := len(g.sem); active != 0 { + panic(fmt.Errorf("errgroup: modify limit while %v goroutines in the group are still active", active)) } g.sem = make(chan token, n) } diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 42517077c..fd39be4ef 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -256,6 +256,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -613,7 +614,7 @@ ccflags="$@" $2 !~ /IOC_MAGIC/ && $2 ~ /^[A-Z][A-Z0-9_]+_MAGIC2?$/ || $2 ~ /^(VM|VMADDR)_/ || - $2 ~ /^IOCTL_VM_SOCKETS_/ || + $2 ~ /^(IOCTL_VM_SOCKETS_|IOCTL_MEI_)/ || $2 ~ /^(TASKSTATS|TS)_/ || $2 ~ /^CGROUPSTATS_/ || $2 ~ /^GENL_/ || diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index d0a75da57..120a7b35d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -1615,6 +1615,8 @@ const ( IN_OPEN = 0x20 IN_Q_OVERFLOW = 0x4000 IN_UNMOUNT = 0x2000 + IOCTL_MEI_CONNECT_CLIENT = 0xc0104801 + IOCTL_MEI_CONNECT_CLIENT_VTAG = 0xc0144804 IPPROTO_AH = 0x33 IPPROTO_BEETPH = 0x5e IPPROTO_COMP = 0x6c diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 1c37f9fbc..97a61fc5b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -116,6 +116,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 6f54d34ae..a0d6d498c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -116,6 +116,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 783ec5c12..dd9c903f9 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index ca83d3ba1..384c61ca3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -120,6 +120,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 607e611c0..6384c9831 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -116,6 +116,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index b9cb5bd3c..553c1c6f1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 65b078a63..b3339f209 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 5298a3033..177091d2b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 7bc557c87..c5abf156d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index 152399bb0..f1f3fadf5 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x400 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 1a1ce2409..203ad9c54 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x400 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 4231a1fb5..4b9abcb21 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x400 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 21c0e9526..f87983037 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index f00d1cd7c..64347eb35 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index bc8d539e6..7d7191171 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -119,6 +119,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x400000 IN_NONBLOCK = 0x4000 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go index 439548ec9..50e8e6449 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go @@ -104,7 +104,7 @@ type Statvfs_t struct { Fsid uint32 Namemax uint32 Owner uint32 - Spare [4]uint32 + Spare [4]uint64 Fstypename [32]byte Mntonname [1024]byte Mntfromname [1024]byte diff --git a/vendor/golang.org/x/text/encoding/japanese/eucjp.go b/vendor/golang.org/x/text/encoding/japanese/eucjp.go index 79313fa58..6fce8c5f5 100644 --- a/vendor/golang.org/x/text/encoding/japanese/eucjp.go +++ b/vendor/golang.org/x/text/encoding/japanese/eucjp.go @@ -17,9 +17,9 @@ import ( var EUCJP encoding.Encoding = &eucJP var eucJP = internal.Encoding{ - &internal.SimpleEncoding{eucJPDecoder{}, eucJPEncoder{}}, - "EUC-JP", - identifier.EUCPkdFmtJapanese, + Encoding: &internal.SimpleEncoding{Decoder: eucJPDecoder{}, Encoder: eucJPEncoder{}}, + Name: "EUC-JP", + MIB: identifier.EUCPkdFmtJapanese, } type eucJPDecoder struct{ transform.NopResetter } diff --git a/vendor/golang.org/x/text/encoding/japanese/iso2022jp.go b/vendor/golang.org/x/text/encoding/japanese/iso2022jp.go index 613226df5..6f7bd460a 100644 --- a/vendor/golang.org/x/text/encoding/japanese/iso2022jp.go +++ b/vendor/golang.org/x/text/encoding/japanese/iso2022jp.go @@ -17,9 +17,9 @@ import ( var ISO2022JP encoding.Encoding = &iso2022JP var iso2022JP = internal.Encoding{ - internal.FuncEncoding{iso2022JPNewDecoder, iso2022JPNewEncoder}, - "ISO-2022-JP", - identifier.ISO2022JP, + Encoding: internal.FuncEncoding{Decoder: iso2022JPNewDecoder, Encoder: iso2022JPNewEncoder}, + Name: "ISO-2022-JP", + MIB: identifier.ISO2022JP, } func iso2022JPNewDecoder() transform.Transformer { diff --git a/vendor/golang.org/x/text/encoding/japanese/shiftjis.go b/vendor/golang.org/x/text/encoding/japanese/shiftjis.go index 16fd8a6e3..af65d43d9 100644 --- a/vendor/golang.org/x/text/encoding/japanese/shiftjis.go +++ b/vendor/golang.org/x/text/encoding/japanese/shiftjis.go @@ -18,9 +18,9 @@ import ( var ShiftJIS encoding.Encoding = &shiftJIS var shiftJIS = internal.Encoding{ - &internal.SimpleEncoding{shiftJISDecoder{}, shiftJISEncoder{}}, - "Shift JIS", - identifier.ShiftJIS, + Encoding: &internal.SimpleEncoding{Decoder: shiftJISDecoder{}, Encoder: shiftJISEncoder{}}, + Name: "Shift JIS", + MIB: identifier.ShiftJIS, } type shiftJISDecoder struct{ transform.NopResetter } diff --git a/vendor/golang.org/x/text/encoding/korean/euckr.go b/vendor/golang.org/x/text/encoding/korean/euckr.go index 034337f5d..81c834730 100644 --- a/vendor/golang.org/x/text/encoding/korean/euckr.go +++ b/vendor/golang.org/x/text/encoding/korean/euckr.go @@ -20,9 +20,9 @@ var All = []encoding.Encoding{EUCKR} var EUCKR encoding.Encoding = &eucKR var eucKR = internal.Encoding{ - &internal.SimpleEncoding{eucKRDecoder{}, eucKREncoder{}}, - "EUC-KR", - identifier.EUCKR, + Encoding: &internal.SimpleEncoding{Decoder: eucKRDecoder{}, Encoder: eucKREncoder{}}, + Name: "EUC-KR", + MIB: identifier.EUCKR, } type eucKRDecoder struct{ transform.NopResetter } diff --git a/vendor/golang.org/x/text/encoding/simplifiedchinese/gbk.go b/vendor/golang.org/x/text/encoding/simplifiedchinese/gbk.go index 0e0fabfd6..2f2fd5d44 100644 --- a/vendor/golang.org/x/text/encoding/simplifiedchinese/gbk.go +++ b/vendor/golang.org/x/text/encoding/simplifiedchinese/gbk.go @@ -22,21 +22,21 @@ var ( ) var gbk = internal.Encoding{ - &internal.SimpleEncoding{ - gbkDecoder{gb18030: false}, - gbkEncoder{gb18030: false}, + Encoding: &internal.SimpleEncoding{ + Decoder: gbkDecoder{gb18030: false}, + Encoder: gbkEncoder{gb18030: false}, }, - "GBK", - identifier.GBK, + Name: "GBK", + MIB: identifier.GBK, } var gbk18030 = internal.Encoding{ - &internal.SimpleEncoding{ - gbkDecoder{gb18030: true}, - gbkEncoder{gb18030: true}, + Encoding: &internal.SimpleEncoding{ + Decoder: gbkDecoder{gb18030: true}, + Encoder: gbkEncoder{gb18030: true}, }, - "GB18030", - identifier.GB18030, + Name: "GB18030", + MIB: identifier.GB18030, } type gbkDecoder struct { diff --git a/vendor/golang.org/x/text/encoding/simplifiedchinese/hzgb2312.go b/vendor/golang.org/x/text/encoding/simplifiedchinese/hzgb2312.go index e15b7bf6a..351750e60 100644 --- a/vendor/golang.org/x/text/encoding/simplifiedchinese/hzgb2312.go +++ b/vendor/golang.org/x/text/encoding/simplifiedchinese/hzgb2312.go @@ -17,9 +17,9 @@ import ( var HZGB2312 encoding.Encoding = &hzGB2312 var hzGB2312 = internal.Encoding{ - internal.FuncEncoding{hzGB2312NewDecoder, hzGB2312NewEncoder}, - "HZ-GB2312", - identifier.HZGB2312, + Encoding: internal.FuncEncoding{Decoder: hzGB2312NewDecoder, Encoder: hzGB2312NewEncoder}, + Name: "HZ-GB2312", + MIB: identifier.HZGB2312, } func hzGB2312NewDecoder() transform.Transformer { diff --git a/vendor/golang.org/x/text/encoding/traditionalchinese/big5.go b/vendor/golang.org/x/text/encoding/traditionalchinese/big5.go index 1fcddde08..5046920ee 100644 --- a/vendor/golang.org/x/text/encoding/traditionalchinese/big5.go +++ b/vendor/golang.org/x/text/encoding/traditionalchinese/big5.go @@ -20,9 +20,9 @@ var All = []encoding.Encoding{Big5} var Big5 encoding.Encoding = &big5 var big5 = internal.Encoding{ - &internal.SimpleEncoding{big5Decoder{}, big5Encoder{}}, - "Big5", - identifier.Big5, + Encoding: &internal.SimpleEncoding{Decoder: big5Decoder{}, Encoder: big5Encoder{}}, + Name: "Big5", + MIB: identifier.Big5, } type big5Decoder struct{ transform.NopResetter } diff --git a/vendor/golang.org/x/text/encoding/unicode/unicode.go b/vendor/golang.org/x/text/encoding/unicode/unicode.go index dd99ad14d..ce28c9062 100644 --- a/vendor/golang.org/x/text/encoding/unicode/unicode.go +++ b/vendor/golang.org/x/text/encoding/unicode/unicode.go @@ -60,9 +60,9 @@ func (utf8bomEncoding) NewDecoder() *encoding.Decoder { } var utf8enc = &internal.Encoding{ - &internal.SimpleEncoding{utf8Decoder{}, runes.ReplaceIllFormed()}, - "UTF-8", - identifier.UTF8, + Encoding: &internal.SimpleEncoding{Decoder: utf8Decoder{}, Encoder: runes.ReplaceIllFormed()}, + Name: "UTF-8", + MIB: identifier.UTF8, } type utf8bomDecoder struct { diff --git a/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go b/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go index 669133d04..c96e44834 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go @@ -32,7 +32,7 @@ var byteType = reflect.TypeOf(byte(0)) func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescriptors) protoreflect.FieldDescriptor { f := new(filedesc.Field) f.L0.ParentFile = filedesc.SurrogateProto2 - f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures + packed := false for len(tag) > 0 { i := strings.IndexByte(tag, ',') if i < 0 { @@ -108,7 +108,7 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri f.L1.StringName.InitJSON(jsonName) } case s == "packed": - f.L1.EditionFeatures.IsPacked = true + packed = true case strings.HasPrefix(s, "def="): // The default tag is special in that everything afterwards is the // default regardless of the presence of commas. @@ -121,6 +121,13 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri tag = strings.TrimPrefix(tag[i:], ",") } + // Update EditionFeatures after the loop and after we know whether this is + // a proto2 or proto3 field. + f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures + if packed { + f.L1.EditionFeatures.IsPacked = true + } + // The generator uses the group message name instead of the field name. // We obtain the real field name by lowercasing the group name. if f.L1.Kind == protoreflect.GroupKind { diff --git a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go index 099b2bf45..9aa7a9bb7 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go @@ -424,27 +424,34 @@ func (d *Decoder) parseFieldName() (tok Token, err error) { return Token{}, d.newSyntaxError("invalid field name: %s", errId(d.in)) } -// parseTypeName parses Any type URL or extension field name. The name is -// enclosed in [ and ] characters. The C++ parser does not handle many legal URL -// strings. This implementation is more liberal and allows for the pattern -// ^[-_a-zA-Z0-9]+([./][-_a-zA-Z0-9]+)*`). Whitespaces and comments are allowed -// in between [ ], '.', '/' and the sub names. +// parseTypeName parses an Any type URL or an extension field name. The name is +// enclosed in [ and ] characters. We allow almost arbitrary type URL prefixes, +// closely following the text-format spec [1,2]. We implement "ExtensionName | +// AnyName" as follows (with some exceptions for backwards compatibility): +// +// char = [-_a-zA-Z0-9] +// url_char = char | [.~!$&'()*+,;=] | "%", hex, hex +// +// Ident = char, { char } +// TypeName = Ident, { ".", Ident } ; +// UrlPrefix = url_char, { url_char | "/" } ; +// ExtensionName = "[", TypeName, "]" ; +// AnyName = "[", UrlPrefix, "/", TypeName, "]" ; +// +// Additionally, we allow arbitrary whitespace and comments between [ and ]. +// +// [1] https://protobuf.dev/reference/protobuf/textformat-spec/#characters +// [2] https://protobuf.dev/reference/protobuf/textformat-spec/#field-names func (d *Decoder) parseTypeName() (Token, error) { - startPos := len(d.orig) - len(d.in) // Use alias s to advance first in order to use d.in for error handling. - // Caller already checks for [ as first character. + // Caller already checks for [ as first character (d.in[0] == '['). s := consume(d.in[1:], 0) if len(s) == 0 { return Token{}, ErrUnexpectedEOF } + // Collect everything between [ and ] in name. var name []byte - for len(s) > 0 && isTypeNameChar(s[0]) { - name = append(name, s[0]) - s = s[1:] - } - s = consume(s, 0) - var closed bool for len(s) > 0 && !closed { switch { @@ -452,23 +459,20 @@ func (d *Decoder) parseTypeName() (Token, error) { s = s[1:] closed = true - case s[0] == '/', s[0] == '.': - if len(name) > 0 && (name[len(name)-1] == '/' || name[len(name)-1] == '.') { - return Token{}, d.newSyntaxError("invalid type URL/extension field name: %s", - d.orig[startPos:len(d.orig)-len(s)+1]) - } + case s[0] == '/' || isTypeNameChar(s[0]) || isUrlExtraChar(s[0]): name = append(name, s[0]) - s = s[1:] - s = consume(s, 0) - for len(s) > 0 && isTypeNameChar(s[0]) { - name = append(name, s[0]) - s = s[1:] + s = consume(s[1:], 0) + + // URL percent-encoded chars + case s[0] == '%': + if len(s) < 3 || !isHexChar(s[1]) || !isHexChar(s[2]) { + return Token{}, d.parseTypeNameError(s, 3) } - s = consume(s, 0) + name = append(name, s[0], s[1], s[2]) + s = consume(s[3:], 0) default: - return Token{}, d.newSyntaxError( - "invalid type URL/extension field name: %s", d.orig[startPos:len(d.orig)-len(s)+1]) + return Token{}, d.parseTypeNameError(s, 1) } } @@ -476,15 +480,38 @@ func (d *Decoder) parseTypeName() (Token, error) { return Token{}, ErrUnexpectedEOF } - // First character cannot be '.'. Last character cannot be '.' or '/'. - size := len(name) - if size == 0 || name[0] == '.' || name[size-1] == '.' || name[size-1] == '/' { - return Token{}, d.newSyntaxError("invalid type URL/extension field name: %s", - d.orig[startPos:len(d.orig)-len(s)]) + // Split collected name on last '/' into urlPrefix and typeName (if '/' is + // present). + typeName := name + if i := bytes.LastIndexByte(name, '/'); i != -1 { + urlPrefix := name[:i] + typeName = name[i+1:] + + // urlPrefix may be empty (for backwards compatibility). + // If non-empty, it must not start with '/'. + if len(urlPrefix) > 0 && urlPrefix[0] == '/' { + return Token{}, d.parseTypeNameError(s, 0) + } } + // typeName must not be empty (note: "" splits to [""]) and all identifier + // parts must not be empty. + for _, ident := range bytes.Split(typeName, []byte{'.'}) { + if len(ident) == 0 { + return Token{}, d.parseTypeNameError(s, 0) + } + } + + // typeName must not contain any percent-encoded or special URL chars. + for _, b := range typeName { + if b == '%' || (b != '.' && isUrlExtraChar(b)) { + return Token{}, d.parseTypeNameError(s, 0) + } + } + + startPos := len(d.orig) - len(d.in) + endPos := len(d.orig) - len(s) d.in = s - endPos := len(d.orig) - len(d.in) d.consume(0) return Token{ @@ -496,16 +523,32 @@ func (d *Decoder) parseTypeName() (Token, error) { }, nil } +func (d *Decoder) parseTypeNameError(s []byte, numUnconsumedChars int) error { + return d.newSyntaxError( + "invalid type URL/extension field name: %s", + d.in[:len(d.in)-len(s)+min(numUnconsumedChars, len(s))], + ) +} + +func isHexChar(b byte) bool { + return ('0' <= b && b <= '9') || + ('a' <= b && b <= 'f') || + ('A' <= b && b <= 'F') +} + func isTypeNameChar(b byte) bool { - return (b == '-' || b == '_' || + return b == '-' || b == '_' || ('0' <= b && b <= '9') || ('a' <= b && b <= 'z') || - ('A' <= b && b <= 'Z')) + ('A' <= b && b <= 'Z') } -func isWhiteSpace(b byte) bool { +// isUrlExtraChar complements isTypeNameChar with extra characters that we allow +// in URLs but not in type names. Note that '/' is not included so that it can +// be treated specially. +func isUrlExtraChar(b byte) bool { switch b { - case ' ', '\n', '\r', '\t': + case '.', '~', '!', '$', '&', '(', ')', '*', '+', ',', ';', '=': return true default: return false diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go index dbcf90b87..c775e5832 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go @@ -32,6 +32,7 @@ const ( EditionProto3 Edition = 999 Edition2023 Edition = 1000 Edition2024 Edition = 1001 + EditionUnstable Edition = 9999 EditionUnsupported Edition = 100000 ) diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go index dd31faaeb..78f02b1b4 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go @@ -330,7 +330,6 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) { md.L1.Extensions.List[extensionIdx].unmarshalFull(v, sb) extensionIdx++ case genid.DescriptorProto_Options_field_number: - md.unmarshalOptions(v) rawOptions = appendOptions(rawOptions, v) } default: @@ -356,27 +355,6 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) { md.L2.Options = md.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Message, rawOptions) } -func (md *Message) unmarshalOptions(b []byte) { - for len(b) > 0 { - num, typ, n := protowire.ConsumeTag(b) - b = b[n:] - switch typ { - case protowire.VarintType: - v, m := protowire.ConsumeVarint(b) - b = b[m:] - switch num { - case genid.MessageOptions_MapEntry_field_number: - md.L1.IsMapEntry = protowire.DecodeBool(v) - case genid.MessageOptions_MessageSetWireFormat_field_number: - md.L1.IsMessageSet = protowire.DecodeBool(v) - } - default: - m := protowire.ConsumeFieldValue(num, typ, b) - b = b[m:] - } - } -} - func unmarshalMessageReservedRange(b []byte) (r [2]protoreflect.FieldNumber) { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) diff --git a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go index 950a6a325..65aaf4d21 100644 --- a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +++ b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go @@ -26,6 +26,7 @@ const ( Edition_EDITION_PROTO3_enum_value = 999 Edition_EDITION_2023_enum_value = 1000 Edition_EDITION_2024_enum_value = 1001 + Edition_EDITION_UNSTABLE_enum_value = 9999 Edition_EDITION_1_TEST_ONLY_enum_value = 1 Edition_EDITION_2_TEST_ONLY_enum_value = 2 Edition_EDITION_99997_TEST_ONLY_enum_value = 99997 diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_map.go b/vendor/google.golang.org/protobuf/internal/impl/codec_map.go index 229c69801..4a3bf393e 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_map.go @@ -113,6 +113,9 @@ func sizeMap(mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo, opts marshalO } func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { + if opts.depth--; opts.depth < 0 { + return out, errRecursionDepth + } if wtyp != protowire.BytesType { return out, errUnknown } @@ -170,6 +173,9 @@ func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo } func consumeMapOfMessage(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { + if opts.depth--; opts.depth < 0 { + return out, errRecursionDepth + } if wtyp != protowire.BytesType { return out, errUnknown } diff --git a/vendor/google.golang.org/protobuf/internal/impl/decode.go b/vendor/google.golang.org/protobuf/internal/impl/decode.go index e0dd21fa5..1228b5c8c 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/decode.go +++ b/vendor/google.golang.org/protobuf/internal/impl/decode.go @@ -102,8 +102,7 @@ var errUnknown = errors.New("unknown") func (mi *MessageInfo) unmarshalPointer(b []byte, p pointer, groupTag protowire.Number, opts unmarshalOptions) (out unmarshalOutput, err error) { mi.init() - opts.depth-- - if opts.depth < 0 { + if opts.depth--; opts.depth < 0 { return out, errRecursionDepth } if flags.ProtoLegacy && mi.isMessageSet { diff --git a/vendor/google.golang.org/protobuf/internal/impl/validate.go b/vendor/google.golang.org/protobuf/internal/impl/validate.go index 7b2995dde..99a1eb95f 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/validate.go +++ b/vendor/google.golang.org/protobuf/internal/impl/validate.go @@ -68,9 +68,13 @@ func Validate(mt protoreflect.MessageType, in protoiface.UnmarshalInput) (out pr if in.Resolver == nil { in.Resolver = protoregistry.GlobalTypes } + if in.Depth == 0 { + in.Depth = protowire.DefaultRecursionLimit + } o, st := mi.validate(in.Buf, 0, unmarshalOptions{ flags: in.Flags, resolver: in.Resolver, + depth: in.Depth, }) if o.initialized { out.Flags |= protoiface.UnmarshalInitialized @@ -257,6 +261,9 @@ func (mi *MessageInfo) validate(b []byte, groupTag protowire.Number, opts unmars states[0].typ = validationTypeGroup states[0].endGroup = groupTag } + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } initialized := true start := len(b) State: @@ -451,6 +458,13 @@ State: mi: vi.mi, tail: b, }) + if vi.typ == validationTypeMessage || + vi.typ == validationTypeGroup || + vi.typ == validationTypeMap { + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } + } b = v continue State case validationTypeRepeatedVarint: @@ -499,6 +513,9 @@ State: mi: vi.mi, endGroup: num, }) + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } continue State case flags.ProtoLegacy && vi.typ == validationTypeMessageSetItem: typeid, v, n, err := messageset.ConsumeFieldValue(b, false) @@ -521,6 +538,13 @@ State: mi: xvi.mi, tail: b[n:], }) + if xvi.typ == validationTypeMessage || + xvi.typ == validationTypeGroup || + xvi.typ == validationTypeMap { + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } + } b = v continue State } @@ -547,12 +571,14 @@ State: switch st.typ { case validationTypeMessage, validationTypeGroup: numRequiredFields = int(st.mi.numRequiredFields) + opts.depth++ case validationTypeMap: // If this is a map field with a message value that contains // required fields, require that the value be present. if st.mi != nil && st.mi.numRequiredFields > 0 { numRequiredFields = 1 } + opts.depth++ } // If there are more than 64 required fields, this check will // always fail and we will report that the message is potentially diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go index 77de0f238..763fd8284 100644 --- a/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/vendor/google.golang.org/protobuf/internal/version/version.go @@ -52,7 +52,7 @@ import ( const ( Major = 1 Minor = 36 - Patch = 10 + Patch = 11 PreRelease = "" ) diff --git a/vendor/google.golang.org/protobuf/proto/decode.go b/vendor/google.golang.org/protobuf/proto/decode.go index 4cbf1aeaf..889d8511d 100644 --- a/vendor/google.golang.org/protobuf/proto/decode.go +++ b/vendor/google.golang.org/protobuf/proto/decode.go @@ -121,9 +121,8 @@ func (o UnmarshalOptions) unmarshal(b []byte, m protoreflect.Message) (out proto out, err = methods.Unmarshal(in) } else { - o.RecursionLimit-- - if o.RecursionLimit < 0 { - return out, errors.New("exceeded max recursion depth") + if o.RecursionLimit--; o.RecursionLimit < 0 { + return out, errRecursionDepth } err = o.unmarshalMessageSlow(b, m) } @@ -220,6 +219,9 @@ func (o UnmarshalOptions) unmarshalSingular(b []byte, wtyp protowire.Type, m pro } func (o UnmarshalOptions) unmarshalMap(b []byte, wtyp protowire.Type, mapv protoreflect.Map, fd protoreflect.FieldDescriptor) (n int, err error) { + if o.RecursionLimit--; o.RecursionLimit < 0 { + return 0, errRecursionDepth + } if wtyp != protowire.BytesType { return 0, errUnknown } @@ -305,3 +307,5 @@ func (o UnmarshalOptions) unmarshalMap(b []byte, wtyp protowire.Type, mapv proto var errUnknown = errors.New("BUG: internal error (unknown)") var errDecode = errors.New("cannot parse invalid wire-format data") + +var errRecursionDepth = errors.New("exceeded maximum recursion depth") diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go index 9196288e4..40f17af4e 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go @@ -108,7 +108,9 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot if f.L1.Path == "" { return nil, errors.New("file path must be populated") } - if f.L1.Syntax == protoreflect.Editions && (fd.GetEdition() < editionssupport.Minimum || fd.GetEdition() > editionssupport.Maximum) { + if f.L1.Syntax == protoreflect.Editions && + (fd.GetEdition() < editionssupport.Minimum || fd.GetEdition() > editionssupport.Maximum) && + fd.GetEdition() != descriptorpb.Edition_EDITION_UNSTABLE { // Allow cmd/protoc-gen-go/testdata to use any edition for easier // testing of upcoming edition features. if !strings.HasPrefix(fd.GetName(), "cmd/protoc-gen-go/testdata/") { @@ -152,6 +154,7 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot imp := &f.L2.Imports[i] imps.importPublic(imp.Imports()) } + optionImps := importSet{f.Path(): true} if len(fd.GetOptionDependency()) > 0 { optionImports := make(filedesc.FileImports, len(fd.GetOptionDependency())) for i, path := range fd.GetOptionDependency() { @@ -165,10 +168,12 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot } imp.FileDescriptor = f - if imps[imp.Path()] { + if imps[imp.Path()] || optionImps[imp.Path()] { return nil, errors.New("already imported %q", path) } - imps[imp.Path()] = true + // This needs to be a separate map so that we don't recognize non-options + // symbols coming from option imports. + optionImps[imp.Path()] = true } f.L2.OptionImports = func() protoreflect.FileImports { return &optionImports diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go b/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go index 697a61b29..147b8c739 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go @@ -46,6 +46,8 @@ func toEditionProto(ed filedesc.Edition) descriptorpb.Edition { return descriptorpb.Edition_EDITION_2023 case filedesc.Edition2024: return descriptorpb.Edition_EDITION_2024 + case filedesc.EditionUnstable: + return descriptorpb.Edition_EDITION_UNSTABLE default: panic(fmt.Sprintf("unknown value for edition: %v", ed)) } @@ -58,7 +60,7 @@ func getFeatureSetFor(ed filedesc.Edition) *descriptorpb.FeatureSet { return def } edpb := toEditionProto(ed) - if defaults.GetMinimumEdition() > edpb || defaults.GetMaximumEdition() < edpb { + if (defaults.GetMinimumEdition() > edpb || defaults.GetMaximumEdition() < edpb) && edpb != descriptorpb.Edition_EDITION_UNSTABLE { // This should never happen protodesc.(FileOptions).New would fail when // initializing the file descriptor. // This most likely means the embedded defaults were not updated. diff --git a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go index 4eacb523c..0b23faa95 100644 --- a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +++ b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go @@ -69,6 +69,8 @@ const ( // comparison. Edition_EDITION_2023 Edition = 1000 Edition_EDITION_2024 Edition = 1001 + // A placeholder edition for developing and testing unscheduled features. + Edition_EDITION_UNSTABLE Edition = 9999 // Placeholder editions for testing feature resolution. These should not be // used or relied on outside of tests. Edition_EDITION_1_TEST_ONLY Edition = 1 @@ -91,6 +93,7 @@ var ( 999: "EDITION_PROTO3", 1000: "EDITION_2023", 1001: "EDITION_2024", + 9999: "EDITION_UNSTABLE", 1: "EDITION_1_TEST_ONLY", 2: "EDITION_2_TEST_ONLY", 99997: "EDITION_99997_TEST_ONLY", @@ -105,6 +108,7 @@ var ( "EDITION_PROTO3": 999, "EDITION_2023": 1000, "EDITION_2024": 1001, + "EDITION_UNSTABLE": 9999, "EDITION_1_TEST_ONLY": 1, "EDITION_2_TEST_ONLY": 2, "EDITION_99997_TEST_ONLY": 99997, @@ -4793,11 +4797,11 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x18EnumValueDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + "\x06number\x18\x02 \x01(\x05R\x06number\x12;\n" + - "\aoptions\x18\x03 \x01(\v2!.google.protobuf.EnumValueOptionsR\aoptions\"\xa7\x01\n" + + "\aoptions\x18\x03 \x01(\v2!.google.protobuf.EnumValueOptionsR\aoptions\"\xb5\x01\n" + "\x16ServiceDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12>\n" + "\x06method\x18\x02 \x03(\v2&.google.protobuf.MethodDescriptorProtoR\x06method\x129\n" + - "\aoptions\x18\x03 \x01(\v2\x1f.google.protobuf.ServiceOptionsR\aoptions\"\x89\x02\n" + + "\aoptions\x18\x03 \x01(\v2\x1f.google.protobuf.ServiceOptionsR\aoptionsJ\x04\b\x04\x10\x05R\x06stream\"\x89\x02\n" + "\x15MethodDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n" + "\n" + @@ -5033,14 +5037,15 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\bSemantic\x12\b\n" + "\x04NONE\x10\x00\x12\a\n" + "\x03SET\x10\x01\x12\t\n" + - "\x05ALIAS\x10\x02*\xa7\x02\n" + + "\x05ALIAS\x10\x02*\xbe\x02\n" + "\aEdition\x12\x13\n" + "\x0fEDITION_UNKNOWN\x10\x00\x12\x13\n" + "\x0eEDITION_LEGACY\x10\x84\a\x12\x13\n" + "\x0eEDITION_PROTO2\x10\xe6\a\x12\x13\n" + "\x0eEDITION_PROTO3\x10\xe7\a\x12\x11\n" + "\fEDITION_2023\x10\xe8\a\x12\x11\n" + - "\fEDITION_2024\x10\xe9\a\x12\x17\n" + + "\fEDITION_2024\x10\xe9\a\x12\x15\n" + + "\x10EDITION_UNSTABLE\x10\x8fN\x12\x17\n" + "\x13EDITION_1_TEST_ONLY\x10\x01\x12\x17\n" + "\x13EDITION_2_TEST_ONLY\x10\x02\x12\x1d\n" + "\x17EDITION_99997_TEST_ONLY\x10\x9d\x8d\x06\x12\x1d\n" + diff --git a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go index 06d584c14..484c21fd5 100644 --- a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go @@ -172,13 +172,14 @@ import ( // ) to obtain a formatter capable of generating timestamps in this format. type Timestamp struct { state protoimpl.MessageState `protogen:"open.v1"` - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. + // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must + // be between -315576000000 and 315576000000 inclusive (which corresponds to + // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 + // Non-negative fractions of a second at nanosecond resolution. This field is + // the nanosecond portion of the duration, not an alternative to seconds. + // Negative second values with fractions must still have non-negative nanos + // values that count forward in time. Must be between 0 and 999,999,999 // inclusive. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` unknownFields protoimpl.UnknownFields diff --git a/vendor/modules.txt b/vendor/modules.txt index 1cf19dc1e..c55fec93b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -226,8 +226,8 @@ github.com/google/go-github/scrape # github.com/google/go-github/v75 v75.0.0 ## explicit; go 1.24.0 github.com/google/go-github/v75/github -# github.com/google/go-querystring v1.1.0 -## explicit; go 1.10 +# github.com/google/go-querystring v1.2.0 +## explicit; go 1.13 github.com/google/go-querystring/query # github.com/google/uuid v1.6.0 ## explicit @@ -455,8 +455,8 @@ github.com/xlzd/gotp # github.com/yosida95/uritemplate/v3 v3.0.2 ## explicit; go 1.14 github.com/yosida95/uritemplate/v3 -# gitlab.com/gitlab-org/api/client-go v0.160.2 -## explicit; go 1.23.0 +# gitlab.com/gitlab-org/api/client-go v1.11.0 +## explicit; go 1.24.0 gitlab.com/gitlab-org/api/client-go # go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 ## explicit; go 1.23.0 @@ -488,7 +488,6 @@ golang.org/x/crypto/pbkdf2 golang.org/x/crypto/scrypt # golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 ## explicit; go 1.24.0 -golang.org/x/exp/constraints golang.org/x/exp/slices # golang.org/x/net v0.47.0 ## explicit; go 1.24.0 @@ -508,11 +507,11 @@ golang.org/x/net/websocket ## explicit; go 1.24.0 golang.org/x/oauth2 golang.org/x/oauth2/internal -# golang.org/x/sync v0.18.0 +# golang.org/x/sync v0.19.0 ## explicit; go 1.24.0 golang.org/x/sync/errgroup golang.org/x/sync/semaphore -# golang.org/x/sys v0.38.0 +# golang.org/x/sys v0.39.0 ## explicit; go 1.24.0 golang.org/x/sys/plan9 golang.org/x/sys/unix @@ -520,7 +519,7 @@ golang.org/x/sys/windows # golang.org/x/term v0.37.0 ## explicit; go 1.24.0 golang.org/x/term -# golang.org/x/text v0.31.0 +# golang.org/x/text v0.32.0 ## explicit; go 1.24.0 golang.org/x/text/encoding golang.org/x/text/encoding/charmap @@ -569,7 +568,7 @@ google.golang.org/grpc/internal google.golang.org/grpc/internal/status google.golang.org/grpc/serviceconfig google.golang.org/grpc/status -# google.golang.org/protobuf v1.36.10 +# google.golang.org/protobuf v1.36.11 ## explicit; go 1.23 google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext