From 190d5c78e48ac6711a54d0b01fefa7253420249d Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Mon, 8 Sep 2025 01:59:01 -0500 Subject: [PATCH 01/26] refactor!: Fix typos in struct names Changelog: Improvements --- group_labels.go | 10 +++++----- projects.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/group_labels.go b/group_labels.go index 7bd4d1df..0291d0ae 100644 --- a/group_labels.go +++ b/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. diff --git a/projects.go b/projects.go index 92423a2f..81674570 100644 --- a/projects.go +++ b/projects.go @@ -198,7 +198,7 @@ type Project struct { 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"` + 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"` @@ -598,7 +598,7 @@ 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"` + SharedVisibleOnly *bool `url:"shared_visible_only,omitempty" json:"shared_visible_only,omitempty"` SkipGroups *[]int `url:"skip_groups,omitempty" json:"skip_groups,omitempty"` WithShared *bool `url:"with_shared,omitempty" json:"with_shared,omitempty"` } @@ -946,7 +946,7 @@ type EditProjectOptions struct { 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"` -- GitLab From 60beef36d0f93a7dc66749f55d98defbc1b3fe28 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Mon, 8 Sep 2025 10:05:49 -0500 Subject: [PATCH 02/26] feat(ListOptions): Update ListOptions to use composition instead of aliasing BREAKING CHANGE: ListOptions implementation changed from aliasing to composition Changelog: Improvements --- access_requests.go | 4 +++- applications.go | 4 +++- award_emojis.go | 4 +++- award_emojis_test.go | 6 ++++-- boards.go | 8 ++++++-- broadcast_messages.go | 4 +++- ci_yml_templates.go | 4 +++- cluster_agents.go | 8 ++++++-- commits.go | 4 +++- container_registry.go | 22 ++++++++++++++++------ container_registry_test.go | 2 +- deploy_keys.go | 8 ++++++-- deploy_tokens.go | 8 ++++++-- discussions.go | 20 +++++++++++++++----- dockerfile_templates.go | 4 +++- error_tracking.go | 4 +++- error_tracking_test.go | 7 ++++++- freeze_periods.go | 4 +++- geo_nodes.go | 4 +++- geo_sites.go | 8 ++++++-- gitignore_templates.go | 4 +++- group_boards.go | 8 ++++++-- group_epic_boards.go | 4 +++- group_hooks.go | 4 +++- group_members.go | 4 +++- group_milestones.go | 12 +++++++++--- group_protected_environments.go | 4 +++- group_repository_storage_move.go | 4 +++- group_repository_storage_move_test.go | 14 ++++++++++++-- group_variables.go | 4 +++- instance_variables.go | 4 +++- issues.go | 8 ++++++-- issues_test.go | 12 ++++++++---- merge_requests.go | 16 ++++++++++++---- milestones.go | 8 ++++++-- packages.go | 4 +++- pages_domains.go | 4 +++- pipeline_schedules.go | 4 +++- pipeline_triggers.go | 4 +++- project_mirror.go | 4 +++- project_repository_storage_move.go | 4 +++- project_repository_storage_move_test.go | 14 ++++++++++++-- project_snippets.go | 4 +++- project_variables.go | 4 +++- projects.go | 8 ++++++-- protected_environments.go | 4 +++- protected_tags.go | 4 +++- releaselinks.go | 4 +++- secure_files.go | 4 +++- snippet_repository_storage_move.go | 4 +++- snippet_repository_storage_move_test.go | 14 ++++++++++++-- snippets.go | 8 ++++++-- snippets_test.go | 14 ++++++++++++-- testing/container_registry_mock.go | 6 +++--- users.go | 12 +++++++++--- 55 files changed, 284 insertions(+), 91 deletions(-) diff --git a/access_requests.go b/access_requests.go index 1c2ef31c..7768c1e4 100644 --- a/access_requests.go +++ b/access_requests.go @@ -64,7 +64,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 +} // ListProjectAccessRequests gets a list of access requests // viewable by the authenticated user. diff --git a/applications.go b/applications.go index 06dae54c..345caa96 100644 --- a/applications.go +++ b/applications.go @@ -80,7 +80,9 @@ func (s *ApplicationsService) CreateApplication(opt *CreateApplicationOptions, o // ListApplicationsOptions represents the available // ListApplications() options. -type ListApplicationsOptions ListOptions +type ListApplicationsOptions struct { + ListOptions +} // ListApplications get a list of administrables applications by the authenticated user // diff --git a/award_emojis.go b/award_emojis.go index 360a16f3..f6931bf0 100644 --- a/award_emojis.go +++ b/award_emojis.go @@ -92,7 +92,9 @@ const ( // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/ -type ListAwardEmojiOptions ListOptions +type ListAwardEmojiOptions struct { + ListOptions +} // ListMergeRequestAwardEmoji gets a list of all award emoji on the merge request. // diff --git a/award_emojis_test.go b/award_emojis_test.go index 10e3e8a8..3c48578e 100644 --- a/award_emojis_test.go +++ b/award_emojis_test.go @@ -1428,8 +1428,10 @@ func TestAwardEmojiService_Timeout(t *testing.T) { defer cancel() opt := &ListAwardEmojiOptions{ - Page: 1, - PerPage: 20, + ListOptions: ListOptions{ + Page: 1, + PerPage: 20, + }, } aes, resp, err := client.AwardEmoji.ListMergeRequestAwardEmoji(1, 80, opt, WithContext(ctx)) diff --git a/boards.go b/boards.go index 1d1558d0..b394ec8a 100644 --- a/boards.go +++ b/boards.go @@ -180,7 +180,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 +} // ListIssueBoards gets a list of all issue boards in a project. // @@ -233,7 +235,9 @@ 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 +} // GetIssueBoardLists gets a list of the issue board's lists. Does not include // backlog and closed lists. diff --git a/broadcast_messages.go b/broadcast_messages.go index 2e422008..92adf6df 100644 --- a/broadcast_messages.go +++ b/broadcast_messages.go @@ -65,7 +65,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 +} // ListBroadcastMessages gets a list of all broadcasted messages. // diff --git a/ci_yml_templates.go b/ci_yml_templates.go index 168ca1fc..430646ba 100644 --- a/ci_yml_templates.go +++ b/ci_yml_templates.go @@ -61,7 +61,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 +} // ListAllTemplates get all GitLab CI YML templates. // diff --git a/cluster_agents.go b/cluster_agents.go index 88855174..878a4033 100644 --- a/cluster_agents.go +++ b/cluster_agents.go @@ -94,7 +94,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 +} // ListAgents returns a list of agents registered for the project. // @@ -203,7 +205,9 @@ 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 +} // ListAgentTokens returns a list of tokens for an agent. // diff --git a/commits.go b/commits.go index c139bdf8..864595f9 100644 --- a/commits.go +++ b/commits.go @@ -348,7 +348,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 +} // GetCommitComments gets the comments of a commit in a project. // diff --git a/container_registry.go b/container_registry.go index 4e473ee0..945205ad 100644 --- a/container_registry.go +++ b/container_registry.go @@ -25,7 +25,7 @@ import ( type ( ContainerRegistryServiceInterface interface { ListProjectRegistryRepositories(pid any, opt *ListRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) - ListGroupRegistryRepositories(gid any, opt *ListRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) + ListGroupRegistryRepositories(gid any, opt *ListGroupRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) GetSingleRegistryRepository(pid any, opt *GetSingleRegistryRepositoryOptions, options ...RequestOptionFunc) (*RegistryRepository, *Response, error) DeleteRegistryRepository(pid any, repository int, options ...RequestOptionFunc) (*Response, error) ListRegistryRepositoryTags(pid any, repository int, opt *ListRegistryRepositoryTagsOptions, options ...RequestOptionFunc) ([]*RegistryRepositoryTag, *Response, error) @@ -84,18 +84,26 @@ func (s RegistryRepositoryTag) String() string { } // ListRegistryRepositoriesOptions represents the available -// ListRegistryRepositories() options. +// ListProjectRegistryRepositories() options. // // GitLab API docs: -// https://docs.gitlab.com/api/container_registry/#list-registry-repositories +// https://docs.gitlab.com/api/container_registry/#within-a-project type ListRegistryRepositoriesOptions 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"` } +// ListGroupRegistryRepositoriesOptions represents the available +// ListGroupRegistryRepositories() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/container_registry/#within-a-group +type ListGroupRegistryRepositoriesOptions struct { + ListOptions +} + // ListProjectRegistryRepositories gets a list of registry repositories in a project. // // GitLab API docs: @@ -125,7 +133,7 @@ func (s *ContainerRegistryService) ListProjectRegistryRepositories(pid any, opt // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#within-a-group -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) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -205,7 +213,9 @@ 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 +} // ListRegistryRepositoryTags gets a list of tags for given registry repository. // diff --git a/container_registry_test.go b/container_registry_test.go index b7b13623..a5a5ab1b 100644 --- a/container_registry_test.go +++ b/container_registry_test.go @@ -109,7 +109,7 @@ func TestListGroupRegistryRepositories(t *testing.T) { ]`) }) - repositories, _, err := client.ContainerRegistry.ListGroupRegistryRepositories(5, &ListRegistryRepositoriesOptions{}) + repositories, _, err := client.ContainerRegistry.ListGroupRegistryRepositories(5, &ListGroupRegistryRepositoriesOptions{}) if err != nil { t.Errorf("ContainerRegistry.ListGroupRegistryRepositories returned error: %v", err) } diff --git a/deploy_keys.go b/deploy_keys.go index 8f54a134..4047f1df 100644 --- a/deploy_keys.go +++ b/deploy_keys.go @@ -160,7 +160,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 +} // ListProjectDeployKeys gets a list of a project's deploy keys // @@ -192,7 +194,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 +} // ListUserProjectDeployKeys gets a list of a user's deploy keys // diff --git a/deploy_tokens.go b/deploy_tokens.go index f7128a69..ec95255a 100644 --- a/deploy_tokens.go +++ b/deploy_tokens.go @@ -84,7 +84,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 +} // ListProjectDeployTokens gets a list of a project's deploy tokens. // @@ -196,7 +198,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 +} // ListGroupDeployTokens gets a list of a group’s deploy tokens. // diff --git a/discussions.go b/discussions.go index f73a865a..04f39968 100644 --- a/discussions.go +++ b/discussions.go @@ -87,7 +87,9 @@ 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 +} // ListIssueDiscussions gets a list of all discussions for a single // issue. @@ -287,7 +289,9 @@ 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 +} // ListSnippetDiscussions gets a list of all discussions for a single // snippet. Snippet discussions are comments users can post to a snippet. @@ -489,7 +493,9 @@ 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 +} // ListGroupEpicDiscussions gets a list of all discussions for a single // epic. Epic discussions are comments users can post to a epic. @@ -696,7 +702,9 @@ 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 +} // ListMergeRequestDiscussions gets a list of all discussions for a single // merge request. @@ -980,7 +988,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 +} // ListCommitDiscussions gets a list of all discussions for a single // commit. diff --git a/dockerfile_templates.go b/dockerfile_templates.go index 0885b3b8..32446913 100644 --- a/dockerfile_templates.go +++ b/dockerfile_templates.go @@ -60,7 +60,9 @@ type DockerfileTemplateListItem struct { // // GitLab API docs: // https://docs.gitlab.com/api/templates/dockerfiles/#list-dockerfile-templates -type ListDockerfileTemplatesOptions ListOptions +type ListDockerfileTemplatesOptions struct { + ListOptions +} // ListTemplates get a list of available Dockerfile templates. // diff --git a/error_tracking.go b/error_tracking.go index 14de8ea8..22e5e231 100644 --- a/error_tracking.go +++ b/error_tracking.go @@ -137,7 +137,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 +} // ListClientKeys lists error tracking project client keys. // diff --git a/error_tracking_test.go b/error_tracking_test.go index 8866d184..bcdd0620 100644 --- a/error_tracking_test.go +++ b/error_tracking_test.go @@ -111,7 +111,12 @@ func TestListErrorTrackingClientKeys(t *testing.T) { ]`) }) - cks, _, err := client.ErrorTracking.ListClientKeys(1, &ListClientKeysOptions{Page: 1, PerPage: 10}) + cks, _, err := client.ErrorTracking.ListClientKeys(1, &ListClientKeysOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 10, + }, + }) if err != nil { t.Errorf("ErrorTracking.ListErrorTrackingClientKeys returned error: %v", err) } diff --git a/freeze_periods.go b/freeze_periods.go index 8662ac4d..ef599e87 100644 --- a/freeze_periods.go +++ b/freeze_periods.go @@ -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. // diff --git a/geo_nodes.go b/geo_nodes.go index 124cc831..5f635101 100644 --- a/geo_nodes.go +++ b/geo_nodes.go @@ -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 diff --git a/geo_sites.go b/geo_sites.go index bd0f9f2b..9b5cac3f 100644 --- a/geo_sites.go +++ b/geo_sites.go @@ -121,7 +121,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. // @@ -470,7 +472,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. // diff --git a/gitignore_templates.go b/gitignore_templates.go index 7ffbede5..31208cfc 100644 --- a/gitignore_templates.go +++ b/gitignore_templates.go @@ -60,7 +60,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/group_boards.go b/group_boards.go index c5d7e77d..855697b1 100644 --- a/group_boards.go +++ b/group_boards.go @@ -69,7 +69,9 @@ 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. // @@ -216,7 +218,9 @@ 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. diff --git a/group_epic_boards.go b/group_epic_boards.go index 23097312..679dae6a 100644 --- a/group_epic_boards.go +++ b/group_epic_boards.go @@ -60,7 +60,9 @@ 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. // diff --git a/group_hooks.go b/group_hooks.go index cd7117c8..b95b4990 100644 --- a/group_hooks.go +++ b/group_hooks.go @@ -63,7 +63,9 @@ type GroupHook struct { // // 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. // diff --git a/group_members.go b/group_members.go index 7ba88838..f0d445dd 100644 --- a/group_members.go +++ b/group_members.go @@ -275,7 +275,9 @@ 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. diff --git a/group_milestones.go b/group_milestones.go index 8ae487a1..15129e6f 100644 --- a/group_milestones.go +++ b/group_milestones.go @@ -235,7 +235,9 @@ 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. // @@ -267,7 +269,9 @@ 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. @@ -310,7 +314,9 @@ 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. diff --git a/group_protected_environments.go b/group_protected_environments.go index 21120116..ecf8874b 100644 --- a/group_protected_environments.go +++ b/group_protected_environments.go @@ -87,7 +87,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. diff --git a/group_repository_storage_move.go b/group_repository_storage_move.go index 01996cd0..7aa3f597 100644 --- a/group_repository_storage_move.go +++ b/group_repository_storage_move.go @@ -66,7 +66,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. diff --git a/group_repository_storage_move_test.go b/group_repository_storage_move_test.go index f907f1cb..3f4e310b 100644 --- a/group_repository_storage_move_test.go +++ b/group_repository_storage_move_test.go @@ -35,7 +35,12 @@ func TestGroupRepositoryStorageMove_RetrieveAllGroupStorageMoves(t *testing.T) { }]`) }) - opts := RetrieveAllGroupStorageMovesOptions{Page: 1, PerPage: 2} + opts := RetrieveAllGroupStorageMovesOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 2, + }, + } gsms, _, err := client.GroupRepositoryStorageMove.RetrieveAllStorageMoves(opts) require.NoError(t, err) @@ -90,7 +95,12 @@ func TestGroupRepositoryStorageMove_RetrieveAllStorageMovesForGroup(t *testing.T }]`) }) - opts := RetrieveAllGroupStorageMovesOptions{Page: 1, PerPage: 2} + opts := RetrieveAllGroupStorageMovesOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 2, + }, + } gsms, _, err := client.GroupRepositoryStorageMove.RetrieveAllStorageMovesForGroup(283, opts) require.NoError(t, err) diff --git a/group_variables.go b/group_variables.go index ae643a26..dee6eadd 100644 --- a/group_variables.go +++ b/group_variables.go @@ -69,7 +69,9 @@ 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. // diff --git a/instance_variables.go b/instance_variables.go index 235a333e..d5b6fd1b 100644 --- a/instance_variables.go +++ b/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/issues.go b/issues.go index cd2564e5..ef1e9116 100644 --- a/issues.go +++ b/issues.go @@ -757,7 +757,9 @@ 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. @@ -790,7 +792,9 @@ 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 diff --git a/issues_test.go b/issues_test.go index 7b75e164..9d7e92fb 100644 --- a/issues_test.go +++ b/issues_test.go @@ -820,8 +820,10 @@ func TestListMergeRequestsClosingIssue(t *testing.T) { }) listMergeRequestsClosingIssueOpt := &ListMergeRequestsClosingIssueOptions{ - Page: 1, - PerPage: 10, + ListOptions: ListOptions{ + Page: 1, + PerPage: 10, + }, } mergeRequest, _, err := client.Issues.ListMergeRequestsClosingIssue("1", 5, listMergeRequestsClosingIssueOpt) if err != nil { @@ -847,8 +849,10 @@ func TestListMergeRequestsRelatedToIssue(t *testing.T) { }) listMergeRequestsRelatedToIssueOpt := &ListMergeRequestsRelatedToIssueOptions{ - Page: 1, - PerPage: 10, + ListOptions: ListOptions{ + Page: 1, + PerPage: 10, + }, } mergeRequest, _, err := client.Issues.ListMergeRequestsRelatedToIssue("1", 5, listMergeRequestsRelatedToIssueOpt) if err != nil { diff --git a/merge_requests.go b/merge_requests.go index 33048676..6f6cc016 100644 --- a/merge_requests.go +++ b/merge_requests.go @@ -494,7 +494,9 @@ 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. // @@ -748,7 +750,9 @@ 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. @@ -780,7 +784,9 @@ func (s *MergeRequestsService) GetIssuesClosedOnMerge(pid any, mergeRequest int, // // 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. // @@ -1033,7 +1039,9 @@ 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. // diff --git a/milestones.go b/milestones.go index 3bcf0657..3e4380bb 100644 --- a/milestones.go +++ b/milestones.go @@ -228,7 +228,9 @@ 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. // @@ -260,7 +262,9 @@ 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. diff --git a/packages.go b/packages.go index f9f3b59a..83a8e3ba 100644 --- a/packages.go +++ b/packages.go @@ -203,7 +203,9 @@ 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 // diff --git a/pages_domains.go b/pages_domains.go index de18e483..15a85dc7 100644 --- a/pages_domains.go +++ b/pages_domains.go @@ -67,7 +67,9 @@ type PagesDomain struct { // // 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/pipeline_schedules.go b/pipeline_schedules.go index 2e2f156d..fc50ed84 100644 --- a/pipeline_schedules.go +++ b/pipeline_schedules.go @@ -142,7 +142,9 @@ 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. diff --git a/pipeline_triggers.go b/pipeline_triggers.go index deff0c89..f441a6ef 100644 --- a/pipeline_triggers.go +++ b/pipeline_triggers.go @@ -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. // diff --git a/project_mirror.go b/project_mirror.go index c8ef6097..3c242206 100644 --- a/project_mirror.go +++ b/project_mirror.go @@ -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. // diff --git a/project_repository_storage_move.go b/project_repository_storage_move.go index fe23dfbc..f69169c6 100644 --- a/project_repository_storage_move.go +++ b/project_repository_storage_move.go @@ -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. diff --git a/project_repository_storage_move_test.go b/project_repository_storage_move_test.go index 5929dac9..78400b5f 100644 --- a/project_repository_storage_move_test.go +++ b/project_repository_storage_move_test.go @@ -33,7 +33,12 @@ func TestProjectRepositoryStorageMove_RetrieveAllProjectStorageMoves(t *testing. }]`) }) - opts := RetrieveAllProjectStorageMovesOptions{Page: 1, PerPage: 2} + opts := RetrieveAllProjectStorageMovesOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 2, + }, + } ssms, _, err := client.ProjectRepositoryStorageMove.RetrieveAllStorageMoves(opts) require.NoError(t, err) @@ -84,7 +89,12 @@ func TestProjectRepositoryStorageMove_RetrieveAllStorageMovesForProject(t *testi }]`) }) - opts := RetrieveAllProjectStorageMovesOptions{Page: 1, PerPage: 2} + opts := RetrieveAllProjectStorageMovesOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 2, + }, + } ssms, _, err := client.ProjectRepositoryStorageMove.RetrieveAllStorageMovesForProject(1, opts) require.NoError(t, err) diff --git a/project_snippets.go b/project_snippets.go index 61c7e59e..15e351f6 100644 --- a/project_snippets.go +++ b/project_snippets.go @@ -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. // diff --git a/project_variables.go b/project_variables.go index 870837ec..af3ce2ff 100644 --- a/project_variables.go +++ b/project_variables.go @@ -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/projects.go b/projects.go index 81674570..b5e6fe90 100644 --- a/projects.go +++ b/projects.go @@ -1425,7 +1425,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. // @@ -2115,7 +2117,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. // diff --git a/protected_environments.go b/protected_environments.go index 17a440d1..c5e7ba60 100644 --- a/protected_environments.go +++ b/protected_environments.go @@ -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. diff --git a/protected_tags.go b/protected_tags.go index 2d776eed..035260f5 100644 --- a/protected_tags.go +++ b/protected_tags.go @@ -67,7 +67,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. // diff --git a/releaselinks.go b/releaselinks.go index 804e1ae5..35698043 100644 --- a/releaselinks.go +++ b/releaselinks.go @@ -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. // diff --git a/secure_files.go b/secure_files.go index 13fc386c..bf1f1089 100644 --- a/secure_files.go +++ b/secure_files.go @@ -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. // diff --git a/snippet_repository_storage_move.go b/snippet_repository_storage_move.go index b25c3a48..911584d5 100644 --- a/snippet_repository_storage_move.go +++ b/snippet_repository_storage_move.go @@ -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. diff --git a/snippet_repository_storage_move_test.go b/snippet_repository_storage_move_test.go index ec59b757..b663d4f5 100644 --- a/snippet_repository_storage_move_test.go +++ b/snippet_repository_storage_move_test.go @@ -33,7 +33,12 @@ func TestSnippetRepositoryStorageMove_RetrieveAllSnippetStorageMoves(t *testing. }]`) }) - opts := RetrieveAllSnippetStorageMovesOptions{Page: 1, PerPage: 2} + opts := RetrieveAllSnippetStorageMovesOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 2, + }, + } ssms, _, err := client.SnippetRepositoryStorageMove.RetrieveAllStorageMoves(opts) require.NoError(t, err) @@ -84,7 +89,12 @@ func TestSnippetRepositoryStorageMove_RetrieveAllStorageMovesForSnippet(t *testi }]`) }) - opts := RetrieveAllSnippetStorageMovesOptions{Page: 1, PerPage: 2} + opts := RetrieveAllSnippetStorageMovesOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 2, + }, + } ssms, _, err := client.SnippetRepositoryStorageMove.RetrieveAllStorageMovesForSnippet(65, opts) require.NoError(t, err) diff --git a/snippets.go b/snippets.go index d3bdad82..5a02926e 100644 --- a/snippets.go +++ b/snippets.go @@ -84,7 +84,9 @@ func (s Snippet) String() string { // // 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. // @@ -278,7 +280,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/snippets_test.go b/snippets_test.go index 3de2745b..8a249f30 100644 --- a/snippets_test.go +++ b/snippets_test.go @@ -17,7 +17,12 @@ func TestSnippetsService_ListSnippets(t *testing.T) { fmt.Fprint(w, `[{"id":42,"title":"test"}]`) }) - opt := &ListSnippetsOptions{Page: 1, PerPage: 10} + opt := &ListSnippetsOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 10, + }, + } ss, _, err := client.Snippets.ListSnippets(opt) require.NoError(t, err) @@ -128,7 +133,12 @@ func TestSnippetsService_ExploreSnippets(t *testing.T) { fmt.Fprint(w, `[{"id":42,"title":"test"}]`) }) - opt := &ExploreSnippetsOptions{Page: 1, PerPage: 10} + opt := &ExploreSnippetsOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 10, + }, + } ss, _, err := client.Snippets.ExploreSnippets(opt) require.NoError(t, err) diff --git a/testing/container_registry_mock.go b/testing/container_registry_mock.go index 518a75b4..226a0ac9 100644 --- a/testing/container_registry_mock.go +++ b/testing/container_registry_mock.go @@ -263,7 +263,7 @@ func (c *MockContainerRegistryServiceInterfaceGetSingleRegistryRepositoryCall) D } // ListGroupRegistryRepositories mocks base method. -func (m *MockContainerRegistryServiceInterface) ListGroupRegistryRepositories(gid any, opt *gitlab.ListRegistryRepositoriesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error) { +func (m *MockContainerRegistryServiceInterface) ListGroupRegistryRepositories(gid any, opt *gitlab.ListGroupRegistryRepositoriesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, opt} for _, a := range options { @@ -296,13 +296,13 @@ func (c *MockContainerRegistryServiceInterfaceListGroupRegistryRepositoriesCall) } // Do rewrite *gomock.Call.Do -func (c *MockContainerRegistryServiceInterfaceListGroupRegistryRepositoriesCall) Do(f func(any, *gitlab.ListRegistryRepositoriesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListGroupRegistryRepositoriesCall { +func (c *MockContainerRegistryServiceInterfaceListGroupRegistryRepositoriesCall) Do(f func(any, *gitlab.ListGroupRegistryRepositoriesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListGroupRegistryRepositoriesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockContainerRegistryServiceInterfaceListGroupRegistryRepositoriesCall) DoAndReturn(f func(any, *gitlab.ListRegistryRepositoriesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListGroupRegistryRepositoriesCall { +func (c *MockContainerRegistryServiceInterfaceListGroupRegistryRepositoriesCall) DoAndReturn(f func(any, *gitlab.ListGroupRegistryRepositoriesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListGroupRegistryRepositoriesCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/users.go b/users.go index 93c72216..997c7068 100644 --- a/users.go +++ b/users.go @@ -594,7 +594,9 @@ 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. // @@ -618,7 +620,9 @@ 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. // @@ -963,7 +967,9 @@ 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 From 6536d9e50e0917ce73e36be5ed94d9db01c4b141 Mon Sep 17 00:00:00 2001 From: Jose Gabriel Companioni Benitez Date: Sun, 14 Sep 2025 19:08:30 +0400 Subject: [PATCH 03/26] refactor!: standardize Go naming conventions for ID and URL fields Changelog: Improvements --- commits.go | 2 +- examples/bitbucket_import.go | 2 +- geo_nodes.go | 6 +++--- geo_nodes_test.go | 10 +++++----- import.go | 8 ++++---- import_test.go | 8 ++++---- tags.go | 2 +- tags_test.go | 2 +- testing/usage_data_mock.go | 10 +++++----- usage_data.go | 10 +++++----- usage_data_test.go | 2 +- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/commits.go b/commits.go index 864595f9..db110f85 100644 --- a/commits.go +++ b/commits.go @@ -442,7 +442,7 @@ type CommitStatus struct { Name string `json:"name"` AllowFailure bool `json:"allow_failure"` Coverage float64 `json:"coverage"` - PipelineId int `json:"pipeline_id"` + PipelineID int `json:"pipeline_id"` Author Author `json:"author"` Description string `json:"description"` TargetURL string `json:"target_url"` diff --git a/examples/bitbucket_import.go b/examples/bitbucket_import.go index 036d9a49..ce328d90 100644 --- a/examples/bitbucket_import.go +++ b/examples/bitbucket_import.go @@ -33,7 +33,7 @@ func bitbucketServerExample() { } serverOpt := &gitlab.ImportRepositoryFromBitbucketServerOptions{ - BitbucketServerUrl: gitlab.Ptr("https://bitbucket.example.com"), + BitbucketServerURL: gitlab.Ptr("https://bitbucket.example.com"), BitbucketServerUsername: gitlab.Ptr("username"), PersonalAccessToken: gitlab.Ptr("access-token"), BitbucketServerProject: gitlab.Ptr("some-project"), diff --git a/geo_nodes.go b/geo_nodes.go index 5f635101..a51d9681 100644 --- a/geo_nodes.go +++ b/geo_nodes.go @@ -72,7 +72,7 @@ type GeoNode struct { VerificationMaxCapacity int `json:"verification_max_capacity"` SelectiveSyncType string `json:"selective_sync_type"` SelectiveSyncShards []string `json:"selective_sync_shards"` - SelectiveSyncNamespaceIds []int `json:"selective_sync_namespace_ids"` + SelectiveSyncNamespaceIDs []int `json:"selective_sync_namespace_ids"` MinimumReverificationInterval int `json:"minimum_reverification_interval"` ContainerRepositoriesMaxCapacity int `json:"container_repositories_max_capacity"` SyncObjectStorage bool `json:"sync_object_storage"` @@ -110,7 +110,7 @@ type CreateGeoNodesOptions struct { 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"` + 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"` } @@ -203,7 +203,7 @@ type UpdateGeoNodesOptions struct { 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"` + 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"` } diff --git a/geo_nodes_test.go b/geo_nodes_test.go index 66acbe6f..d1dac714 100644 --- a/geo_nodes_test.go +++ b/geo_nodes_test.go @@ -57,7 +57,7 @@ func TestGeoNodesService_CreateGeoNode(t *testing.T) { VerificationMaxCapacity: 100, SelectiveSyncType: "namespaces", SelectiveSyncShards: nil, - SelectiveSyncNamespaceIds: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int{1, 25}, MinimumReverificationInterval: 7, ContainerRepositoriesMaxCapacity: 10, SyncObjectStorage: false, @@ -149,7 +149,7 @@ func TestGeoNodesService_ListGeoNodes(t *testing.T) { VerificationMaxCapacity: 100, SelectiveSyncType: "namespaces", SelectiveSyncShards: nil, - SelectiveSyncNamespaceIds: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int{1, 25}, MinimumReverificationInterval: 7, ContainerRepositoriesMaxCapacity: 10, SyncObjectStorage: false, @@ -239,7 +239,7 @@ func TestGeoNodesService_GetGeoNode(t *testing.T) { VerificationMaxCapacity: 100, SelectiveSyncType: "namespaces", SelectiveSyncShards: nil, - SelectiveSyncNamespaceIds: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int{1, 25}, MinimumReverificationInterval: 7, ContainerRepositoriesMaxCapacity: 10, SyncObjectStorage: false, @@ -318,7 +318,7 @@ func TestGeoNodesService_EditGeoNode(t *testing.T) { VerificationMaxCapacity: 100, SelectiveSyncType: "namespaces", SelectiveSyncShards: nil, - SelectiveSyncNamespaceIds: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int{1, 25}, MinimumReverificationInterval: 7, ContainerRepositoriesMaxCapacity: 10, SyncObjectStorage: false, @@ -418,7 +418,7 @@ func TestGeoNodesService_RepairGeoNode(t *testing.T) { VerificationMaxCapacity: 100, SelectiveSyncType: "namespaces", SelectiveSyncShards: nil, - SelectiveSyncNamespaceIds: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int{1, 25}, MinimumReverificationInterval: 7, ContainerRepositoriesMaxCapacity: 10, SyncObjectStorage: false, diff --git a/import.go b/import.go index 019c4b72..6ce73d78 100644 --- a/import.go +++ b/import.go @@ -50,7 +50,7 @@ type GitHubImport struct { 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"` @@ -181,7 +181,7 @@ type BitbucketServerImport struct { 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 { @@ -193,7 +193,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"` @@ -232,7 +232,7 @@ type BitbucketCloudImport struct { 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/import_test.go b/import_test.go index 22238f3c..a859f6b6 100644 --- a/import_test.go +++ b/import_test.go @@ -36,7 +36,7 @@ func TestImportService_ImportRepositoryFromGitHub(t *testing.T) { Name: "my-repo", FullPath: "/root/my-repo", FullName: "Administrator / my-repo", - RefsUrl: "/root/my-repo/refs", + RefsURL: "/root/my-repo/refs", ImportSource: "my-github/repo", ImportStatus: "scheduled", HumanImportStatusName: "scheduled", @@ -147,11 +147,11 @@ func TestImportService_ImportRepositoryFromBitbucketServer(t *testing.T) { Name: "my-repo", FullPath: "/root/my-repo", FullName: "Administrator / my-repo", - RefsUrl: "/root/my-repo/refs", + RefsURL: "/root/my-repo/refs", } opt := &ImportRepositoryFromBitbucketServerOptions{ - BitbucketServerUrl: Ptr("https://bitbucket.example.com"), + BitbucketServerURL: Ptr("https://bitbucket.example.com"), BitbucketServerUsername: Ptr("username"), PersonalAccessToken: Ptr("token"), BitbucketServerProject: Ptr("root"), @@ -200,7 +200,7 @@ func TestImportService_ImportRepositoryFromBitbucketCloud(t *testing.T) { Name: "my-repo", FullPath: "/root/my-repo", FullName: "Administrator / my-repo", - RefsUrl: "/root/my-repo/refs", + RefsURL: "/root/my-repo/refs", ImportSource: "my-bitbucket/repo", ImportStatus: "scheduled", HumanImportStatusName: "scheduled", diff --git a/tags.go b/tags.go index aec5f3d6..8a8c40c7 100644 --- a/tags.go +++ b/tags.go @@ -80,7 +80,7 @@ type X509Issuer struct { ID int `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/tags_test.go b/tags_test.go index d2f4df04..bbfdef8e 100644 --- a/tags_test.go +++ b/tags_test.go @@ -257,7 +257,7 @@ func TestTagsService_GetTagSignature(t *testing.T) { ID: 1, Subject: "CN=PKI,OU=Example,O=World", SubjectKeyIdentifier: "AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB", - CrlUrl: "http://example.com/pki.crl", + CrlURL: "http://example.com/pki.crl", }, }, } diff --git a/testing/usage_data_mock.go b/testing/usage_data_mock.go index a54f637a..480ca72d 100644 --- a/testing/usage_data_mock.go +++ b/testing/usage_data_mock.go @@ -86,14 +86,14 @@ func (c *MockUsageDataServiceInterfaceGetMetricDefinitionsAsYAMLCall) DoAndRetur } // GetNonSQLMetrics mocks base method. -func (m *MockUsageDataServiceInterface) GetNonSQLMetrics(options ...gitlab.RequestOptionFunc) (*gitlab.ServicePingNonSqlMetrics, *gitlab.Response, error) { +func (m *MockUsageDataServiceInterface) GetNonSQLMetrics(options ...gitlab.RequestOptionFunc) (*gitlab.ServicePingNonSQLMetrics, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{} for _, a := range options { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "GetNonSQLMetrics", varargs...) - ret0, _ := ret[0].(*gitlab.ServicePingNonSqlMetrics) + ret0, _ := ret[0].(*gitlab.ServicePingNonSQLMetrics) ret1, _ := ret[1].(*gitlab.Response) ret2, _ := ret[2].(error) return ret0, ret1, ret2 @@ -112,19 +112,19 @@ type MockUsageDataServiceInterfaceGetNonSQLMetricsCall struct { } // Return rewrite *gomock.Call.Return -func (c *MockUsageDataServiceInterfaceGetNonSQLMetricsCall) Return(arg0 *gitlab.ServicePingNonSqlMetrics, arg1 *gitlab.Response, arg2 error) *MockUsageDataServiceInterfaceGetNonSQLMetricsCall { +func (c *MockUsageDataServiceInterfaceGetNonSQLMetricsCall) Return(arg0 *gitlab.ServicePingNonSQLMetrics, arg1 *gitlab.Response, arg2 error) *MockUsageDataServiceInterfaceGetNonSQLMetricsCall { c.Call = c.Call.Return(arg0, arg1, arg2) return c } // Do rewrite *gomock.Call.Do -func (c *MockUsageDataServiceInterfaceGetNonSQLMetricsCall) Do(f func(...gitlab.RequestOptionFunc) (*gitlab.ServicePingNonSqlMetrics, *gitlab.Response, error)) *MockUsageDataServiceInterfaceGetNonSQLMetricsCall { +func (c *MockUsageDataServiceInterfaceGetNonSQLMetricsCall) Do(f func(...gitlab.RequestOptionFunc) (*gitlab.ServicePingNonSQLMetrics, *gitlab.Response, error)) *MockUsageDataServiceInterfaceGetNonSQLMetricsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsageDataServiceInterfaceGetNonSQLMetricsCall) DoAndReturn(f func(...gitlab.RequestOptionFunc) (*gitlab.ServicePingNonSqlMetrics, *gitlab.Response, error)) *MockUsageDataServiceInterfaceGetNonSQLMetricsCall { +func (c *MockUsageDataServiceInterfaceGetNonSQLMetricsCall) DoAndReturn(f func(...gitlab.RequestOptionFunc) (*gitlab.ServicePingNonSQLMetrics, *gitlab.Response, error)) *MockUsageDataServiceInterfaceGetNonSQLMetricsCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/usage_data.go b/usage_data.go index 788522a6..aaf587a2 100644 --- a/usage_data.go +++ b/usage_data.go @@ -12,7 +12,7 @@ type ( GetServicePing(options ...RequestOptionFunc) (*ServicePingData, *Response, error) GetMetricDefinitionsAsYAML(options ...RequestOptionFunc) (io.Reader, *Response, error) GetQueries(options ...RequestOptionFunc) (*ServicePingQueries, *Response, error) - GetNonSQLMetrics(options ...RequestOptionFunc) (*ServicePingNonSqlMetrics, *Response, error) + GetNonSQLMetrics(options ...RequestOptionFunc) (*ServicePingNonSQLMetrics, *Response, error) TrackEvent(opt *TrackEventOptions, options ...RequestOptionFunc) (*Response, error) TrackEvents(opt *TrackEventsOptions, options ...RequestOptionFunc) (*Response, error) } @@ -118,8 +118,8 @@ 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"` @@ -147,13 +147,13 @@ type ServicePingNonSqlMetrics struct { // // 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 diff --git a/usage_data_test.go b/usage_data_test.go index e140f556..dcdd5539 100644 --- a/usage_data_test.go +++ b/usage_data_test.go @@ -202,7 +202,7 @@ func TestUsageDataService_GetServicePingNonSqlMetrics(t *testing.T) { nsm, _, err := client.UsageData.GetNonSQLMetrics() require.NoError(t, err) - want := &ServicePingNonSqlMetrics{ + want := &ServicePingNonSQLMetrics{ RecordedAt: "2021-03-26T07:04:03.724Z", UUID: "", Hostname: "localhost", -- GitLab From ef1b300d970a45b4d06d78971c5bc0ae8e423d97 Mon Sep 17 00:00:00 2001 From: Jose Gabriel Companioni Benitez Date: Mon, 15 Sep 2025 12:44:25 +0400 Subject: [PATCH 04/26] refactor!: updated name of ListRegistryRepositoriesOptions Changelog: Improvements --- container_registry.go | 10 +++++----- container_registry_test.go | 2 +- testing/container_registry_mock.go | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/container_registry.go b/container_registry.go index 945205ad..0044e160 100644 --- a/container_registry.go +++ b/container_registry.go @@ -24,7 +24,7 @@ import ( type ( ContainerRegistryServiceInterface interface { - ListProjectRegistryRepositories(pid any, opt *ListRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) + ListProjectRegistryRepositories(pid any, opt *ListProjectRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) ListGroupRegistryRepositories(gid any, opt *ListGroupRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) GetSingleRegistryRepository(pid any, opt *GetSingleRegistryRepositoryOptions, options ...RequestOptionFunc) (*RegistryRepository, *Response, error) DeleteRegistryRepository(pid any, repository int, options ...RequestOptionFunc) (*Response, error) @@ -83,12 +83,12 @@ func (s RegistryRepositoryTag) String() string { return Stringify(s) } -// ListRegistryRepositoriesOptions represents the available +// ListProjectRegistryRepositoriesOptions represents the available // ListProjectRegistryRepositories() options. // // GitLab API docs: -// https://docs.gitlab.com/api/container_registry/#within-a-project -type ListRegistryRepositoriesOptions struct { +// https://docs.gitlab.com/api/container_registry/#list-registry-repositories +type ListProjectRegistryRepositoriesOptions struct { ListOptions Tags *bool `url:"tags,omitempty" json:"tags,omitempty"` @@ -108,7 +108,7 @@ type ListGroupRegistryRepositoriesOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#within-a-project -func (s *ContainerRegistryService) ListProjectRegistryRepositories(pid any, opt *ListRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) { +func (s *ContainerRegistryService) ListProjectRegistryRepositories(pid any, opt *ListProjectRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/container_registry_test.go b/container_registry_test.go index a5a5ab1b..5587c22e 100644 --- a/container_registry_test.go +++ b/container_registry_test.go @@ -51,7 +51,7 @@ func TestListProjectRegistryRepositories(t *testing.T) { ]`) }) - repositories, _, err := client.ContainerRegistry.ListProjectRegistryRepositories(5, &ListRegistryRepositoriesOptions{}) + repositories, _, err := client.ContainerRegistry.ListProjectRegistryRepositories(5, &ListProjectRegistryRepositoriesOptions{}) if err != nil { t.Errorf("ContainerRegistry.ListProjectRegistryRepositories returned error: %v", err) } diff --git a/testing/container_registry_mock.go b/testing/container_registry_mock.go index 226a0ac9..88be1e18 100644 --- a/testing/container_registry_mock.go +++ b/testing/container_registry_mock.go @@ -308,7 +308,7 @@ func (c *MockContainerRegistryServiceInterfaceListGroupRegistryRepositoriesCall) } // ListProjectRegistryRepositories mocks base method. -func (m *MockContainerRegistryServiceInterface) ListProjectRegistryRepositories(pid any, opt *gitlab.ListRegistryRepositoriesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error) { +func (m *MockContainerRegistryServiceInterface) ListProjectRegistryRepositories(pid any, opt *gitlab.ListProjectRegistryRepositoriesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, opt} for _, a := range options { @@ -341,13 +341,13 @@ func (c *MockContainerRegistryServiceInterfaceListProjectRegistryRepositoriesCal } // Do rewrite *gomock.Call.Do -func (c *MockContainerRegistryServiceInterfaceListProjectRegistryRepositoriesCall) Do(f func(any, *gitlab.ListRegistryRepositoriesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListProjectRegistryRepositoriesCall { +func (c *MockContainerRegistryServiceInterfaceListProjectRegistryRepositoriesCall) Do(f func(any, *gitlab.ListProjectRegistryRepositoriesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListProjectRegistryRepositoriesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockContainerRegistryServiceInterfaceListProjectRegistryRepositoriesCall) DoAndReturn(f func(any, *gitlab.ListRegistryRepositoriesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListProjectRegistryRepositoriesCall { +func (c *MockContainerRegistryServiceInterfaceListProjectRegistryRepositoriesCall) DoAndReturn(f func(any, *gitlab.ListProjectRegistryRepositoriesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepository, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListProjectRegistryRepositoriesCall { c.Call = c.Call.DoAndReturn(f) return c } -- GitLab From 39b1fb8dc10785f9ee319b41b695098546921266 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Fri, 22 Aug 2025 01:33:29 +0000 Subject: [PATCH 05/26] chore(deps): update dependency go to v1.25.0 --- .gitlab-ci.yml | 3 +-- .tool-versions | 2 +- go.mod | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c51a1368..3b0d7857 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,8 +43,8 @@ stages: parallel: matrix: - GOLANG_IMAGE_VERSION: - - '1.23' - '1.24' + - '1.25' .go:base: extends: @@ -150,7 +150,6 @@ commitlint: tests:unit: extends: - - .go:base - .go:versions stage: test needs: [] diff --git a/.tool-versions b/.tool-versions index 379a7c13..65cd4353 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,4 +1,4 @@ -golang 1.23 +golang 1.24 golangci-lint 2.3.1 gofumpt 0.8.0 buf 1.55.1 diff --git a/go.mod b/go.mod index e04e024e..83567c41 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module gitlab.com/gitlab-org/api/client-go -go 1.23.0 - -toolchain go1.23.8 +go 1.24 require ( buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.9-20250912141014-52f32327d4b0.1 -- GitLab From 637688bbb55247df61a437a5265a4142f5af4d1e Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Fri, 22 Aug 2025 01:51:20 +0000 Subject: [PATCH 06/26] chore(deps): update dependency gotestsum to v1.12.3 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b0d7857..fe124c6e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -156,7 +156,7 @@ tests:unit: image: golang:$GOLANG_IMAGE_VERSION variables: # configure tooling versions - GOTESTSUM_VERSION: 'v1.12.0' + GOTESTSUM_VERSION: 'v1.12.3' GOCOVER_COBERTURA_VERSION: 'v1.2.1-0.20240107185409-0818f3538137' # configure artifact files -- GitLab From 4aca2475119735097dc065f4e02bf784a7a7e9ee Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Mon, 15 Sep 2025 23:55:56 +0000 Subject: [PATCH 07/26] chore(deps): update dependency gotestsum to v1.13.0 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe124c6e..6dd1eab3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -156,7 +156,7 @@ tests:unit: image: golang:$GOLANG_IMAGE_VERSION variables: # configure tooling versions - GOTESTSUM_VERSION: 'v1.12.3' + GOTESTSUM_VERSION: 'v1.13.0' GOCOVER_COBERTURA_VERSION: 'v1.2.1-0.20240107185409-0818f3538137' # configure artifact files -- GitLab From f6f9dfadbb2884199df47b09063de0c7a2a42c27 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Tue, 16 Sep 2025 00:03:12 +0000 Subject: [PATCH 08/26] chore(deps): Update gocover-cobertura --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6dd1eab3..470a7862 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -157,7 +157,7 @@ tests:unit: variables: # configure tooling versions GOTESTSUM_VERSION: 'v1.13.0' - GOCOVER_COBERTURA_VERSION: 'v1.2.1-0.20240107185409-0818f3538137' + GOCOVER_COBERTURA_VERSION: 'v1.4.0' # configure artifact files JUNIT_FILENAME: tests.xml -- GitLab From 447c4b3af93ede9389c52acd4c47eb82d44ca580 Mon Sep 17 00:00:00 2001 From: Jose Gabriel Companioni Benitez Date: Wed, 17 Sep 2025 11:57:22 +0400 Subject: [PATCH 09/26] refactor: decouple group and project request approval settings Changelog: Improvements --- merge_request_approval_settings.go | 29 ++++++++++++++----- merge_request_approval_settings_test.go | 5 ++-- .../merge_request_approval_settings_mock.go | 12 ++++---- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/merge_request_approval_settings.go b/merge_request_approval_settings.go index c1701be2..6d183a64 100644 --- a/merge_request_approval_settings.go +++ b/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/merge_request_approval_settings_test.go b/merge_request_approval_settings_test.go index cd154936..e2905009 100644 --- a/merge_request_approval_settings_test.go +++ b/merge_request_approval_settings_test.go @@ -183,12 +183,11 @@ func TestUpdateGroupMergeRequestApprovalSettings(t *testing.T) { }, } - settings, resp, err := client.MergeRequestApprovalSettings.UpdateGroupMergeRequestApprovalSettings(1, &UpdateMergeRequestApprovalSettingsOptions{ + settings, resp, err := client.MergeRequestApprovalSettings.UpdateGroupMergeRequestApprovalSettings(1, &UpdateGroupMergeRequestApprovalSettingsOptions{ AllowAuthorApproval: Ptr(false), AllowCommitterApproval: Ptr(false), AllowOverridesToApproverListPerMergeRequest: Ptr(false), RetainApprovalsOnPush: Ptr(true), - SelectiveCodeOwnerRemovals: Ptr(true), RequireReauthenticationToApprove: Ptr(true), }) assert.NoError(t, err) @@ -372,7 +371,7 @@ func TestUpdateProjectMergeRequestApprovalSettings(t *testing.T) { }, } - settings, resp, err := client.MergeRequestApprovalSettings.UpdateProjectMergeRequestApprovalSettings(1, &UpdateMergeRequestApprovalSettingsOptions{ + settings, resp, err := client.MergeRequestApprovalSettings.UpdateProjectMergeRequestApprovalSettings(1, &UpdateProjectMergeRequestApprovalSettingsOptions{ AllowAuthorApproval: Ptr(false), AllowCommitterApproval: Ptr(false), AllowOverridesToApproverListPerMergeRequest: Ptr(false), diff --git a/testing/merge_request_approval_settings_mock.go b/testing/merge_request_approval_settings_mock.go index 62faa029..12efeb52 100644 --- a/testing/merge_request_approval_settings_mock.go +++ b/testing/merge_request_approval_settings_mock.go @@ -131,7 +131,7 @@ func (c *MockMergeRequestApprovalSettingsServiceInterfaceGetProjectMergeRequestA } // UpdateGroupMergeRequestApprovalSettings mocks base method. -func (m *MockMergeRequestApprovalSettingsServiceInterface) UpdateGroupMergeRequestApprovalSettings(gid any, opt *gitlab.UpdateMergeRequestApprovalSettingsOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error) { +func (m *MockMergeRequestApprovalSettingsServiceInterface) UpdateGroupMergeRequestApprovalSettings(gid any, opt *gitlab.UpdateGroupMergeRequestApprovalSettingsOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, opt} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockMergeRequestApprovalSettingsServiceInterfaceUpdateGroupMergeRequest } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalSettingsServiceInterfaceUpdateGroupMergeRequestApprovalSettingsCall) Do(f func(any, *gitlab.UpdateMergeRequestApprovalSettingsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error)) *MockMergeRequestApprovalSettingsServiceInterfaceUpdateGroupMergeRequestApprovalSettingsCall { +func (c *MockMergeRequestApprovalSettingsServiceInterfaceUpdateGroupMergeRequestApprovalSettingsCall) Do(f func(any, *gitlab.UpdateGroupMergeRequestApprovalSettingsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error)) *MockMergeRequestApprovalSettingsServiceInterfaceUpdateGroupMergeRequestApprovalSettingsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalSettingsServiceInterfaceUpdateGroupMergeRequestApprovalSettingsCall) DoAndReturn(f func(any, *gitlab.UpdateMergeRequestApprovalSettingsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error)) *MockMergeRequestApprovalSettingsServiceInterfaceUpdateGroupMergeRequestApprovalSettingsCall { +func (c *MockMergeRequestApprovalSettingsServiceInterfaceUpdateGroupMergeRequestApprovalSettingsCall) DoAndReturn(f func(any, *gitlab.UpdateGroupMergeRequestApprovalSettingsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error)) *MockMergeRequestApprovalSettingsServiceInterfaceUpdateGroupMergeRequestApprovalSettingsCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateProjectMergeRequestApprovalSettings mocks base method. -func (m *MockMergeRequestApprovalSettingsServiceInterface) UpdateProjectMergeRequestApprovalSettings(pid any, opt *gitlab.UpdateMergeRequestApprovalSettingsOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error) { +func (m *MockMergeRequestApprovalSettingsServiceInterface) UpdateProjectMergeRequestApprovalSettings(pid any, opt *gitlab.UpdateProjectMergeRequestApprovalSettingsOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, opt} for _, a := range options { @@ -209,13 +209,13 @@ func (c *MockMergeRequestApprovalSettingsServiceInterfaceUpdateProjectMergeReque } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalSettingsServiceInterfaceUpdateProjectMergeRequestApprovalSettingsCall) Do(f func(any, *gitlab.UpdateMergeRequestApprovalSettingsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error)) *MockMergeRequestApprovalSettingsServiceInterfaceUpdateProjectMergeRequestApprovalSettingsCall { +func (c *MockMergeRequestApprovalSettingsServiceInterfaceUpdateProjectMergeRequestApprovalSettingsCall) Do(f func(any, *gitlab.UpdateProjectMergeRequestApprovalSettingsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error)) *MockMergeRequestApprovalSettingsServiceInterfaceUpdateProjectMergeRequestApprovalSettingsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalSettingsServiceInterfaceUpdateProjectMergeRequestApprovalSettingsCall) DoAndReturn(f func(any, *gitlab.UpdateMergeRequestApprovalSettingsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error)) *MockMergeRequestApprovalSettingsServiceInterfaceUpdateProjectMergeRequestApprovalSettingsCall { +func (c *MockMergeRequestApprovalSettingsServiceInterfaceUpdateProjectMergeRequestApprovalSettingsCall) DoAndReturn(f func(any, *gitlab.UpdateProjectMergeRequestApprovalSettingsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalSettings, *gitlab.Response, error)) *MockMergeRequestApprovalSettingsServiceInterfaceUpdateProjectMergeRequestApprovalSettingsCall { c.Call = c.Call.DoAndReturn(f) return c } -- GitLab From cd7dc6ac3a0a13749270273d41968687930a3978 Mon Sep 17 00:00:00 2001 From: Heidi Berry Date: Wed, 1 Oct 2025 20:31:23 +0100 Subject: [PATCH 10/26] refactor(no-release): refactor inline structs to reusable types Changelog: Improvements --- award_emojis.go | 13 +- award_emojis_test.go | 162 +-- boards.go | 56 +- deployments.go | 72 +- deployments_test.go | 137 +-- discussions_test.go | 572 ++------- event_parsing.go | 10 +- event_systemhook_types.go | 242 ++-- event_webhook_types.go | 2118 +++++++++++++++++---------------- events.go | 204 ++-- events_test.go | 46 +- generic_packages.go | 48 +- groups_test.go | 1 - import.go | 24 +- issues_statistics.go | 24 +- issues_statistics_test.go | 42 +- jobs.go | 108 +- jobs_test.go | 16 +- license.go | 66 +- license_test.go | 28 +- merge_request_approvals.go | 30 +- merge_requests.go | 56 +- metadata.go | 27 +- metadata_test.go | 7 +- notes.go | 66 +- notes_test.go | 10 +- pages_domains.go | 33 +- pages_domains_test.go | 41 +- pipelines.go | 37 +- project_import_export.go | 48 +- project_import_export_test.go | 5 +- project_snippets_test.go | 42 +- projects.go | 267 +++-- releases.go | 77 +- repository_files.go | 34 +- repository_files_test.go | 13 +- resource_label_events.go | 39 +- resource_label_events_test.go | 102 +- runners.go | 66 +- runners_test.go | 24 +- sidekiq_metrics.go | 56 +- sidekiq_metrics_test.go | 53 +- snippets.go | 64 +- 43 files changed, 2280 insertions(+), 2906 deletions(-) diff --git a/award_emojis.go b/award_emojis.go index f6931bf0..0ca78941 100644 --- a/award_emojis.go +++ b/award_emojis.go @@ -65,16 +65,9 @@ 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 int `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"` diff --git a/award_emojis_test.go b/award_emojis_test.go index 3c48578e..6d946098 100644 --- a/award_emojis_test.go +++ b/award_emojis_test.go @@ -39,14 +39,7 @@ func TestAwardEmojiService_ListMergeRequestAwardEmoji(t *testing.T) { want := []*AwardEmoji{{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -110,14 +103,7 @@ func TestAwardEmojiService_ListIssueAwardEmoji(t *testing.T) { want := []*AwardEmoji{{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -181,14 +167,7 @@ func TestAwardEmojiService_ListSnippetAwardEmoji(t *testing.T) { want := []*AwardEmoji{{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -250,14 +229,7 @@ func TestAwardEmojiService_GetMergeRequestAwardEmoji(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -319,14 +291,7 @@ func TestAwardEmojiService_GetIssueAwardEmoji(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -388,14 +353,7 @@ func TestAwardEmojiService_GetSnippetAwardEmoji(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -457,14 +415,7 @@ func TestAwardEmojiService_CreateMergeRequestAwardEmoji(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -526,14 +477,7 @@ func TestAwardEmojiService_CreateIssueAwardEmoji(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -595,14 +539,7 @@ func TestAwardEmojiService_CreateSnippetAwardEmoji(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -741,14 +678,7 @@ func TestAwardEmojiService_ListMergeRequestAwardEmojiOnNote(t *testing.T) { want := []*AwardEmoji{{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -812,14 +742,7 @@ func TestAwardEmojiService_ListIssuesAwardEmojiOnNote(t *testing.T) { want := []*AwardEmoji{{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -883,14 +806,7 @@ func TestAwardEmojiService_ListSnippetAwardEmojiOnNote(t *testing.T) { want := []*AwardEmoji{{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -952,14 +868,7 @@ func TestAwardEmojiService_GetMergeRequestAwardEmojiOnNote(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -1021,14 +930,7 @@ func TestAwardEmojiService_GetIssuesAwardEmojiOnNote(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -1090,14 +992,7 @@ func TestAwardEmojiService_GetSnippetAwardEmojiOnNote(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -1159,14 +1054,7 @@ func TestAwardEmojiService_CCreateMergeRequestAwardEmojiOnNote(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -1228,14 +1116,7 @@ func TestAwardEmojiService_CreateIssuesAwardEmojiOnNote(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -1297,14 +1178,7 @@ func TestAwardEmojiService_CreateSnippetAwardEmojiOnNote(t *testing.T) { want := &AwardEmoji{ ID: 4, Name: "1234", - 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"` - }{ + User: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, diff --git a/boards.go b/boards.go index b394ec8a..e88e72c4 100644 --- a/boards.go +++ b/boards.go @@ -50,21 +50,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 int `json:"id"` + Name string `json:"name"` + Project *Project `json:"project"` + Milestone *Milestone `json:"milestone"` + Assignee *BasicUser `json:"assignee"` + Lists []*BoardList `json:"lists"` + Weight int `json:"weight"` + Labels []*LabelDetails `json:"labels"` } func (b IssueBoard) String() string { @@ -75,24 +68,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 int `json:"id"` + Assignee *BoardListAssignee `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"` } 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 int `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 diff --git a/deployments.go b/deployments.go index 7368477c..0a602777 100644 --- a/deployments.go +++ b/deployments.go @@ -45,39 +45,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 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 DeploymentDeployable `json:"deployable"` +} + +// DeploymentDeployable represents the Gitlab deployment deployable +type DeploymentDeployable 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 DeploymentDeployablePipeline `json:"pipeline"` + Runner *Runner `json:"runner"` +} + +// DeploymentDeployablePipeline represents the Gitlab deployment deployable pipeline +type DeploymentDeployablePipeline 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"` } // ListProjectDeploymentsOptions represents the available ListProjectDeployments() options. diff --git a/deployments_test.go b/deployments_test.go index e95d8934..2c677a0b 100644 --- a/deployments_test.go +++ b/deployments_test.go @@ -4,7 +4,6 @@ import ( "fmt" "net/http" "testing" - "time" "github.com/stretchr/testify/require" ) @@ -105,30 +104,7 @@ func TestDeploymentsService_ListProjectDeployments(t *testing.T) { Project: nil, LastDeployment: nil, }, - 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"` - }{ + Deployable: DeploymentDeployable{ ID: 657, Status: "success", Stage: "deploy", @@ -167,14 +143,7 @@ func TestDeploymentsService_ListProjectDeployments(t *testing.T) { ProjectID: 0, WebURL: "", }, - 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"` - }{ + Pipeline: DeploymentDeployablePipeline{ ID: 36, SHA: "99d03678b90d914dbb1b109132516d71a4a03ea8", Ref: "main", @@ -301,30 +270,7 @@ func TestDeploymentsService_GetProjectDeployment(t *testing.T) { Project: nil, LastDeployment: nil, }, - 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"` - }{ + Deployable: DeploymentDeployable{ ID: 657, Status: "success", Stage: "deploy", @@ -363,14 +309,7 @@ func TestDeploymentsService_GetProjectDeployment(t *testing.T) { ProjectID: 0, WebURL: "", }, - 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"` - }{ + Pipeline: DeploymentDeployablePipeline{ ID: 36, SHA: "99d03678b90d914dbb1b109132516d71a4a03ea8", Ref: "main", @@ -497,30 +436,7 @@ func TestDeploymentsService_CreateProjectDeployment(t *testing.T) { Project: nil, LastDeployment: nil, }, - 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"` - }{ + Deployable: DeploymentDeployable{ ID: 657, Status: "success", Stage: "deploy", @@ -559,14 +475,7 @@ func TestDeploymentsService_CreateProjectDeployment(t *testing.T) { ProjectID: 0, WebURL: "", }, - 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"` - }{ + Pipeline: DeploymentDeployablePipeline{ ID: 36, SHA: "99d03678b90d914dbb1b109132516d71a4a03ea8", Ref: "main", @@ -693,30 +602,7 @@ func TestDeploymentsService_UpdateProjectDeployment(t *testing.T) { Project: nil, LastDeployment: nil, }, - 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"` - }{ + Deployable: DeploymentDeployable{ ID: 657, Status: "success", Stage: "deploy", @@ -755,14 +641,7 @@ func TestDeploymentsService_UpdateProjectDeployment(t *testing.T) { ProjectID: 0, WebURL: "", }, - 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"` - }{ + Pipeline: DeploymentDeployablePipeline{ ID: 36, SHA: "99d03678b90d914dbb1b109132516d71a4a03ea8", Ref: "main", diff --git a/discussions_test.go b/discussions_test.go index 3c2f16cd..6f1a297b 100644 --- a/discussions_test.go +++ b/discussions_test.go @@ -54,15 +54,7 @@ func TestDiscussionsService_ListIssueDiscussions(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -81,16 +73,8 @@ func TestDiscussionsService_ListIssueDiscussions(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, }} @@ -159,15 +143,7 @@ func TestDiscussionsService_GetIssueDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -186,16 +162,8 @@ func TestDiscussionsService_GetIssueDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -264,15 +232,7 @@ func TestDiscussionsService_CreateIssueDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -291,16 +251,8 @@ func TestDiscussionsService_CreateIssueDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -360,15 +312,7 @@ func TestDiscussionsService_AddIssueDiscussionNote(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "venky333@example.com", @@ -387,16 +331,8 @@ func TestDiscussionsService_AddIssueDiscussionNote(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 377, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 377, } n, resp, err := client.Discussions.AddIssueDiscussionNote(5, 11, "6a9c1750b37d513a43987b574953fceb50b03ce7", nil, nil) @@ -455,15 +391,7 @@ func TestDiscussionsService_UpdateIssueDiscussionNote(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "venky333@example.com", @@ -482,16 +410,8 @@ func TestDiscussionsService_UpdateIssueDiscussionNote(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 377, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 377, } n, resp, err := client.Discussions.UpdateIssueDiscussionNote(5, 11, "6a9c1750b37d513a43987b574953fceb50b03ce7", 302, nil, nil) @@ -586,15 +506,7 @@ func TestDiscussionsService_ListSnippetDiscussions(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -613,16 +525,8 @@ func TestDiscussionsService_ListSnippetDiscussions(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, }} @@ -691,15 +595,7 @@ func TestDiscussionsService_GetSnippetDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -718,16 +614,8 @@ func TestDiscussionsService_GetSnippetDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -796,15 +684,7 @@ func TestDiscussionsService_CreateSnippetDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -823,16 +703,8 @@ func TestDiscussionsService_CreateSnippetDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -892,15 +764,7 @@ func TestDiscussionsService_AddSnippetDiscussionNote(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "venky333@example.com", @@ -919,16 +783,8 @@ func TestDiscussionsService_AddSnippetDiscussionNote(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 377, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 377, } n, resp, err := client.Discussions.AddSnippetDiscussionNote(5, 11, "6a9c1750b37d513a43987b574953fceb50b03ce7", nil, nil) @@ -987,15 +843,7 @@ func TestDiscussionsService_UpdateSnippetDiscussionNote(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "venky333@example.com", @@ -1014,16 +862,8 @@ func TestDiscussionsService_UpdateSnippetDiscussionNote(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 377, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 377, } n, resp, err := client.Discussions.UpdateSnippetDiscussionNote(5, 11, "6a9c1750b37d513a43987b574953fceb50b03ce7", 302, nil, nil) @@ -1118,15 +958,7 @@ func TestDiscussionsService_ListGroupEpicDiscussions(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -1145,16 +977,8 @@ func TestDiscussionsService_ListGroupEpicDiscussions(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, }} @@ -1223,15 +1047,7 @@ func TestDiscussionsService_GetEpicDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -1250,16 +1066,8 @@ func TestDiscussionsService_GetEpicDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -1328,15 +1136,7 @@ func TestDiscussionsService_CreateEpicDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -1355,16 +1155,8 @@ func TestDiscussionsService_CreateEpicDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -1424,15 +1216,7 @@ func TestDiscussionsService_AddEpicDiscussionNote(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "venky333@example.com", @@ -1451,16 +1235,8 @@ func TestDiscussionsService_AddEpicDiscussionNote(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 377, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 377, } n, resp, err := client.Discussions.AddEpicDiscussionNote(5, 11, "6a9c1750b37d513a43987b574953fceb50b03ce7", nil, nil) @@ -1519,15 +1295,7 @@ func TestDiscussionsService_UpdateEpicDiscussionNote(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "venky333@example.com", @@ -1546,16 +1314,8 @@ func TestDiscussionsService_UpdateEpicDiscussionNote(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 377, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 377, } n, resp, err := client.Discussions.UpdateEpicDiscussionNote(5, 11, "6a9c1750b37d513a43987b574953fceb50b03ce7", 302, nil, nil) @@ -1650,15 +1410,7 @@ func TestDiscussionsService_ListMergeRequestDiscussions(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -1677,16 +1429,8 @@ func TestDiscussionsService_ListMergeRequestDiscussions(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, }} @@ -1755,15 +1499,7 @@ func TestDiscussionsService_GetMergeRequestDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -1782,16 +1518,8 @@ func TestDiscussionsService_GetMergeRequestDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -1860,15 +1588,7 @@ func TestDiscussionsService_CreateMergeRequestDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -1887,16 +1607,8 @@ func TestDiscussionsService_CreateMergeRequestDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -1965,15 +1677,7 @@ func TestDiscussionsService_ResolveMergeRequestDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -1992,16 +1696,8 @@ func TestDiscussionsService_ResolveMergeRequestDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -2061,15 +1757,7 @@ func TestDiscussionsService_AddMergeRequestDiscussionNote(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "venky333@example.com", @@ -2088,16 +1776,8 @@ func TestDiscussionsService_AddMergeRequestDiscussionNote(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 377, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 377, } n, resp, err := client.Discussions.AddMergeRequestDiscussionNote(5, 11, "6a9c1750b37d513a43987b574953fceb50b03ce7", nil, nil) @@ -2156,15 +1836,7 @@ func TestDiscussionsService_UpdateMergeRequestDiscussionNote(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "venky333@example.com", @@ -2183,16 +1855,8 @@ func TestDiscussionsService_UpdateMergeRequestDiscussionNote(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 377, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 377, } n, resp, err := client.Discussions.UpdateMergeRequestDiscussionNote(5, 11, "6a9c1750b37d513a43987b574953fceb50b03ce7", 302, nil, nil) @@ -2287,15 +1951,7 @@ func TestDiscussionsService_ListCommitDiscussions(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -2314,16 +1970,8 @@ func TestDiscussionsService_ListCommitDiscussions(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, }} @@ -2392,15 +2040,7 @@ func TestDiscussionsService_GetCommitDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -2419,16 +2059,8 @@ func TestDiscussionsService_GetCommitDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -2497,15 +2129,7 @@ func TestDiscussionsService_CreateCommitDiscussion(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "", @@ -2524,16 +2148,8 @@ func TestDiscussionsService_CreateCommitDiscussion(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 0, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 0, }}, } @@ -2593,15 +2209,7 @@ func TestDiscussionsService_AddCommitDiscussionNote(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "venky333@example.com", @@ -2620,16 +2228,8 @@ func TestDiscussionsService_AddCommitDiscussionNote(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 377, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 377, } n, resp, err := client.Discussions.AddCommitDiscussionNote(5, "abc123", "6a9c1750b37d513a43987b574953fceb50b03ce7", nil, nil) @@ -2688,15 +2288,7 @@ func TestDiscussionsService_UpdateCommitDiscussionNote(t *testing.T) { Attachment: "", Title: "", FileName: "", - 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"` - }{ + Author: NoteAuthor{ ID: 1, Username: "venky333", Email: "venky333@example.com", @@ -2715,16 +2307,8 @@ func TestDiscussionsService_UpdateCommitDiscussionNote(t *testing.T) { Position: nil, Resolvable: false, Resolved: false, - 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"` - }{}, - NoteableIID: 377, + ResolvedBy: NoteResolvedBy{}, + NoteableIID: 377, } n, resp, err := client.Discussions.UpdateCommitDiscussionNote(5, "abc123", "6a9c1750b37d513a43987b574953fceb50b03ce7", 302, nil, nil) diff --git a/event_parsing.go b/event_parsing.go index cae15b4b..17d23b3d 100644 --- a/event_parsing.go +++ b/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/event_systemhook_types.go b/event_systemhook_types.go index 50940e83..de0cd7f5 100644 --- a/event_systemhook_types.go +++ b/event_systemhook_types.go @@ -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 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 PushSystemEventProject `json:"project"` + Commits []PushSystemEventCommit `json:"commits"` + TotalCommitsCount int `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 int `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 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 TagPushSystemEventProject `json:"project"` + Commits []TagPushSystemEventCommit `json:"commits"` + TotalCommitsCount int `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 int `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 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 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 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"` +} + +// 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/event_webhook_types.go b/event_webhook_types.go index 78074732..04092950 100644 --- a/event_webhook_types.go +++ b/event_webhook_types.go @@ -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 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 BuildEventCommit `json:"commit"` + Repository *Repository `json:"repository"` +} + +type BuildEventCommit 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"` } // 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 int `json:"project_id"` + Project CommitCommentEventProject `json:"project"` + Repository *Repository `json:"repository"` + ObjectAttributes CommitCommentEventObjectAttributes `json:"object_attributes"` + Commit *CommitCommentEventCommit `json:"commit"` +} + +type CommitCommentEventProject 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"` +} + +type CommitCommentEventObjectAttributes 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"` +} + +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 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 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 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"` + VisibilityLevel int `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 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"` + VisibilityLevel int `json:"visibility_level"` + CIConfigPath string `json:"ci_config_path"` +} + +type FeatureFlagEventObjectAttributes struct { + ID int `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 int `json:"group_id"` + GroupName string `json:"group_name"` + GroupPath string `json:"group_path"` +} + +type GroupResourceAccessTokenEventObjectAttributes struct { + ID int `json:"id"` + UserID int `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 int `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 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"` +} + +type IssueCommentEventIssue 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"` } // 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 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"` +} + +type IssueEventObjectAttributes 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 IssueEventObjectAttributesEscalationPolicy `json:"escalation_policy"` + Labels []*EventLabel `json:"labels"` +} + +type IssueEventObjectAttributesEscalationPolicy struct { + ID int `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 int `json:"previous"` + Current int `json:"current"` +} + +type IssueEventChangesTotalTimeSpent struct { + Previous int `json:"previous"` + Current int `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 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 JobEventCommit `json:"commit"` + Repository *Repository `json:"repository"` + Runner JobEventRunner `json:"runner"` + Environment EventEnvironment `json:"environment"` + SourcePipeline EventSourcePipeline `json:"source_pipeline"` +} + +type JobEventCommit 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"` +} + +type JobEventRunner 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"` +} + +type EventEnvironment struct { + Name string `json:"name"` + Action string `json:"action"` + DeploymentTier string `json:"deployment_tier"` +} + +type EventSourcePipeline struct { + Project EventSourcePipelineProject `json:"project"` + PipelineID int `json:"pipeline_id"` + JobID int `json:"job_id"` +} + +type EventSourcePipelineProject struct { + ID int `json:"id"` + WebURL string `json:"web_url"` + PathWithNamespace string `json:"path_with_namespace"` } // MemberEvent represents a member event. @@ -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 int `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 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"` +} + +type MergeCommentEventObjectAttributes 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"` +} + +type MergeCommentEventMergeRequest 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 EventMergeRequestLastCommit `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"` +} + +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,167 +681,162 @@ 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 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"` +} + +type MergeEventObjectAttributes 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 EventMergeRequestLastCommit `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"` +} + +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 int `json:"previous"` + Current int `json:"current"` +} + +type MergeEventChangesMergeStatus struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type MergeEventChangesMilestoneID struct { + Previous int `json:"previous"` + Current int `json:"current"` +} + +type MergeEventChangesSourceBranch struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type MergeEventChangesSourceProjectID struct { + Previous int `json:"previous"` + Current int `json:"current"` +} + +type MergeEventChangesTargetBranch struct { + Previous string `json:"previous"` + Current string `json:"current"` +} + +type MergeEventChangesTargetProjectID struct { + Previous int `json:"previous"` + Current int `json:"current"` } // EventUser represents a user record in an event and is used as an even @@ -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 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 []PipelineEventObjectAttributesVariable `json:"variables"` +} + +type PipelineEventObjectAttributesVariable struct { + Key string `json:"key"` + Value string `json:"value"` +} + +type PipelineEventMergeRequest 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"` +} + +type PipelineEventProject 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"` +} + +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 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 PipelineEventBuildRunner `json:"runner"` + ArtifactsFile PipelineEventBuildArtifactsFile `json:"artifacts_file"` + Environment EventEnvironment `json:"environment"` +} + +type PipelineEventBuildRunner 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"` +} + +type PipelineEventBuildArtifactsFile struct { + Filename string `json:"filename"` + Size int `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 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"` +} + +type ProjectResourceAccessTokenEventObjectAttributes struct { + ID int `json:"id"` + UserID int `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 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 PushEventProject `json:"project"` + Repository *Repository `json:"repository"` + Commits []*PushEventCommit `json:"commits"` + TotalCommitsCount int `json:"total_commits_count"` +} + +type PushEventProject 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"` +} + +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 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 ReleaseEventProject `json:"project"` + URL string `json:"url"` + Action string `json:"action"` + Assets ReleaseEventAssets `json:"assets"` + Commit ReleaseEventCommit `json:"commit"` +} + +type ReleaseEventProject 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"` +} + +type ReleaseEventAssets struct { + Count int `json:"count"` + Links []ReleaseEventAssetsLink `json:"links"` + Sources []ReleaseEventAssetsSource `json:"sources"` +} + +type ReleaseEventAssetsLink struct { + ID int `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 int `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 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"` +} + +type SnippetCommentEventSnippet 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"` } // SubGroupEvent represents a subgroup event. @@ -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 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 TagEventProject `json:"project"` + Repository *Repository `json:"repository"` + Commits []*TagEventCommit `json:"commits"` + TotalCommitsCount int `json:"total_commits_count"` +} + +type TagEventProject 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"` +} + +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. diff --git a/events.go b/events.go index 5107a5aa..62f7bd59 100644 --- a/events.go +++ b/events.go @@ -45,35 +45,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 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 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 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"` } // ListContributionEventsOptions represents the options for GetUserContributionEvents @@ -138,69 +137,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 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 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 int `json:"user_id"` + UserName string `json:"user_name"` + Repository *Repository `json:"repository"` + Commits []*Commit `json:"commits"` + TotalCommitsCount int `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 int `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 int `json:"noteable_id"` + NoteableType string `json:"noteable_type"` + NoteableIID int `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 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"` +} + +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 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"` +} + +func (d ProjectEventPushData) String() string { + return Stringify(d) +} + // ListProjectVisibleEventsOptions represents the available // ListProjectVisibleEvents() options. // diff --git a/events_test.go b/events_test.go index c3d26347..948dfbc4 100644 --- a/events_test.go +++ b/events_test.go @@ -51,14 +51,7 @@ func TestUsersService_ListUserContributionEvents(t *testing.T) { AuthorID: 1, TargetTitle: "Public project search field", Note: nil, - 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"` - }{ + Author: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -134,14 +127,7 @@ func TestEventsService_ListCurrentUserContributionEvents(t *testing.T) { AuthorID: 25, TargetTitle: "Qui natus eos odio tempore et quaerat consequuntur ducimus cupiditate quis.", Note: nil, - 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"` - }{ + Author: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 25, @@ -249,14 +235,7 @@ func TestEventsService_ListProjectVisibleEvents(t *testing.T) { TargetType: "Issue", AuthorID: 1, TargetTitle: "Public project search field", - 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"` - }{ + Author: BasicUser{ Name: "Venkatesh Thalluri", Username: "venky333", ID: 1, @@ -278,14 +257,7 @@ func TestEventsService_ListProjectVisibleEvents(t *testing.T) { AuthorID: 1, TargetTitle: "", CreatedAt: "", - 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"` - }{ + Author: BasicUser{ Name: "Dmitriy Zaporozhets", Username: "root", ID: 1, @@ -294,15 +266,7 @@ func TestEventsService_ListProjectVisibleEvents(t *testing.T) { WebURL: "http://localhost:3000/root", }, AuthorUsername: "john", - 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"` - }{ + PushData: ProjectEventPushData{ CommitCount: 1, Action: "pushed", RefType: "branch", diff --git a/generic_packages.go b/generic_packages.go index e80fb5bb..d51ccf77 100644 --- a/generic_packages.go +++ b/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 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 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 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"` +} + +// 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/groups_test.go b/groups_test.go index cac1e781..333bd9d8 100644 --- a/groups_test.go +++ b/groups_test.go @@ -65,7 +65,6 @@ func TestGetGroup(t *testing.T) { } // Create the group shares struct to test. - // We need to re-declare the struct here since it's an anonymous struct in the upstream struct. shares := []SharedWithGroup{ { GroupID: 1, diff --git a/import.go b/import.go index 6ce73d78..5e7b913f 100644 --- a/import.go +++ b/import.go @@ -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 *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 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. diff --git a/issues_statistics.go b/issues_statistics.go index 23f68169..2ffa4081 100644 --- a/issues_statistics.go +++ b/issues_statistics.go @@ -44,19 +44,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 int `json:"all"` + Closed int `json:"closed"` + Opened int `json:"opened"` +} + // GetIssuesStatisticsOptions represents the available GetIssuesStatistics() options. // // GitLab API docs: diff --git a/issues_statistics_test.go b/issues_statistics_test.go index 769b8410..81b2f06c 100644 --- a/issues_statistics_test.go +++ b/issues_statistics_test.go @@ -44,18 +44,8 @@ func TestGetIssuesStatistics(t *testing.T) { } want := &IssuesStatistics{ - Statistics: struct { - Counts struct { - All int `json:"all"` - Closed int `json:"closed"` - Opened int `json:"opened"` - } `json:"counts"` - }{ - Counts: struct { - All int `json:"all"` - Closed int `json:"closed"` - Opened int `json:"opened"` - }{ + Statistics: IssuesStatisticsStatistics{ + Counts: IssuesStatisticsCounts{ 20, 5, 15, }, }, @@ -87,18 +77,8 @@ func TestGetGroupIssuesStatistics(t *testing.T) { } want := &IssuesStatistics{ - Statistics: struct { - Counts struct { - All int `json:"all"` - Closed int `json:"closed"` - Opened int `json:"opened"` - } `json:"counts"` - }{ - Counts: struct { - All int `json:"all"` - Closed int `json:"closed"` - Opened int `json:"opened"` - }{ + Statistics: IssuesStatisticsStatistics{ + Counts: IssuesStatisticsCounts{ 20, 5, 15, }, }, @@ -130,18 +110,8 @@ func TestGetProjectIssuesStatistics(t *testing.T) { } want := &IssuesStatistics{ - Statistics: struct { - Counts struct { - All int `json:"all"` - Closed int `json:"closed"` - Opened int `json:"opened"` - } `json:"counts"` - }{ - Counts: struct { - All int `json:"all"` - Closed int `json:"closed"` - Opened int `json:"opened"` - }{ + Statistics: IssuesStatisticsStatistics{ + Counts: IssuesStatisticsCounts{ 20, 5, 15, }, }, diff --git a/jobs.go b/jobs.go index 94aef954..d33d3f49 100644 --- a/jobs.go +++ b/jobs.go @@ -59,51 +59,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 int `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 int `json:"id"` + ProjectID int `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 int `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 int `json:"size"` +} + +// JobRunner represents a ci build runner. +// +// GitLab API docs: https://docs.gitlab.com/api/jobs/ +type JobRunner struct { + ID int `json:"id"` + Description string `json:"description"` + Active bool `json:"active"` + IsShared bool `json:"is_shared"` + Name string `json:"name"` } // Bridge represents a pipeline bridge. diff --git a/jobs_test.go b/jobs_test.go index 3027a0e5..8c5bfe69 100644 --- a/jobs_test.go +++ b/jobs_test.go @@ -129,13 +129,7 @@ func TestJobsService_ListProjectJobs(t *testing.T) { ID: 7, Name: "teaspoon", TagList: []string{"docker runner", "ubuntu18"}, - Pipeline: struct { - ID int `json:"id"` - ProjectID int `json:"project_id"` - Ref string `json:"ref"` - Sha string `json:"sha"` - Status string `json:"status"` - }{ + Pipeline: JobPipeline{ ID: 6, ProjectID: 1, Ref: "master", @@ -163,13 +157,7 @@ func TestJobsService_ListProjectJobs(t *testing.T) { ID: 6, Name: "rspec:other", TagList: []string{"docker runner", "win10-2004"}, - Pipeline: struct { - ID int `json:"id"` - ProjectID int `json:"project_id"` - Ref string `json:"ref"` - Sha string `json:"sha"` - Status string `json:"status"` - }{ + Pipeline: JobPipeline{ ID: 6, ProjectID: 1, Ref: "master", diff --git a/license.go b/license.go index 9e9d2a06..ebf43a5a 100644 --- a/license.go +++ b/license.go @@ -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 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 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 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"` +} + +func (a LicenseAddOns) String() string { + return Stringify(a) +} + // GetLicense retrieves information about the current license. // // GitLab API docs: diff --git a/license_test.go b/license_test.go index 17f956a3..6f0133f9 100644 --- a/license_test.go +++ b/license_test.go @@ -44,22 +44,12 @@ func TestLicenseService_GetLicense(t *testing.T) { Overage: 200, UserLimit: 100, ActiveUsers: 300, - Licensee: struct { - Name string `json:"Name"` - Company string `json:"Company"` - Email string `json:"Email"` - }{ + Licensee: LicenseLicensee{ Name: "Venkatesh Thalluri", Company: "", Email: "", }, - 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"` - }{ + AddOns: LicenseAddOns{ GitLabAuditorUser: 1, GitLabDeployBoard: 0, GitLabFileLocks: 1, @@ -125,22 +115,12 @@ func TestLicenseService_AddLicense(t *testing.T) { Overage: 200, UserLimit: 100, ActiveUsers: 300, - Licensee: struct { - Name string `json:"Name"` - Company string `json:"Company"` - Email string `json:"Email"` - }{ + Licensee: LicenseLicensee{ Name: "Venkatesh Thalluri", Company: "", Email: "", }, - 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"` - }{ + AddOns: LicenseAddOns{ GitLabAuditorUser: 1, GitLabDeployBoard: 0, GitLabFileLocks: 1, diff --git a/merge_request_approvals.go b/merge_request_approvals.go index 80d16bec..ee52962a 100644 --- a/merge_request_approvals.go +++ b/merge_request_approvals.go @@ -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 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"` } // MergeRequestApprovalRule represents a GitLab merge request approval rule. diff --git a/merge_requests.go b/merge_requests.go index 6f6cc016..6ffa1fa7 100644 --- a/merge_requests.go +++ b/merge_requests.go @@ -142,25 +142,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 int `json:"diverged_commits_count"` + FirstContribution bool `json:"first_contribution"` // Deprecated: use Draft instead WorkInProgress bool `json:"work_in_progress"` @@ -170,6 +164,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 diff --git a/metadata.go b/metadata.go index 0a702f8e..5c9f7170 100644 --- a/metadata.go +++ b/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/metadata_test.go b/metadata_test.go index c65d82a5..0db78925 100644 --- a/metadata_test.go +++ b/metadata_test.go @@ -49,12 +49,7 @@ func TestGetMetadata(t *testing.T) { } want := &Metadata{ - Version: "15.6.0-pre", Revision: "016e8d8bdc3", KAS: struct { - Enabled bool `json:"enabled"` - ExternalURL string `json:"externalUrl"` - ExternalK8SProxyURL string `json:"externalK8sProxyUrl"` - Version string `json:"version"` - }{ + Version: "15.6.0-pre", Revision: "016e8d8bdc3", KAS: MetadataKAS{ Enabled: true, ExternalURL: "wss://kas.gitlab.example.com", ExternalK8SProxyURL: "https://kas.gitlab.example.com/k8s-proxy", diff --git a/notes.go b/notes.go index b54b9501..fc5e9a14 100644 --- a/notes.go +++ b/notes.go @@ -63,41 +63,47 @@ 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 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 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 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"` +} + // NoteAuthor represents the author of a note. type NoteAuthor struct { ID int `json:"id"` diff --git a/notes_test.go b/notes_test.go index 2163f49b..880aaeab 100644 --- a/notes_test.go +++ b/notes_test.go @@ -799,15 +799,7 @@ func TestCreateNote(t *testing.T) { want := &Note{ ID: 1, Body: "Body of note", - 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\"" - }{ + Author: NoteAuthor{ ID: 1, Username: "snehal", Name: "snehal", Email: "snehal@example.com", State: "active", AvatarURL: "", WebURL: "", }, Internal: false, diff --git a/pages_domains.go b/pages_domains.go index 15a85dc7..1d9befb1 100644 --- a/pages_domains.go +++ b/pages_domains.go @@ -47,20 +47,25 @@ 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 int `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. diff --git a/pages_domains_test.go b/pages_domains_test.go index 919fea2f..5a2ee815 100644 --- a/pages_domains_test.go +++ b/pages_domains_test.go @@ -4,7 +4,6 @@ import ( "fmt" "net/http" "testing" - "time" "github.com/stretchr/testify/require" ) @@ -40,13 +39,7 @@ func TestPagesDomainsService_ListPagesDomains(t *testing.T) { Verified: false, VerificationCode: "", EnabledUntil: nil, - Certificate: struct { - Subject string `json:"subject"` - Expired bool `json:"expired"` - Expiration *time.Time `json:"expiration"` - Certificate string `json:"certificate"` - CertificateText string `json:"certificate_text"` - }{ + Certificate: PagesDomainCertificate{ Expired: false, Expiration: nil, Subject: "/O=Example, Inc./OU=Example Origin CA/CN=Example Origin Certificate", @@ -105,13 +98,7 @@ func TestPagesDomainsService_ListAllPagesDomains(t *testing.T) { Verified: false, VerificationCode: "", EnabledUntil: nil, - Certificate: struct { - Subject string `json:"subject"` - Expired bool `json:"expired"` - Expiration *time.Time `json:"expiration"` - Certificate string `json:"certificate"` - CertificateText string `json:"certificate_text"` - }{ + Certificate: PagesDomainCertificate{ Expired: false, Expiration: nil, }, @@ -172,13 +159,7 @@ func TestPagesDomainsService_GetPagesDomain(t *testing.T) { Verified: false, VerificationCode: "", EnabledUntil: nil, - Certificate: struct { - Subject string `json:"subject"` - Expired bool `json:"expired"` - Expiration *time.Time `json:"expiration"` - Certificate string `json:"certificate"` - CertificateText string `json:"certificate_text"` - }{ + Certificate: PagesDomainCertificate{ Expired: false, Expiration: nil, Subject: "/O=Example, Inc./OU=Example Origin CA/CN=Example Origin Certificate", @@ -237,13 +218,7 @@ func TestPagesDomainsService_CreatePagesDomain(t *testing.T) { Verified: false, VerificationCode: "", EnabledUntil: nil, - Certificate: struct { - Subject string `json:"subject"` - Expired bool `json:"expired"` - Expiration *time.Time `json:"expiration"` - Certificate string `json:"certificate"` - CertificateText string `json:"certificate_text"` - }{ + Certificate: PagesDomainCertificate{ Expired: false, Expiration: nil, Subject: "/O=Example, Inc./OU=Example Origin CA/CN=Example Origin Certificate", @@ -302,13 +277,7 @@ func TestPagesDomainsService_UpdatePagesDomain(t *testing.T) { Verified: false, VerificationCode: "", EnabledUntil: nil, - Certificate: struct { - Subject string `json:"subject"` - Expired bool `json:"expired"` - Expiration *time.Time `json:"expiration"` - Certificate string `json:"certificate"` - CertificateText string `json:"certificate_text"` - }{ + Certificate: PagesDomainCertificate{ Expired: false, Expiration: nil, Subject: "/O=Example, Inc./OU=Example Origin CA/CN=Example Origin Certificate", diff --git a/pipelines.go b/pipelines.go index 83858368..e20f5066 100644 --- a/pipelines.go +++ b/pipelines.go @@ -114,23 +114,34 @@ type Pipeline struct { 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. diff --git a/project_import_export.go b/project_import_export.go index 105ec930..4a1052d4 100644 --- a/project_import_export.go +++ b/project_import_export.go @@ -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 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 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/project_import_export_test.go b/project_import_export_test.go index 2c720c8f..a2ec1762 100644 --- a/project_import_export_test.go +++ b/project_import_export_test.go @@ -67,10 +67,7 @@ func TestProjectImportExportService_ExportStatus(t *testing.T) { PathWithNamespace: "gitlab-org/gitlab-test", ExportStatus: "finished", Message: "", - Links: struct { - APIURL string `json:"api_url"` - WebURL string `json:"web_url"` - }{ + Links: ExportStatusLinks{ APIURL: "https://gitlab.example.com/api/v4/projects/1/export/download", WebURL: "https://gitlab.example.com/gitlab-org/gitlab-test/download_export", }, diff --git a/project_snippets_test.go b/project_snippets_test.go index 1a1bd63c..86cf031c 100644 --- a/project_snippets_test.go +++ b/project_snippets_test.go @@ -4,7 +4,6 @@ import ( "fmt" "net/http" "testing" - "time" "github.com/stretchr/testify/require" ) @@ -42,14 +41,7 @@ func TestProjectSnippetsService_ListSnippets(t *testing.T) { Title: "test", FileName: "add.rb", Description: "Ruby test snippet", - 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"` - }{ + Author: SnippetAuthor{ ID: 1, Username: "venkatesh_thalluri", Email: "venky@example.com", @@ -113,14 +105,7 @@ func TestProjectSnippetsService_GetSnippet(t *testing.T) { Title: "test", FileName: "add.rb", Description: "Ruby test snippet", - 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"` - }{ + Author: SnippetAuthor{ ID: 1, Username: "venkatesh_thalluri", Email: "venky@example.com", @@ -190,14 +175,7 @@ func TestProjectSnippetsService_CreateSnippet(t *testing.T) { Title: "test", FileName: "add.rb", Description: "Ruby test snippet", - 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"` - }{ + Author: SnippetAuthor{ ID: 1, Username: "venkatesh_thalluri", Email: "venky@example.com", @@ -207,10 +185,7 @@ func TestProjectSnippetsService_CreateSnippet(t *testing.T) { ProjectID: 1, WebURL: "http://example.com/example/example/snippets/1", RawURL: "http://example.com/example/example/snippets/1/raw", - Files: []struct { - Path string `json:"path"` - RawURL string `json:"raw_url"` - }{ + Files: []SnippetFile{ { Path: "add.rb", RawURL: "http://example.com/example/example/-/snippets/1/raw/main/add.rb", @@ -270,14 +245,7 @@ func TestProjectSnippetsService_UpdateSnippet(t *testing.T) { Title: "test", FileName: "add.rb", Description: "Ruby test snippet", - 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"` - }{ + Author: SnippetAuthor{ ID: 1, Username: "venkatesh_thalluri", Email: "venky@example.com", diff --git a/projects.go b/projects.go index b5e6fe90..662ba7e0 100644 --- a/projects.go +++ b/projects.go @@ -103,137 +103,132 @@ 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"` - 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"` - 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 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 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"` + 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 []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 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"` + 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 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"` // Deprecated: use Topics instead TagList []string `json:"tag_list"` @@ -261,6 +256,16 @@ 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 int `json:"group_id"` + GroupName string `json:"group_name"` + GroupFullPath string `json:"group_full_path"` + GroupAccessLevel int `json:"group_access_level"` +} + // BasicProject included in other service responses (such as todos). type BasicProject struct { ID int `json:"id"` diff --git a/releases.go b/releases.go index 8810690d..3f3858c4 100644 --- a/releases.go +++ b/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 int `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. diff --git a/repository_files.go b/repository_files.go index 32d1a498..ae69ab6c 100644 --- a/repository_files.go +++ b/repository_files.go @@ -179,24 +179,34 @@ 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: diff --git a/repository_files_test.go b/repository_files_test.go index b006f53a..8925a192 100644 --- a/repository_files_test.go +++ b/repository_files_test.go @@ -4,7 +4,6 @@ import ( "fmt" "net/http" "testing" - "time" "github.com/stretchr/testify/assert" ) @@ -150,17 +149,7 @@ func TestRepositoryFilesService_GetFileBlame(t *testing.T) { want := []*FileBlameRange{ { - 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"` - }{ + Commit: FileBlameRangeCommit{ ID: "d42409d56517157c48bf3bd97d3f75974dde19fb", ParentIDs: []string{"cc6e14f9328fa6d7b5a0d3c30dc2002a3f2a3822"}, Message: "Add feature also fix bug", diff --git a/resource_label_events.go b/resource_label_events.go index f3729674..18e13f79 100644 --- a/resource_label_events.go +++ b/resource_label_events.go @@ -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 int `json:"id"` + Action string `json:"action"` + CreatedAt *time.Time `json:"created_at"` + ResourceType string `json:"resource_type"` + ResourceID int `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 int `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 diff --git a/resource_label_events_test.go b/resource_label_events_test.go index 42c4e78b..16ec1fd8 100644 --- a/resource_label_events_test.go +++ b/resource_label_events_test.go @@ -45,14 +45,7 @@ func TestResourceLabelEventsService_ListIssueLabelEvents(t *testing.T) { Action: "add", ResourceType: "Issue", ResourceID: 253, - 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"` - }{ + User: BasicUser{ ID: 1, Name: "Administrator", Username: "root", @@ -60,13 +53,7 @@ func TestResourceLabelEventsService_ListIssueLabelEvents(t *testing.T) { AvatarURL: "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", WebURL: "http://gitlab.example.com/root", }, - Label: struct { - ID int `json:"id"` - Name string `json:"name"` - Color string `json:"color"` - TextColor string `json:"text_color"` - Description string `json:"description"` - }{ + Label: LabelEventLabel{ ID: 73, Name: "a1", Color: "#34495E", @@ -131,14 +118,7 @@ func TestResourceLabelEventsService_GetIssueLabelEvent(t *testing.T) { Action: "add", ResourceType: "Issue", ResourceID: 253, - 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"` - }{ + User: BasicUser{ ID: 1, Name: "Administrator", Username: "root", @@ -146,13 +126,7 @@ func TestResourceLabelEventsService_GetIssueLabelEvent(t *testing.T) { AvatarURL: "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", WebURL: "http://gitlab.example.com/root", }, - Label: struct { - ID int `json:"id"` - Name string `json:"name"` - Color string `json:"color"` - TextColor string `json:"text_color"` - Description string `json:"description"` - }{ + Label: LabelEventLabel{ ID: 73, Name: "a1", Color: "#34495E", @@ -219,14 +193,7 @@ func TestResourceLabelEventsService_ListGroupEpicLabelEvents(t *testing.T) { Action: "add", ResourceType: "Epic", ResourceID: 33, - 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"` - }{ + User: BasicUser{ ID: 1, Name: "Administrator", Username: "root", @@ -234,13 +201,7 @@ func TestResourceLabelEventsService_ListGroupEpicLabelEvents(t *testing.T) { AvatarURL: "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", WebURL: "http://gitlab.example.com/root", }, - Label: struct { - ID int `json:"id"` - Name string `json:"name"` - Color string `json:"color"` - TextColor string `json:"text_color"` - Description string `json:"description"` - }{ + Label: LabelEventLabel{ ID: 73, Name: "a1", Color: "#34495E", @@ -305,14 +266,7 @@ func TestResourceLabelEventsService_GetGroupEpicLabelEvent(t *testing.T) { Action: "add", ResourceType: "Epic", ResourceID: 33, - 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"` - }{ + User: BasicUser{ ID: 1, Name: "Administrator", Username: "root", @@ -320,13 +274,7 @@ func TestResourceLabelEventsService_GetGroupEpicLabelEvent(t *testing.T) { AvatarURL: "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", WebURL: "http://gitlab.example.com/root", }, - Label: struct { - ID int `json:"id"` - Name string `json:"name"` - Color string `json:"color"` - TextColor string `json:"text_color"` - Description string `json:"description"` - }{ + Label: LabelEventLabel{ ID: 73, Name: "a1", Color: "#34495E", @@ -393,14 +341,7 @@ func TestResourceLabelEventsService_ListMergeRequestsLabelEvents(t *testing.T) { Action: "add", ResourceType: "MergeRequest", ResourceID: 28, - 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"` - }{ + User: BasicUser{ ID: 1, Name: "Administrator", Username: "root", @@ -408,13 +349,7 @@ func TestResourceLabelEventsService_ListMergeRequestsLabelEvents(t *testing.T) { AvatarURL: "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", WebURL: "http://gitlab.example.com/root", }, - Label: struct { - ID int `json:"id"` - Name string `json:"name"` - Color string `json:"color"` - TextColor string `json:"text_color"` - Description string `json:"description"` - }{ + Label: LabelEventLabel{ ID: 74, Name: "p1", Color: "#0033CC", @@ -479,14 +414,7 @@ func TestResourceLabelEventsService_GetMergeRequestLabelEvent(t *testing.T) { Action: "add", ResourceType: "MergeRequest", ResourceID: 28, - 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"` - }{ + User: BasicUser{ ID: 1, Name: "Administrator", Username: "root", @@ -494,13 +422,7 @@ func TestResourceLabelEventsService_GetMergeRequestLabelEvent(t *testing.T) { AvatarURL: "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", WebURL: "http://gitlab.example.com/root", }, - Label: struct { - ID int `json:"id"` - Name string `json:"name"` - Color string `json:"color"` - TextColor string `json:"text_color"` - Description string `json:"description"` - }{ + Label: LabelEventLabel{ ID: 74, Name: "p1", Color: "#0033CC", diff --git a/runners.go b/runners.go index b5285c80..b943a030 100644 --- a/runners.go +++ b/runners.go @@ -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 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 []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 int `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 int `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 int `json:"id"` + Name string `json:"name"` + WebURL string `json:"web_url"` +} + // ListRunnersOptions represents the available ListRunners() options. // // GitLab API docs: diff --git a/runners_test.go b/runners_test.go index 7d896f91..2729af69 100644 --- a/runners_test.go +++ b/runners_test.go @@ -55,13 +55,7 @@ func TestListRunnersJobs(t *testing.T) { t.Fatalf("Runners.ListRunnersJobs returns an error: %v", err) } - pipeline := struct { - ID int `json:"id"` - ProjectID int `json:"project_id"` - Ref string `json:"ref"` - Sha string `json:"sha"` - Status string `json:"status"` - }{ + pipeline := JobPipeline{ ID: 8777, ProjectID: 3252, Ref: DefaultBranch, @@ -154,13 +148,7 @@ func TestUpdateRunnersDetails(t *testing.T) { t.Fatalf("Runners.UpdateRunnersDetails returns an error: %v", err) } - 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"` - }{{ + projects := []RunnerDetailsProject{{ ID: 1, Name: "GitLab Community Edition", NameWithNamespace: "GitLab.org / GitLab Community Edition", @@ -204,13 +192,7 @@ func TestGetRunnerDetails(t *testing.T) { t.Fatalf("Runners.GetRunnerDetails returns an error: %v", err) } - 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"` - }{{ + projects := []RunnerDetailsProject{{ ID: 1, Name: "GitLab Community Edition", NameWithNamespace: "GitLab.org / GitLab Community Edition", diff --git a/sidekiq_metrics.go b/sidekiq_metrics.go index 0a985847..2650ae20 100644 --- a/sidekiq_metrics.go +++ b/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 int `json:"backlog"` + Latency int `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 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"` } // 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 int `json:"processed"` + Failed int `json:"failed"` + Enqueued int `json:"enqueued"` } // GetJobStats list information about the jobs that Sidekiq has performed. diff --git a/sidekiq_metrics_test.go b/sidekiq_metrics_test.go index 3416c930..5c2df358 100644 --- a/sidekiq_metrics_test.go +++ b/sidekiq_metrics_test.go @@ -4,7 +4,6 @@ import ( "fmt" "net/http" "testing" - "time" "github.com/stretchr/testify/require" ) @@ -21,10 +20,7 @@ func TestSidekiqService_GetQueueMetrics(t *testing.T) { qm, _, err := client.Sidekiq.GetQueueMetrics() require.NoError(t, err) - want := &QueueMetrics{Queues: map[string]struct { - Backlog int `json:"backlog"` - Latency int `json:"latency"` - }{"default": {Backlog: 0, Latency: 0}}} + want := &QueueMetrics{Queues: map[string]QueueMetricsQueue{"default": {Backlog: 0, Latency: 0}}} require.Equal(t, want, qm) } @@ -40,16 +36,7 @@ func TestSidekiqService_GetProcessMetrics(t *testing.T) { pm, _, err := client.Sidekiq.GetProcessMetrics() require.NoError(t, err) - want := &ProcessMetrics{[]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"` - }{{Hostname: "gitlab.example.com", Pid: 5649, Tag: "gitlab", Concurrency: 25, Busy: 0}}} + want := &ProcessMetrics{[]ProcessMetricsProcess{{Hostname: "gitlab.example.com", Pid: 5649, Tag: "gitlab", Concurrency: 25, Busy: 0}}} require.Equal(t, want, pm) } @@ -65,15 +52,7 @@ func TestSidekiqService_GetJobStats(t *testing.T) { js, _, err := client.Sidekiq.GetJobStats() require.NoError(t, err) - want := &JobStats{struct { - Processed int `json:"processed"` - Failed int `json:"failed"` - Enqueued int `json:"enqueued"` - }(struct { - Processed int - Failed int - Enqueued int - }{Processed: 2, Failed: 0, Enqueued: 0})} + want := &JobStats{JobStatsJobs{Processed: 2, Failed: 0, Enqueued: 0}} require.Equal(t, want, js) } @@ -90,32 +69,12 @@ func TestSidekiqService_GetCompoundMetrics(t *testing.T) { require.NoError(t, err) want := &CompoundMetrics{ - QueueMetrics: QueueMetrics{Queues: map[string]struct { - Backlog int `json:"backlog"` - Latency int `json:"latency"` - }{"default": { + QueueMetrics: QueueMetrics{Queues: map[string]QueueMetricsQueue{"default": { Backlog: 0, Latency: 0, }}}, - ProcessMetrics: ProcessMetrics{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"` - }{{Hostname: "gitlab.example.com", Pid: 5649, Tag: "gitlab", Concurrency: 25, Busy: 0}}}, - JobStats: JobStats{Jobs: struct { - Processed int `json:"processed"` - Failed int `json:"failed"` - Enqueued int `json:"enqueued"` - }(struct { - Processed int - Failed int - Enqueued int - }{Processed: 2, Failed: 0, Enqueued: 0})}, + ProcessMetrics: ProcessMetrics{Processes: []ProcessMetricsProcess{{Hostname: "gitlab.example.com", Pid: 5649, Tag: "gitlab", Concurrency: 25, Busy: 0}}}, + JobStats: JobStats{Jobs: JobStatsJobs{Processed: 2, Failed: 0, Enqueued: 0}}, } require.Equal(t, want, cm) } diff --git a/snippets.go b/snippets.go index 5a02926e..0fbb1500 100644 --- a/snippets.go +++ b/snippets.go @@ -51,35 +51,53 @@ 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 int `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 int `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 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"` +} + +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: -- GitLab From a28a66dc8d8906619e361de4d1d8cbb789f45366 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 6 Oct 2025 22:22:57 +0300 Subject: [PATCH 11/26] chore: Remove unused exclusions for revive.var-naming Changelog: Improvements --- .golangci.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 48438462..850d7dff 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -91,30 +91,6 @@ 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 - linters: - - revive paths: - third_party$ - builtin$ -- GitLab From 6848dc7eefccd641f01027bc654a767e8fddc427 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Tue, 7 Oct 2025 01:25:56 -0500 Subject: [PATCH 12/26] chore(no-release): Update `int` in the first batch of files to `int64` Changelog: Improvements --- access_requests.go | 18 ++-- alert_management.go | 18 ++-- applications.go | 6 +- audit_events.go | 18 ++-- award_emojis.go | 116 +++++++++++------------ award_emojis_test.go | 2 +- boards.go | 62 ++++++------- broadcast_messages.go | 14 +-- cluster_agents.go | 30 +++--- commits.go | 4 +- container_registry.go | 28 +++--- container_registry_test.go | 2 +- testing/access_requests_mock.go | 24 ++--- testing/alert_management_mock.go | 24 ++--- testing/applications_mock.go | 6 +- testing/audit_events_mock.go | 18 ++-- testing/award_emojis_mock.go | 144 ++++++++++++++--------------- testing/boards_mock.go | 48 +++++----- testing/broadcast_messages_mock.go | 18 ++-- testing/cluster_agents_mock.go | 36 ++++---- testing/container_registry_mock.go | 30 +++--- 21 files changed, 333 insertions(+), 333 deletions(-) diff --git a/access_requests.go b/access_requests.go index 7768c1e4..1e19d3d7 100644 --- a/access_requests.go +++ b/access_requests.go @@ -28,10 +28,10 @@ type ( ListGroupAccessRequests(gid any, opt *ListAccessRequestsOptions, options ...RequestOptionFunc) ([]*AccessRequest, *Response, error) RequestProjectAccess(pid any, options ...RequestOptionFunc) (*AccessRequest, *Response, error) RequestGroupAccess(gid any, options ...RequestOptionFunc) (*AccessRequest, *Response, error) - ApproveProjectAccessRequest(pid any, user int, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) - ApproveGroupAccessRequest(gid any, user int, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) - DenyProjectAccessRequest(pid any, user int, options ...RequestOptionFunc) (*Response, error) - DenyGroupAccessRequest(gid any, user int, options ...RequestOptionFunc) (*Response, error) + ApproveProjectAccessRequest(pid any, user int64, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) + ApproveGroupAccessRequest(gid any, user int64, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) + DenyProjectAccessRequest(pid any, user int64, options ...RequestOptionFunc) (*Response, error) + DenyGroupAccessRequest(gid any, user int64, options ...RequestOptionFunc) (*Response, error) } // AccessRequestsService handles communication with the project/group @@ -50,7 +50,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"` @@ -185,7 +185,7 @@ type ApproveAccessRequestOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/access_requests/#approve-an-access-request -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -210,7 +210,7 @@ func (s *AccessRequestsService) ApproveProjectAccessRequest(pid any, user int, o // // GitLab API docs: // https://docs.gitlab.com/api/access_requests/#approve-an-access-request -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) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -235,7 +235,7 @@ func (s *AccessRequestsService) ApproveGroupAccessRequest(gid any, user int, opt // // GitLab API docs: // https://docs.gitlab.com/api/access_requests/#deny-an-access-request -func (s *AccessRequestsService) DenyProjectAccessRequest(pid any, user int, options ...RequestOptionFunc) (*Response, error) { +func (s *AccessRequestsService) DenyProjectAccessRequest(pid any, user int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -254,7 +254,7 @@ func (s *AccessRequestsService) DenyProjectAccessRequest(pid any, user int, opti // // GitLab API docs: // https://docs.gitlab.com/api/access_requests/#deny-an-access-request -func (s *AccessRequestsService) DenyGroupAccessRequest(gid any, user int, options ...RequestOptionFunc) (*Response, error) { +func (s *AccessRequestsService) DenyGroupAccessRequest(gid any, user int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/alert_management.go b/alert_management.go index c7e8b955..1b979c76 100644 --- a/alert_management.go +++ b/alert_management.go @@ -23,10 +23,10 @@ import ( type ( AlertManagementServiceInterface interface { - UploadMetricImage(pid any, alertIID int, content io.Reader, filename string, opt *UploadMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) - ListMetricImages(pid any, alertIID int, opt *ListMetricImagesOptions, options ...RequestOptionFunc) ([]*MetricImage, *Response, error) - UpdateMetricImage(pid any, alertIID int, id int, opt *UpdateMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) - DeleteMetricImage(pid any, alertIID int, id int, options ...RequestOptionFunc) (*Response, error) + UploadMetricImage(pid any, alertIID int64, content io.Reader, filename string, opt *UploadMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) + ListMetricImages(pid any, alertIID int64, opt *ListMetricImagesOptions, options ...RequestOptionFunc) ([]*MetricImage, *Response, error) + UpdateMetricImage(pid any, alertIID int64, id int64, opt *UpdateMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) + DeleteMetricImage(pid any, alertIID int64, id int64, options ...RequestOptionFunc) (*Response, error) } // AlertManagementService handles communication with the alert management @@ -46,7 +46,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"` @@ -67,7 +67,7 @@ type UploadMetricImageOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/alert_management_alerts/#upload-metric-image -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 @@ -100,7 +100,7 @@ type ListMetricImagesOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/alert_management_alerts/#list-metric-images -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -134,7 +134,7 @@ type UpdateMetricImageOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/alert_management_alerts/#update-metric-image -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -159,7 +159,7 @@ func (s *AlertManagementService) UpdateMetricImage(pid any, alertIID int, id int // // GitLab API docs: // https://docs.gitlab.com/api/alert_management_alerts/#delete-metric-image -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) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/applications.go b/applications.go index 345caa96..919ce12e 100644 --- a/applications.go +++ b/applications.go @@ -25,7 +25,7 @@ type ( ApplicationsServiceInterface interface { CreateApplication(opt *CreateApplicationOptions, options ...RequestOptionFunc) (*Application, *Response, error) ListApplications(opt *ListApplicationsOptions, options ...RequestOptionFunc) ([]*Application, *Response, error) - DeleteApplication(application int, options ...RequestOptionFunc) (*Response, error) + DeleteApplication(application int64, options ...RequestOptionFunc) (*Response, error) } // ApplicationsService handles communication with administrables applications @@ -41,7 +41,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"` @@ -106,7 +106,7 @@ func (s *ApplicationsService) ListApplications(opt *ListApplicationsOptions, opt // // GitLab API docs: // https://docs.gitlab.com/api/applications/#delete-an-application -func (s *ApplicationsService) DeleteApplication(application int, options ...RequestOptionFunc) (*Response, error) { +func (s *ApplicationsService) DeleteApplication(application int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("applications/%d", application) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) diff --git a/audit_events.go b/audit_events.go index 3a61d8a4..30b607e3 100644 --- a/audit_events.go +++ b/audit_events.go @@ -9,11 +9,11 @@ import ( type ( AuditEventsServiceInterface interface { ListInstanceAuditEvents(opt *ListAuditEventsOptions, options ...RequestOptionFunc) ([]*AuditEvent, *Response, error) - GetInstanceAuditEvent(event int, options ...RequestOptionFunc) (*AuditEvent, *Response, error) + GetInstanceAuditEvent(event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) ListGroupAuditEvents(gid any, opt *ListAuditEventsOptions, options ...RequestOptionFunc) ([]*AuditEvent, *Response, error) - GetGroupAuditEvent(gid any, event int, options ...RequestOptionFunc) (*AuditEvent, *Response, error) + GetGroupAuditEvent(gid any, event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) ListProjectAuditEvents(pid any, opt *ListAuditEventsOptions, options ...RequestOptionFunc) ([]*AuditEvent, *Response, error) - 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 @@ -31,9 +31,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"` @@ -100,7 +100,7 @@ func (s *AuditEventsService) ListInstanceAuditEvents(opt *ListAuditEventsOptions // Authentication as Administrator is required. // // GitLab API docs: https://docs.gitlab.com/api/audit_events/#retrieve-single-instance-audit-event -func (s *AuditEventsService) GetInstanceAuditEvent(event int, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { +func (s *AuditEventsService) GetInstanceAuditEvent(event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { u := fmt.Sprintf("audit_events/%d", event) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -145,7 +145,7 @@ func (s *AuditEventsService) ListGroupAuditEvents(gid any, opt *ListAuditEventsO // GetGroupAuditEvent gets a specific group audit event. // // GitLab API docs: https://docs.gitlab.com/api/audit_events/#retrieve-a-specific-group-audit-event -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) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -195,7 +195,7 @@ func (s *AuditEventsService) ListProjectAuditEvents(pid any, opt *ListAuditEvent // // GitLab API docs: // https://docs.gitlab.com/api/audit_events/#retrieve-a-specific-project-audit-event -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) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/award_emojis.go b/award_emojis.go index 0ca78941..e1905b3b 100644 --- a/award_emojis.go +++ b/award_emojis.go @@ -24,30 +24,30 @@ import ( type ( AwardEmojiServiceInterface interface { - ListMergeRequestAwardEmoji(pid any, mergeRequestIID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) - ListIssueAwardEmoji(pid any, issueIID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) - ListSnippetAwardEmoji(pid any, snippetID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) - GetMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - GetIssueAwardEmoji(pid any, issueIID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - GetSnippetAwardEmoji(pid any, snippetID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - CreateMergeRequestAwardEmoji(pid any, mergeRequestIID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - CreateIssueAwardEmoji(pid any, issueIID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - CreateSnippetAwardEmoji(pid any, snippetID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - DeleteIssueAwardEmoji(pid any, issueIID, awardID int, options ...RequestOptionFunc) (*Response, error) - DeleteMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int, options ...RequestOptionFunc) (*Response, error) - DeleteSnippetAwardEmoji(pid any, snippetID, awardID int, options ...RequestOptionFunc) (*Response, error) - ListIssuesAwardEmojiOnNote(pid any, issueID, noteID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) - ListMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) - ListSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) - GetIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - GetMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - GetSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - CreateIssuesAwardEmojiOnNote(pid any, issueID, noteID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - CreateMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - CreateSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) - DeleteIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int, options ...RequestOptionFunc) (*Response, error) - DeleteMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int, options ...RequestOptionFunc) (*Response, error) - DeleteSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int, options ...RequestOptionFunc) (*Response, error) + ListMergeRequestAwardEmoji(pid any, mergeRequestIID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + ListIssueAwardEmoji(pid any, issueIID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + ListSnippetAwardEmoji(pid any, snippetID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + GetMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + GetIssueAwardEmoji(pid any, issueIID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + GetSnippetAwardEmoji(pid any, snippetID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateMergeRequestAwardEmoji(pid any, mergeRequestIID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateIssueAwardEmoji(pid any, issueIID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateSnippetAwardEmoji(pid any, snippetID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + DeleteIssueAwardEmoji(pid any, issueIID, awardID int64, options ...RequestOptionFunc) (*Response, error) + DeleteMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int64, options ...RequestOptionFunc) (*Response, error) + DeleteSnippetAwardEmoji(pid any, snippetID, awardID int64, options ...RequestOptionFunc) (*Response, error) + ListIssuesAwardEmojiOnNote(pid any, issueID, noteID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + ListMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + ListSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) + GetIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + GetMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + GetSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateIssuesAwardEmojiOnNote(pid any, issueID, noteID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + CreateSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) + DeleteIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) + DeleteMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) + DeleteSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) } // AwardEmojiService handles communication with the emoji awards related methods @@ -65,12 +65,12 @@ var _ AwardEmojiServiceInterface = (*AwardEmojiService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/emoji_reactions/ type AwardEmoji struct { - ID int `json:"id"` + 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"` } @@ -93,7 +93,7 @@ type ListAwardEmojiOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-an-awardables-emoji-reactions -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...) } @@ -101,7 +101,7 @@ func (s *AwardEmojiService) ListMergeRequestAwardEmoji(pid any, mergeRequestIID // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-an-awardables-emoji-reactions -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...) } @@ -109,11 +109,11 @@ func (s *AwardEmojiService) ListIssueAwardEmoji(pid any, issueIID int, opt *List // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-an-awardables-emoji-reactions -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -142,7 +142,7 @@ func (s *AwardEmojiService) listAwardEmoji(pid any, resource string, resourceID // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-single-emoji-reaction -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...) } @@ -150,7 +150,7 @@ func (s *AwardEmojiService) GetMergeRequestAwardEmoji(pid any, mergeRequestIID, // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-single-emoji-reaction -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...) } @@ -158,11 +158,11 @@ func (s *AwardEmojiService) GetIssueAwardEmoji(pid any, issueIID, awardID int, o // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-single-emoji-reaction -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -201,7 +201,7 @@ type CreateAwardEmojiOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction -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...) } @@ -209,7 +209,7 @@ func (s *AwardEmojiService) CreateMergeRequestAwardEmoji(pid any, mergeRequestII // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction -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...) } @@ -217,11 +217,11 @@ func (s *AwardEmojiService) CreateIssueAwardEmoji(pid any, issueIID int, opt *Cr // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -250,7 +250,7 @@ func (s *AwardEmojiService) createAwardEmoji(pid any, resource string, resourceI // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction -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...) } @@ -258,7 +258,7 @@ func (s *AwardEmojiService) DeleteIssueAwardEmoji(pid any, issueIID, awardID int // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction -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...) } @@ -266,7 +266,7 @@ func (s *AwardEmojiService) DeleteMergeRequestAwardEmoji(pid any, mergeRequestII // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction -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...) } @@ -274,7 +274,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) { project, err := parseID(pid) if err != nil { return nil, err @@ -294,7 +294,7 @@ func (s *AwardEmojiService) deleteAwardEmoji(pid any, resource string, resourceI // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-a-comments-emoji-reactions -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...) } @@ -303,7 +303,7 @@ func (s *AwardEmojiService) ListIssuesAwardEmojiOnNote(pid any, issueID, noteID // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-a-comments-emoji-reactions -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...) } @@ -312,11 +312,11 @@ func (s *AwardEmojiService) ListMergeRequestAwardEmojiOnNote(pid any, mergeReque // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#list-a-comments-emoji-reactions -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -342,7 +342,7 @@ func (s *AwardEmojiService) listAwardEmojiOnNote(pid any, resources string, reso // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-an-emoji-reaction-for-a-comment -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...) } @@ -351,7 +351,7 @@ func (s *AwardEmojiService) GetIssuesAwardEmojiOnNote(pid any, issueID, noteID, // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-an-emoji-reaction-for-a-comment -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...) } @@ -360,11 +360,11 @@ func (s *AwardEmojiService) GetMergeRequestAwardEmojiOnNote(pid any, mergeReques // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#get-an-emoji-reaction-for-a-comment -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -395,7 +395,7 @@ func (s *AwardEmojiService) getSingleNoteAwardEmoji(pid any, resource string, re // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction-to-a-comment -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...) } @@ -404,7 +404,7 @@ func (s *AwardEmojiService) CreateIssuesAwardEmojiOnNote(pid any, issueID, noteI // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction-to-a-comment -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...) } @@ -412,7 +412,7 @@ func (s *AwardEmojiService) CreateMergeRequestAwardEmojiOnNote(pid any, mergeReq // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction-to-a-comment -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...) } @@ -420,7 +420,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -450,7 +450,7 @@ func (s *AwardEmojiService) createAwardEmojiOnNote(pid any, resource string, res // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction-from-a-comment -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...) } @@ -459,7 +459,7 @@ func (s *AwardEmojiService) DeleteIssuesAwardEmojiOnNote(pid any, issueID, noteI // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction-from-a-comment -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...) } @@ -468,11 +468,11 @@ func (s *AwardEmojiService) DeleteMergeRequestAwardEmojiOnNote(pid any, mergeReq // // GitLab API docs: // https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction-from-a-comment -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) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/award_emojis_test.go b/award_emojis_test.go index 6d946098..2a6253d0 100644 --- a/award_emojis_test.go +++ b/award_emojis_test.go @@ -1402,7 +1402,7 @@ func TestAwardEmojiService_EdgeCases(t *testing.T) { require.NoError(t, err) require.NotNil(t, resp) require.Len(t, aes, 1) - require.Equal(t, 0, aes[0].AwardableID) + require.Equal(t, int64(0), aes[0].AwardableID) require.Empty(t, aes[0].AwardableType) }, }, diff --git a/boards.go b/boards.go index e88e72c4..ed504fed 100644 --- a/boards.go +++ b/boards.go @@ -24,15 +24,15 @@ import ( type ( IssueBoardsServiceInterface interface { CreateIssueBoard(pid any, opt *CreateIssueBoardOptions, options ...RequestOptionFunc) (*IssueBoard, *Response, error) - UpdateIssueBoard(pid any, board int, opt *UpdateIssueBoardOptions, options ...RequestOptionFunc) (*IssueBoard, *Response, error) - DeleteIssueBoard(pid any, board int, options ...RequestOptionFunc) (*Response, error) + UpdateIssueBoard(pid any, board int64, opt *UpdateIssueBoardOptions, options ...RequestOptionFunc) (*IssueBoard, *Response, error) + DeleteIssueBoard(pid any, board int64, options ...RequestOptionFunc) (*Response, error) ListIssueBoards(pid any, opt *ListIssueBoardsOptions, options ...RequestOptionFunc) ([]*IssueBoard, *Response, error) - GetIssueBoard(pid any, board int, options ...RequestOptionFunc) (*IssueBoard, *Response, error) - GetIssueBoardLists(pid any, board int, opt *GetIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) - GetIssueBoardList(pid any, board, list int, options ...RequestOptionFunc) (*BoardList, *Response, error) - CreateIssueBoardList(pid any, board int, opt *CreateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) - UpdateIssueBoardList(pid any, board, list int, opt *UpdateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) - DeleteIssueBoardList(pid any, board, list int, options ...RequestOptionFunc) (*Response, error) + GetIssueBoard(pid any, board int64, options ...RequestOptionFunc) (*IssueBoard, *Response, error) + GetIssueBoardLists(pid any, board int64, opt *GetIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) + GetIssueBoardList(pid any, board, list int64, options ...RequestOptionFunc) (*BoardList, *Response, error) + CreateIssueBoardList(pid any, board int64, opt *CreateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) + UpdateIssueBoardList(pid any, board, list int64, opt *UpdateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) + DeleteIssueBoardList(pid any, board, list int64, options ...RequestOptionFunc) (*Response, error) } // IssueBoardsService handles communication with the issue board related @@ -50,13 +50,13 @@ var _ IssueBoardsServiceInterface = (*IssueBoardsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/boards/ type IssueBoard struct { - ID int `json:"id"` + 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 int `json:"weight"` + Weight int64 `json:"weight"` Labels []*LabelDetails `json:"labels"` } @@ -68,14 +68,14 @@ func (b IssueBoard) String() string { // // GitLab API docs: https://docs.gitlab.com/api/boards/ type BoardList struct { - ID int `json:"id"` + ID int64 `json:"id"` Assignee *BoardListAssignee `json:"assignee"` Iteration *ProjectIteration `json:"iteration"` Label *Label `json:"label"` - MaxIssueCount int `json:"max_issue_count"` - MaxIssueWeight int `json:"max_issue_weight"` + MaxIssueCount int64 `json:"max_issue_count"` + MaxIssueWeight int64 `json:"max_issue_weight"` Milestone *Milestone `json:"milestone"` - Position int `json:"position"` + Position int64 `json:"position"` } func (b BoardList) String() string { @@ -86,7 +86,7 @@ func (b BoardList) String() string { // // GitLab API docs: https://docs.gitlab.com/api/boards/ type BoardListAssignee struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Username string `json:"username"` } @@ -131,16 +131,16 @@ 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"` } // UpdateIssueBoard update an issue board. // // GitLab API docs: https://docs.gitlab.com/api/boards/#update-an-issue-board -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -164,7 +164,7 @@ func (s *IssueBoardsService) UpdateIssueBoard(pid any, board int, opt *UpdateIss // DeleteIssueBoard deletes an issue board. // // GitLab API docs: https://docs.gitlab.com/api/boards/#delete-an-issue-board -func (s *IssueBoardsService) DeleteIssueBoard(pid any, board int, options ...RequestOptionFunc) (*Response, error) { +func (s *IssueBoardsService) DeleteIssueBoard(pid any, board int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -213,7 +213,7 @@ func (s *IssueBoardsService) ListIssueBoards(pid any, opt *ListIssueBoardsOption // GetIssueBoard gets a single issue board of a project. // // GitLab API docs: https://docs.gitlab.com/api/boards/#show-a-single-issue-board -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -245,7 +245,7 @@ type GetIssueBoardListsOptions struct { // backlog and closed lists. // // GitLab API docs: https://docs.gitlab.com/api/boards/#list-board-lists-in-a-project-issue-board -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -269,7 +269,7 @@ func (s *IssueBoardsService) GetIssueBoardLists(pid any, board int, opt *GetIssu // GetIssueBoardList gets a single issue board list. // // GitLab API docs: https://docs.gitlab.com/api/boards/#show-a-single-board-list -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -299,16 +299,16 @@ 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"` } // CreateIssueBoardList creates a new issue board list. // // GitLab API docs: https://docs.gitlab.com/api/boards/#create-a-board-list -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -334,13 +334,13 @@ 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"` } // 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 -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -370,7 +370,7 @@ func (s *IssueBoardsService) UpdateIssueBoardList(pid any, board, list int, opt // // GitLab API docs: // https://docs.gitlab.com/api/boards/#delete-a-board-list-from-a-board -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) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/broadcast_messages.go b/broadcast_messages.go index 92adf6df..0f0e78aa 100644 --- a/broadcast_messages.go +++ b/broadcast_messages.go @@ -25,10 +25,10 @@ import ( type ( BroadcastMessagesServiceInterface interface { ListBroadcastMessages(opt *ListBroadcastMessagesOptions, options ...RequestOptionFunc) ([]*BroadcastMessage, *Response, error) - GetBroadcastMessage(broadcast int, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) + GetBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) CreateBroadcastMessage(opt *CreateBroadcastMessageOptions, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) - UpdateBroadcastMessage(broadcast int, opt *UpdateBroadcastMessageOptions, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) - DeleteBroadcastMessage(broadcast int, options ...RequestOptionFunc) (*Response, error) + UpdateBroadcastMessage(broadcast int64, opt *UpdateBroadcastMessageOptions, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) + DeleteBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*Response, error) } // BroadcastMessagesService handles communication with the broadcast @@ -51,7 +51,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"` @@ -92,7 +92,7 @@ func (s *BroadcastMessagesService) ListBroadcastMessages(opt *ListBroadcastMessa // // GitLab API docs: // https://docs.gitlab.com/api/broadcast_messages/#get-a-specific-broadcast-message -func (s *BroadcastMessagesService) GetBroadcastMessage(broadcast int, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) { +func (s *BroadcastMessagesService) GetBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) { u := fmt.Sprintf("broadcast_messages/%d", broadcast) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -166,7 +166,7 @@ type UpdateBroadcastMessageOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/broadcast_messages/#update-a-broadcast-message -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) { u := fmt.Sprintf("broadcast_messages/%d", broadcast) req, err := s.client.NewRequest(http.MethodPut, u, opt, options) @@ -187,7 +187,7 @@ func (s *BroadcastMessagesService) UpdateBroadcastMessage(broadcast int, opt *Up // // GitLab API docs: // https://docs.gitlab.com/api/broadcast_messages/#delete-a-broadcast-message -func (s *BroadcastMessagesService) DeleteBroadcastMessage(broadcast int, options ...RequestOptionFunc) (*Response, error) { +func (s *BroadcastMessagesService) DeleteBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("broadcast_messages/%d", broadcast) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) diff --git a/cluster_agents.go b/cluster_agents.go index 878a4033..6eaeac49 100644 --- a/cluster_agents.go +++ b/cluster_agents.go @@ -25,13 +25,13 @@ import ( type ( ClusterAgentsServiceInterface interface { ListAgents(pid any, opt *ListAgentsOptions, options ...RequestOptionFunc) ([]*Agent, *Response, error) - GetAgent(pid any, id int, options ...RequestOptionFunc) (*Agent, *Response, error) + GetAgent(pid any, id int64, options ...RequestOptionFunc) (*Agent, *Response, error) RegisterAgent(pid any, opt *RegisterAgentOptions, options ...RequestOptionFunc) (*Agent, *Response, error) - DeleteAgent(pid any, id int, options ...RequestOptionFunc) (*Response, error) - ListAgentTokens(pid any, aid int, opt *ListAgentTokensOptions, options ...RequestOptionFunc) ([]*AgentToken, *Response, error) - GetAgentToken(pid any, aid int, id int, options ...RequestOptionFunc) (*AgentToken, *Response, error) - CreateAgentToken(pid any, aid int, opt *CreateAgentTokenOptions, options ...RequestOptionFunc) (*AgentToken, *Response, error) - RevokeAgentToken(pid any, aid int, id int, options ...RequestOptionFunc) (*Response, error) + DeleteAgent(pid any, id int64, options ...RequestOptionFunc) (*Response, error) + ListAgentTokens(pid any, aid int64, opt *ListAgentTokensOptions, options ...RequestOptionFunc) ([]*AgentToken, *Response, error) + GetAgentToken(pid any, aid int64, id int64, options ...RequestOptionFunc) (*AgentToken, *Response, error) + CreateAgentToken(pid any, aid int64, opt *CreateAgentTokenOptions, options ...RequestOptionFunc) (*AgentToken, *Response, error) + RevokeAgentToken(pid any, aid int64, id int64, options ...RequestOptionFunc) (*Response, error) } // ClusterAgentsService handles communication with the cluster agents related @@ -49,7 +49,7 @@ 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"` @@ -57,7 +57,7 @@ type Agent struct { } 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"` @@ -75,7 +75,7 @@ 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"` @@ -127,7 +127,7 @@ func (s *ClusterAgentsService) ListAgents(pid any, opt *ListAgentsOptions, optio // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#get-details-about-an-agent -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -186,7 +186,7 @@ func (s *ClusterAgentsService) RegisterAgent(pid any, opt *RegisterAgentOptions, // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#delete-a-registered-agent -func (s *ClusterAgentsService) DeleteAgent(pid any, id int, options ...RequestOptionFunc) (*Response, error) { +func (s *ClusterAgentsService) DeleteAgent(pid any, id int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -213,7 +213,7 @@ type ListAgentTokensOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#list-tokens-for-an-agent -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -238,7 +238,7 @@ func (s *ClusterAgentsService) ListAgentTokens(pid any, aid int, opt *ListAgentT // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#get-a-single-agent-token -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -272,7 +272,7 @@ type CreateAgentTokenOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#create-an-agent-token -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -297,7 +297,7 @@ func (s *ClusterAgentsService) CreateAgentToken(pid any, aid int, opt *CreateAge // // GitLab API docs: // https://docs.gitlab.com/api/cluster_agents/#revoke-an-agent-token -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) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/commits.go b/commits.go index db110f85..5a158619 100644 --- a/commits.go +++ b/commits.go @@ -331,7 +331,7 @@ type CommitComment struct { // 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"` @@ -432,7 +432,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"` diff --git a/container_registry.go b/container_registry.go index 0044e160..06a33e7d 100644 --- a/container_registry.go +++ b/container_registry.go @@ -27,11 +27,11 @@ type ( ListProjectRegistryRepositories(pid any, opt *ListProjectRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) ListGroupRegistryRepositories(gid any, opt *ListGroupRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) GetSingleRegistryRepository(pid any, opt *GetSingleRegistryRepositoryOptions, options ...RequestOptionFunc) (*RegistryRepository, *Response, error) - DeleteRegistryRepository(pid any, repository int, options ...RequestOptionFunc) (*Response, error) - ListRegistryRepositoryTags(pid any, repository int, opt *ListRegistryRepositoryTagsOptions, options ...RequestOptionFunc) ([]*RegistryRepositoryTag, *Response, error) - GetRegistryRepositoryTagDetail(pid any, repository int, tagName string, options ...RequestOptionFunc) (*RegistryRepositoryTag, *Response, error) - DeleteRegistryRepositoryTag(pid any, repository int, tagName string, options ...RequestOptionFunc) (*Response, error) - DeleteRegistryRepositoryTags(pid any, repository int, opt *DeleteRegistryRepositoryTagsOptions, options ...RequestOptionFunc) (*Response, error) + DeleteRegistryRepository(pid any, repository int64, options ...RequestOptionFunc) (*Response, error) + ListRegistryRepositoryTags(pid any, repository int64, opt *ListRegistryRepositoryTagsOptions, options ...RequestOptionFunc) ([]*RegistryRepositoryTag, *Response, error) + GetRegistryRepositoryTagDetail(pid any, repository int64, tagName string, options ...RequestOptionFunc) (*RegistryRepositoryTag, *Response, error) + DeleteRegistryRepositoryTag(pid any, repository int64, tagName string, options ...RequestOptionFunc) (*Response, error) + DeleteRegistryRepositoryTags(pid any, repository int64, opt *DeleteRegistryRepositoryTagsOptions, options ...RequestOptionFunc) (*Response, error) } // ContainerRegistryService handles communication with the container registry @@ -49,10 +49,10 @@ 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"` @@ -76,7 +76,7 @@ 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 { @@ -193,7 +193,7 @@ func (s *ContainerRegistryService) GetSingleRegistryRepository(pid any, opt *Get // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#delete-registry-repository -func (s *ContainerRegistryService) DeleteRegistryRepository(pid any, repository int, options ...RequestOptionFunc) (*Response, error) { +func (s *ContainerRegistryService) DeleteRegistryRepository(pid any, repository int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -221,7 +221,7 @@ type ListRegistryRepositoryTagsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#list-registry-repository-tags -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -249,7 +249,7 @@ func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid any, repositor // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#get-details-of-a-registry-repository-tag -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -278,7 +278,7 @@ func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid any, repos // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#delete-a-registry-repository-tag -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) { project, err := parseID(pid) if err != nil { return nil, err @@ -305,7 +305,7 @@ 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. @@ -317,7 +317,7 @@ type DeleteRegistryRepositoryTagsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/container_registry/#delete-registry-repository-tags-in-bulk -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) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/container_registry_test.go b/container_registry_test.go index 5587c22e..1c82ad6d 100644 --- a/container_registry_test.go +++ b/container_registry_test.go @@ -295,7 +295,7 @@ func TestDeleteRegistryRepositoryTags(t *testing.T) { tests := []struct { event string nameRegexDelete string - keepN int + keepN int64 nameRegexKeep string olderThan string }{ diff --git a/testing/access_requests_mock.go b/testing/access_requests_mock.go index e570ba81..5b4790cb 100644 --- a/testing/access_requests_mock.go +++ b/testing/access_requests_mock.go @@ -41,7 +41,7 @@ func (m *MockAccessRequestsServiceInterface) EXPECT() *MockAccessRequestsService } // ApproveGroupAccessRequest mocks base method. -func (m *MockAccessRequestsServiceInterface) ApproveGroupAccessRequest(gid any, user int, opt *gitlab.ApproveAccessRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error) { +func (m *MockAccessRequestsServiceInterface) ApproveGroupAccessRequest(gid any, user int64, opt *gitlab.ApproveAccessRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, user, opt} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockAccessRequestsServiceInterfaceApproveGroupAccessRequestCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockAccessRequestsServiceInterfaceApproveGroupAccessRequestCall) Do(f func(any, int, *gitlab.ApproveAccessRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error)) *MockAccessRequestsServiceInterfaceApproveGroupAccessRequestCall { +func (c *MockAccessRequestsServiceInterfaceApproveGroupAccessRequestCall) Do(f func(any, int64, *gitlab.ApproveAccessRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error)) *MockAccessRequestsServiceInterfaceApproveGroupAccessRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAccessRequestsServiceInterfaceApproveGroupAccessRequestCall) DoAndReturn(f func(any, int, *gitlab.ApproveAccessRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error)) *MockAccessRequestsServiceInterfaceApproveGroupAccessRequestCall { +func (c *MockAccessRequestsServiceInterfaceApproveGroupAccessRequestCall) DoAndReturn(f func(any, int64, *gitlab.ApproveAccessRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error)) *MockAccessRequestsServiceInterfaceApproveGroupAccessRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // ApproveProjectAccessRequest mocks base method. -func (m *MockAccessRequestsServiceInterface) ApproveProjectAccessRequest(pid any, user int, opt *gitlab.ApproveAccessRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error) { +func (m *MockAccessRequestsServiceInterface) ApproveProjectAccessRequest(pid any, user int64, opt *gitlab.ApproveAccessRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, user, opt} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockAccessRequestsServiceInterfaceApproveProjectAccessRequestCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockAccessRequestsServiceInterfaceApproveProjectAccessRequestCall) Do(f func(any, int, *gitlab.ApproveAccessRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error)) *MockAccessRequestsServiceInterfaceApproveProjectAccessRequestCall { +func (c *MockAccessRequestsServiceInterfaceApproveProjectAccessRequestCall) Do(f func(any, int64, *gitlab.ApproveAccessRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error)) *MockAccessRequestsServiceInterfaceApproveProjectAccessRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAccessRequestsServiceInterfaceApproveProjectAccessRequestCall) DoAndReturn(f func(any, int, *gitlab.ApproveAccessRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error)) *MockAccessRequestsServiceInterfaceApproveProjectAccessRequestCall { +func (c *MockAccessRequestsServiceInterfaceApproveProjectAccessRequestCall) DoAndReturn(f func(any, int64, *gitlab.ApproveAccessRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.AccessRequest, *gitlab.Response, error)) *MockAccessRequestsServiceInterfaceApproveProjectAccessRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // DenyGroupAccessRequest mocks base method. -func (m *MockAccessRequestsServiceInterface) DenyGroupAccessRequest(gid any, user int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockAccessRequestsServiceInterface) DenyGroupAccessRequest(gid any, user int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, user} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockAccessRequestsServiceInterfaceDenyGroupAccessRequestCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockAccessRequestsServiceInterfaceDenyGroupAccessRequestCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAccessRequestsServiceInterfaceDenyGroupAccessRequestCall { +func (c *MockAccessRequestsServiceInterfaceDenyGroupAccessRequestCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAccessRequestsServiceInterfaceDenyGroupAccessRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAccessRequestsServiceInterfaceDenyGroupAccessRequestCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAccessRequestsServiceInterfaceDenyGroupAccessRequestCall { +func (c *MockAccessRequestsServiceInterfaceDenyGroupAccessRequestCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAccessRequestsServiceInterfaceDenyGroupAccessRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // DenyProjectAccessRequest mocks base method. -func (m *MockAccessRequestsServiceInterface) DenyProjectAccessRequest(pid any, user int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockAccessRequestsServiceInterface) DenyProjectAccessRequest(pid any, user int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, user} for _, a := range options { @@ -207,13 +207,13 @@ func (c *MockAccessRequestsServiceInterfaceDenyProjectAccessRequestCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockAccessRequestsServiceInterfaceDenyProjectAccessRequestCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAccessRequestsServiceInterfaceDenyProjectAccessRequestCall { +func (c *MockAccessRequestsServiceInterfaceDenyProjectAccessRequestCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAccessRequestsServiceInterfaceDenyProjectAccessRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAccessRequestsServiceInterfaceDenyProjectAccessRequestCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAccessRequestsServiceInterfaceDenyProjectAccessRequestCall { +func (c *MockAccessRequestsServiceInterfaceDenyProjectAccessRequestCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAccessRequestsServiceInterfaceDenyProjectAccessRequestCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/alert_management_mock.go b/testing/alert_management_mock.go index 686580a4..3ad9db3a 100644 --- a/testing/alert_management_mock.go +++ b/testing/alert_management_mock.go @@ -42,7 +42,7 @@ func (m *MockAlertManagementServiceInterface) EXPECT() *MockAlertManagementServi } // DeleteMetricImage mocks base method. -func (m *MockAlertManagementServiceInterface) DeleteMetricImage(pid any, alertIID, id int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockAlertManagementServiceInterface) DeleteMetricImage(pid any, alertIID, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, alertIID, id} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockAlertManagementServiceInterfaceDeleteMetricImageCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockAlertManagementServiceInterfaceDeleteMetricImageCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAlertManagementServiceInterfaceDeleteMetricImageCall { +func (c *MockAlertManagementServiceInterfaceDeleteMetricImageCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAlertManagementServiceInterfaceDeleteMetricImageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAlertManagementServiceInterfaceDeleteMetricImageCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAlertManagementServiceInterfaceDeleteMetricImageCall { +func (c *MockAlertManagementServiceInterfaceDeleteMetricImageCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAlertManagementServiceInterfaceDeleteMetricImageCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMetricImages mocks base method. -func (m *MockAlertManagementServiceInterface) ListMetricImages(pid any, alertIID int, opt *gitlab.ListMetricImagesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MetricImage, *gitlab.Response, error) { +func (m *MockAlertManagementServiceInterface) ListMetricImages(pid any, alertIID int64, opt *gitlab.ListMetricImagesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MetricImage, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, alertIID, opt} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockAlertManagementServiceInterfaceListMetricImagesCall) Return(arg0 [] } // Do rewrite *gomock.Call.Do -func (c *MockAlertManagementServiceInterfaceListMetricImagesCall) Do(f func(any, int, *gitlab.ListMetricImagesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceListMetricImagesCall { +func (c *MockAlertManagementServiceInterfaceListMetricImagesCall) Do(f func(any, int64, *gitlab.ListMetricImagesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceListMetricImagesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAlertManagementServiceInterfaceListMetricImagesCall) DoAndReturn(f func(any, int, *gitlab.ListMetricImagesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceListMetricImagesCall { +func (c *MockAlertManagementServiceInterfaceListMetricImagesCall) DoAndReturn(f func(any, int64, *gitlab.ListMetricImagesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceListMetricImagesCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateMetricImage mocks base method. -func (m *MockAlertManagementServiceInterface) UpdateMetricImage(pid any, alertIID, id int, opt *gitlab.UpdateMetricImageOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error) { +func (m *MockAlertManagementServiceInterface) UpdateMetricImage(pid any, alertIID, id int64, opt *gitlab.UpdateMetricImageOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, alertIID, id, opt} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockAlertManagementServiceInterfaceUpdateMetricImageCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockAlertManagementServiceInterfaceUpdateMetricImageCall) Do(f func(any, int, int, *gitlab.UpdateMetricImageOptions, ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceUpdateMetricImageCall { +func (c *MockAlertManagementServiceInterfaceUpdateMetricImageCall) Do(f func(any, int64, int64, *gitlab.UpdateMetricImageOptions, ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceUpdateMetricImageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAlertManagementServiceInterfaceUpdateMetricImageCall) DoAndReturn(f func(any, int, int, *gitlab.UpdateMetricImageOptions, ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceUpdateMetricImageCall { +func (c *MockAlertManagementServiceInterfaceUpdateMetricImageCall) DoAndReturn(f func(any, int64, int64, *gitlab.UpdateMetricImageOptions, ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceUpdateMetricImageCall { c.Call = c.Call.DoAndReturn(f) return c } // UploadMetricImage mocks base method. -func (m *MockAlertManagementServiceInterface) UploadMetricImage(pid any, alertIID int, content io.Reader, filename string, opt *gitlab.UploadMetricImageOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error) { +func (m *MockAlertManagementServiceInterface) UploadMetricImage(pid any, alertIID int64, content io.Reader, filename string, opt *gitlab.UploadMetricImageOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, alertIID, content, filename, opt} for _, a := range options { @@ -209,13 +209,13 @@ func (c *MockAlertManagementServiceInterfaceUploadMetricImageCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockAlertManagementServiceInterfaceUploadMetricImageCall) Do(f func(any, int, io.Reader, string, *gitlab.UploadMetricImageOptions, ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceUploadMetricImageCall { +func (c *MockAlertManagementServiceInterfaceUploadMetricImageCall) Do(f func(any, int64, io.Reader, string, *gitlab.UploadMetricImageOptions, ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceUploadMetricImageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAlertManagementServiceInterfaceUploadMetricImageCall) DoAndReturn(f func(any, int, io.Reader, string, *gitlab.UploadMetricImageOptions, ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceUploadMetricImageCall { +func (c *MockAlertManagementServiceInterfaceUploadMetricImageCall) DoAndReturn(f func(any, int64, io.Reader, string, *gitlab.UploadMetricImageOptions, ...gitlab.RequestOptionFunc) (*gitlab.MetricImage, *gitlab.Response, error)) *MockAlertManagementServiceInterfaceUploadMetricImageCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/applications_mock.go b/testing/applications_mock.go index f314af86..93034e07 100644 --- a/testing/applications_mock.go +++ b/testing/applications_mock.go @@ -86,7 +86,7 @@ func (c *MockApplicationsServiceInterfaceCreateApplicationCall) DoAndReturn(f fu } // DeleteApplication mocks base method. -func (m *MockApplicationsServiceInterface) DeleteApplication(application int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockApplicationsServiceInterface) DeleteApplication(application int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{application} for _, a := range options { @@ -118,13 +118,13 @@ func (c *MockApplicationsServiceInterfaceDeleteApplicationCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockApplicationsServiceInterfaceDeleteApplicationCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockApplicationsServiceInterfaceDeleteApplicationCall { +func (c *MockApplicationsServiceInterfaceDeleteApplicationCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockApplicationsServiceInterfaceDeleteApplicationCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockApplicationsServiceInterfaceDeleteApplicationCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockApplicationsServiceInterfaceDeleteApplicationCall { +func (c *MockApplicationsServiceInterfaceDeleteApplicationCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockApplicationsServiceInterfaceDeleteApplicationCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/audit_events_mock.go b/testing/audit_events_mock.go index 73680a34..8031698a 100644 --- a/testing/audit_events_mock.go +++ b/testing/audit_events_mock.go @@ -41,7 +41,7 @@ func (m *MockAuditEventsServiceInterface) EXPECT() *MockAuditEventsServiceInterf } // GetGroupAuditEvent mocks base method. -func (m *MockAuditEventsServiceInterface) GetGroupAuditEvent(gid any, event int, options ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error) { +func (m *MockAuditEventsServiceInterface) GetGroupAuditEvent(gid any, event int64, options ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, event} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockAuditEventsServiceInterfaceGetGroupAuditEventCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockAuditEventsServiceInterfaceGetGroupAuditEventCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetGroupAuditEventCall { +func (c *MockAuditEventsServiceInterfaceGetGroupAuditEventCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetGroupAuditEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAuditEventsServiceInterfaceGetGroupAuditEventCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetGroupAuditEventCall { +func (c *MockAuditEventsServiceInterfaceGetGroupAuditEventCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetGroupAuditEventCall { c.Call = c.Call.DoAndReturn(f) return c } // GetInstanceAuditEvent mocks base method. -func (m *MockAuditEventsServiceInterface) GetInstanceAuditEvent(event int, options ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error) { +func (m *MockAuditEventsServiceInterface) GetInstanceAuditEvent(event int64, options ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{event} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockAuditEventsServiceInterfaceGetInstanceAuditEventCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockAuditEventsServiceInterfaceGetInstanceAuditEventCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetInstanceAuditEventCall { +func (c *MockAuditEventsServiceInterfaceGetInstanceAuditEventCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetInstanceAuditEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAuditEventsServiceInterfaceGetInstanceAuditEventCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetInstanceAuditEventCall { +func (c *MockAuditEventsServiceInterfaceGetInstanceAuditEventCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetInstanceAuditEventCall { c.Call = c.Call.DoAndReturn(f) return c } // GetProjectAuditEvent mocks base method. -func (m *MockAuditEventsServiceInterface) GetProjectAuditEvent(pid any, event int, options ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error) { +func (m *MockAuditEventsServiceInterface) GetProjectAuditEvent(pid any, event int64, options ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, event} for _, a := range options { @@ -164,13 +164,13 @@ func (c *MockAuditEventsServiceInterfaceGetProjectAuditEventCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockAuditEventsServiceInterfaceGetProjectAuditEventCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetProjectAuditEventCall { +func (c *MockAuditEventsServiceInterfaceGetProjectAuditEventCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetProjectAuditEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAuditEventsServiceInterfaceGetProjectAuditEventCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetProjectAuditEventCall { +func (c *MockAuditEventsServiceInterfaceGetProjectAuditEventCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.AuditEvent, *gitlab.Response, error)) *MockAuditEventsServiceInterfaceGetProjectAuditEventCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/award_emojis_mock.go b/testing/award_emojis_mock.go index 73309871..dcce8ffc 100644 --- a/testing/award_emojis_mock.go +++ b/testing/award_emojis_mock.go @@ -41,7 +41,7 @@ func (m *MockAwardEmojiServiceInterface) EXPECT() *MockAwardEmojiServiceInterfac } // CreateIssueAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) CreateIssueAwardEmoji(pid any, issueIID int, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) CreateIssueAwardEmoji(pid any, issueIID int64, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issueIID, opt} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockAwardEmojiServiceInterfaceCreateIssueAwardEmojiCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceCreateIssueAwardEmojiCall) Do(f func(any, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateIssueAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceCreateIssueAwardEmojiCall) Do(f func(any, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateIssueAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceCreateIssueAwardEmojiCall) DoAndReturn(f func(any, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateIssueAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceCreateIssueAwardEmojiCall) DoAndReturn(f func(any, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateIssueAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateIssuesAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) CreateIssuesAwardEmojiOnNote(pid any, issueID, noteID int, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) CreateIssuesAwardEmojiOnNote(pid any, issueID, noteID int64, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issueID, noteID, opt} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockAwardEmojiServiceInterfaceCreateIssuesAwardEmojiOnNoteCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceCreateIssuesAwardEmojiOnNoteCall) Do(f func(any, int, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateIssuesAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceCreateIssuesAwardEmojiOnNoteCall) Do(f func(any, int64, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateIssuesAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceCreateIssuesAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateIssuesAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceCreateIssuesAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateIssuesAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateMergeRequestAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) CreateMergeRequestAwardEmoji(pid any, mergeRequestIID int, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) CreateMergeRequestAwardEmoji(pid any, mergeRequestIID int64, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequestIID, opt} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiCall) Do(f func(any, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiCall) Do(f func(any, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiCall) DoAndReturn(f func(any, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiCall) DoAndReturn(f func(any, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateMergeRequestAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) CreateMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) CreateMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int64, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequestIID, noteID, opt} for _, a := range options { @@ -209,19 +209,19 @@ func (c *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiOnNoteCall) R } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiOnNoteCall) Do(f func(any, int, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiOnNoteCall) Do(f func(any, int64, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateMergeRequestAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateSnippetAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) CreateSnippetAwardEmoji(pid any, snippetID int, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) CreateSnippetAwardEmoji(pid any, snippetID int64, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippetID, opt} for _, a := range options { @@ -254,19 +254,19 @@ func (c *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiCall) Do(f func(any, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiCall) Do(f func(any, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiCall) DoAndReturn(f func(any, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiCall) DoAndReturn(f func(any, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateSnippetAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) CreateSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) CreateSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int64, opt *gitlab.CreateAwardEmojiOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippetIID, noteID, opt} for _, a := range options { @@ -299,19 +299,19 @@ func (c *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiOnNoteCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiOnNoteCall) Do(f func(any, int, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiOnNoteCall) Do(f func(any, int64, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.CreateAwardEmojiOptions, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceCreateSnippetAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteIssueAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) DeleteIssueAwardEmoji(pid any, issueIID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) DeleteIssueAwardEmoji(pid any, issueIID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issueIID, awardID} for _, a := range options { @@ -343,19 +343,19 @@ func (c *MockAwardEmojiServiceInterfaceDeleteIssueAwardEmojiCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceDeleteIssueAwardEmojiCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteIssueAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceDeleteIssueAwardEmojiCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteIssueAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceDeleteIssueAwardEmojiCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteIssueAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceDeleteIssueAwardEmojiCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteIssueAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteIssuesAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) DeleteIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) DeleteIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issueID, noteID, awardID} for _, a := range options { @@ -387,19 +387,19 @@ func (c *MockAwardEmojiServiceInterfaceDeleteIssuesAwardEmojiOnNoteCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceDeleteIssuesAwardEmojiOnNoteCall) Do(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteIssuesAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceDeleteIssuesAwardEmojiOnNoteCall) Do(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteIssuesAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceDeleteIssuesAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteIssuesAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceDeleteIssuesAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteIssuesAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteMergeRequestAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) DeleteMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) DeleteMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequestIID, awardID} for _, a := range options { @@ -431,19 +431,19 @@ func (c *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteMergeRequestAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) DeleteMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) DeleteMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequestIID, noteID, awardID} for _, a := range options { @@ -475,19 +475,19 @@ func (c *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiOnNoteCall) R } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiOnNoteCall) Do(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiOnNoteCall) Do(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteMergeRequestAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteSnippetAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) DeleteSnippetAwardEmoji(pid any, snippetID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) DeleteSnippetAwardEmoji(pid any, snippetID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippetID, awardID} for _, a := range options { @@ -519,19 +519,19 @@ func (c *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteSnippetAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) DeleteSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) DeleteSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippetIID, noteID, awardID} for _, a := range options { @@ -563,19 +563,19 @@ func (c *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiOnNoteCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiOnNoteCall) Do(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiOnNoteCall) Do(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockAwardEmojiServiceInterfaceDeleteSnippetAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssueAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) GetIssueAwardEmoji(pid any, issueIID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) GetIssueAwardEmoji(pid any, issueIID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issueIID, awardID} for _, a := range options { @@ -608,19 +608,19 @@ func (c *MockAwardEmojiServiceInterfaceGetIssueAwardEmojiCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceGetIssueAwardEmojiCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetIssueAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceGetIssueAwardEmojiCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetIssueAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceGetIssueAwardEmojiCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetIssueAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceGetIssueAwardEmojiCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetIssueAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssuesAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) GetIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) GetIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issueID, noteID, awardID} for _, a := range options { @@ -653,19 +653,19 @@ func (c *MockAwardEmojiServiceInterfaceGetIssuesAwardEmojiOnNoteCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceGetIssuesAwardEmojiOnNoteCall) Do(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetIssuesAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceGetIssuesAwardEmojiOnNoteCall) Do(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetIssuesAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceGetIssuesAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetIssuesAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceGetIssuesAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetIssuesAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) GetMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) GetMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequestIID, awardID} for _, a := range options { @@ -698,19 +698,19 @@ func (c *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) GetMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) GetMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequestIID, noteID, awardID} for _, a := range options { @@ -743,19 +743,19 @@ func (c *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiOnNoteCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiOnNoteCall) Do(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiOnNoteCall) Do(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetMergeRequestAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // GetSnippetAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) GetSnippetAwardEmoji(pid any, snippetID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) GetSnippetAwardEmoji(pid any, snippetID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippetID, awardID} for _, a := range options { @@ -788,19 +788,19 @@ func (c *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiCall) Return(arg0 *gi } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // GetSnippetAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) GetSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) GetSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int64, options ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippetIID, noteID, awardID} for _, a := range options { @@ -833,19 +833,19 @@ func (c *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiOnNoteCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiOnNoteCall) Do(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiOnNoteCall) Do(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceGetSnippetAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // ListIssueAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) ListIssueAwardEmoji(pid any, issueIID int, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) ListIssueAwardEmoji(pid any, issueIID int64, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issueIID, opt} for _, a := range options { @@ -878,19 +878,19 @@ func (c *MockAwardEmojiServiceInterfaceListIssueAwardEmojiCall) Return(arg0 []*g } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceListIssueAwardEmojiCall) Do(f func(any, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListIssueAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceListIssueAwardEmojiCall) Do(f func(any, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListIssueAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceListIssueAwardEmojiCall) DoAndReturn(f func(any, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListIssueAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceListIssueAwardEmojiCall) DoAndReturn(f func(any, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListIssueAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // ListIssuesAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) ListIssuesAwardEmojiOnNote(pid any, issueID, noteID int, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) ListIssuesAwardEmojiOnNote(pid any, issueID, noteID int64, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issueID, noteID, opt} for _, a := range options { @@ -923,19 +923,19 @@ func (c *MockAwardEmojiServiceInterfaceListIssuesAwardEmojiOnNoteCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceListIssuesAwardEmojiOnNoteCall) Do(f func(any, int, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListIssuesAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceListIssuesAwardEmojiOnNoteCall) Do(f func(any, int64, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListIssuesAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceListIssuesAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListIssuesAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceListIssuesAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListIssuesAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMergeRequestAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) ListMergeRequestAwardEmoji(pid any, mergeRequestIID int, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) ListMergeRequestAwardEmoji(pid any, mergeRequestIID int64, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequestIID, opt} for _, a := range options { @@ -968,19 +968,19 @@ func (c *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiCall) Do(f func(any, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiCall) Do(f func(any, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiCall) DoAndReturn(f func(any, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiCall) DoAndReturn(f func(any, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMergeRequestAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) ListMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) ListMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID int64, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequestIID, noteID, opt} for _, a := range options { @@ -1013,19 +1013,19 @@ func (c *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiOnNoteCall) Ret } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiOnNoteCall) Do(f func(any, int, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiOnNoteCall) Do(f func(any, int64, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListMergeRequestAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // ListSnippetAwardEmoji mocks base method. -func (m *MockAwardEmojiServiceInterface) ListSnippetAwardEmoji(pid any, snippetID int, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) ListSnippetAwardEmoji(pid any, snippetID int64, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippetID, opt} for _, a := range options { @@ -1058,19 +1058,19 @@ func (c *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiCall) Return(arg0 [] } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiCall) Do(f func(any, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiCall) Do(f func(any, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiCall) DoAndReturn(f func(any, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiCall { +func (c *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiCall) DoAndReturn(f func(any, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiCall { c.Call = c.Call.DoAndReturn(f) return c } // ListSnippetAwardEmojiOnNote mocks base method. -func (m *MockAwardEmojiServiceInterface) ListSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { +func (m *MockAwardEmojiServiceInterface) ListSnippetAwardEmojiOnNote(pid any, snippetIID, noteID int64, opt *gitlab.ListAwardEmojiOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippetIID, noteID, opt} for _, a := range options { @@ -1103,13 +1103,13 @@ func (c *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiOnNoteCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiOnNoteCall) Do(f func(any, int, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiOnNoteCall) Do(f func(any, int64, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiOnNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiOnNoteCall) DoAndReturn(f func(any, int, int, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiOnNoteCall { +func (c *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiOnNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.ListAwardEmojiOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AwardEmoji, *gitlab.Response, error)) *MockAwardEmojiServiceInterfaceListSnippetAwardEmojiOnNoteCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/boards_mock.go b/testing/boards_mock.go index fae3302c..3088df10 100644 --- a/testing/boards_mock.go +++ b/testing/boards_mock.go @@ -86,7 +86,7 @@ func (c *MockIssueBoardsServiceInterfaceCreateIssueBoardCall) DoAndReturn(f func } // CreateIssueBoardList mocks base method. -func (m *MockIssueBoardsServiceInterface) CreateIssueBoardList(pid any, board int, opt *gitlab.CreateIssueBoardListOptions, options ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error) { +func (m *MockIssueBoardsServiceInterface) CreateIssueBoardList(pid any, board int64, opt *gitlab.CreateIssueBoardListOptions, options ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, board, opt} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockIssueBoardsServiceInterfaceCreateIssueBoardListCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockIssueBoardsServiceInterfaceCreateIssueBoardListCall) Do(f func(any, int, *gitlab.CreateIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceCreateIssueBoardListCall { +func (c *MockIssueBoardsServiceInterfaceCreateIssueBoardListCall) Do(f func(any, int64, *gitlab.CreateIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceCreateIssueBoardListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueBoardsServiceInterfaceCreateIssueBoardListCall) DoAndReturn(f func(any, int, *gitlab.CreateIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceCreateIssueBoardListCall { +func (c *MockIssueBoardsServiceInterfaceCreateIssueBoardListCall) DoAndReturn(f func(any, int64, *gitlab.CreateIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceCreateIssueBoardListCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteIssueBoard mocks base method. -func (m *MockIssueBoardsServiceInterface) DeleteIssueBoard(pid any, board int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockIssueBoardsServiceInterface) DeleteIssueBoard(pid any, board int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, board} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockIssueBoardsServiceInterfaceDeleteIssueBoardCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockIssueBoardsServiceInterfaceDeleteIssueBoardCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssueBoardsServiceInterfaceDeleteIssueBoardCall { +func (c *MockIssueBoardsServiceInterfaceDeleteIssueBoardCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssueBoardsServiceInterfaceDeleteIssueBoardCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueBoardsServiceInterfaceDeleteIssueBoardCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssueBoardsServiceInterfaceDeleteIssueBoardCall { +func (c *MockIssueBoardsServiceInterfaceDeleteIssueBoardCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssueBoardsServiceInterfaceDeleteIssueBoardCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteIssueBoardList mocks base method. -func (m *MockIssueBoardsServiceInterface) DeleteIssueBoardList(pid any, board, list int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockIssueBoardsServiceInterface) DeleteIssueBoardList(pid any, board, list int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, board, list} for _, a := range options { @@ -207,19 +207,19 @@ func (c *MockIssueBoardsServiceInterfaceDeleteIssueBoardListCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockIssueBoardsServiceInterfaceDeleteIssueBoardListCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssueBoardsServiceInterfaceDeleteIssueBoardListCall { +func (c *MockIssueBoardsServiceInterfaceDeleteIssueBoardListCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssueBoardsServiceInterfaceDeleteIssueBoardListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueBoardsServiceInterfaceDeleteIssueBoardListCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssueBoardsServiceInterfaceDeleteIssueBoardListCall { +func (c *MockIssueBoardsServiceInterfaceDeleteIssueBoardListCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssueBoardsServiceInterfaceDeleteIssueBoardListCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssueBoard mocks base method. -func (m *MockIssueBoardsServiceInterface) GetIssueBoard(pid any, board int, options ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error) { +func (m *MockIssueBoardsServiceInterface) GetIssueBoard(pid any, board int64, options ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, board} for _, a := range options { @@ -252,19 +252,19 @@ func (c *MockIssueBoardsServiceInterfaceGetIssueBoardCall) Return(arg0 *gitlab.I } // Do rewrite *gomock.Call.Do -func (c *MockIssueBoardsServiceInterfaceGetIssueBoardCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardCall { +func (c *MockIssueBoardsServiceInterfaceGetIssueBoardCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueBoardsServiceInterfaceGetIssueBoardCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardCall { +func (c *MockIssueBoardsServiceInterfaceGetIssueBoardCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssueBoardList mocks base method. -func (m *MockIssueBoardsServiceInterface) GetIssueBoardList(pid any, board, list int, options ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error) { +func (m *MockIssueBoardsServiceInterface) GetIssueBoardList(pid any, board, list int64, options ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, board, list} for _, a := range options { @@ -297,19 +297,19 @@ func (c *MockIssueBoardsServiceInterfaceGetIssueBoardListCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockIssueBoardsServiceInterfaceGetIssueBoardListCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardListCall { +func (c *MockIssueBoardsServiceInterfaceGetIssueBoardListCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueBoardsServiceInterfaceGetIssueBoardListCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardListCall { +func (c *MockIssueBoardsServiceInterfaceGetIssueBoardListCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardListCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssueBoardLists mocks base method. -func (m *MockIssueBoardsServiceInterface) GetIssueBoardLists(pid any, board int, opt *gitlab.GetIssueBoardListsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error) { +func (m *MockIssueBoardsServiceInterface) GetIssueBoardLists(pid any, board int64, opt *gitlab.GetIssueBoardListsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, board, opt} for _, a := range options { @@ -342,13 +342,13 @@ func (c *MockIssueBoardsServiceInterfaceGetIssueBoardListsCall) Return(arg0 []*g } // Do rewrite *gomock.Call.Do -func (c *MockIssueBoardsServiceInterfaceGetIssueBoardListsCall) Do(f func(any, int, *gitlab.GetIssueBoardListsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardListsCall { +func (c *MockIssueBoardsServiceInterfaceGetIssueBoardListsCall) Do(f func(any, int64, *gitlab.GetIssueBoardListsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardListsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueBoardsServiceInterfaceGetIssueBoardListsCall) DoAndReturn(f func(any, int, *gitlab.GetIssueBoardListsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardListsCall { +func (c *MockIssueBoardsServiceInterfaceGetIssueBoardListsCall) DoAndReturn(f func(any, int64, *gitlab.GetIssueBoardListsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceGetIssueBoardListsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -399,7 +399,7 @@ func (c *MockIssueBoardsServiceInterfaceListIssueBoardsCall) DoAndReturn(f func( } // UpdateIssueBoard mocks base method. -func (m *MockIssueBoardsServiceInterface) UpdateIssueBoard(pid any, board int, opt *gitlab.UpdateIssueBoardOptions, options ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error) { +func (m *MockIssueBoardsServiceInterface) UpdateIssueBoard(pid any, board int64, opt *gitlab.UpdateIssueBoardOptions, options ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, board, opt} for _, a := range options { @@ -432,19 +432,19 @@ func (c *MockIssueBoardsServiceInterfaceUpdateIssueBoardCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockIssueBoardsServiceInterfaceUpdateIssueBoardCall) Do(f func(any, int, *gitlab.UpdateIssueBoardOptions, ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceUpdateIssueBoardCall { +func (c *MockIssueBoardsServiceInterfaceUpdateIssueBoardCall) Do(f func(any, int64, *gitlab.UpdateIssueBoardOptions, ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceUpdateIssueBoardCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueBoardsServiceInterfaceUpdateIssueBoardCall) DoAndReturn(f func(any, int, *gitlab.UpdateIssueBoardOptions, ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceUpdateIssueBoardCall { +func (c *MockIssueBoardsServiceInterfaceUpdateIssueBoardCall) DoAndReturn(f func(any, int64, *gitlab.UpdateIssueBoardOptions, ...gitlab.RequestOptionFunc) (*gitlab.IssueBoard, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceUpdateIssueBoardCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateIssueBoardList mocks base method. -func (m *MockIssueBoardsServiceInterface) UpdateIssueBoardList(pid any, board, list int, opt *gitlab.UpdateIssueBoardListOptions, options ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error) { +func (m *MockIssueBoardsServiceInterface) UpdateIssueBoardList(pid any, board, list int64, opt *gitlab.UpdateIssueBoardListOptions, options ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, board, list, opt} for _, a := range options { @@ -477,13 +477,13 @@ func (c *MockIssueBoardsServiceInterfaceUpdateIssueBoardListCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockIssueBoardsServiceInterfaceUpdateIssueBoardListCall) Do(f func(any, int, int, *gitlab.UpdateIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceUpdateIssueBoardListCall { +func (c *MockIssueBoardsServiceInterfaceUpdateIssueBoardListCall) Do(f func(any, int64, int64, *gitlab.UpdateIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceUpdateIssueBoardListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueBoardsServiceInterfaceUpdateIssueBoardListCall) DoAndReturn(f func(any, int, int, *gitlab.UpdateIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceUpdateIssueBoardListCall { +func (c *MockIssueBoardsServiceInterfaceUpdateIssueBoardListCall) DoAndReturn(f func(any, int64, int64, *gitlab.UpdateIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockIssueBoardsServiceInterfaceUpdateIssueBoardListCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/broadcast_messages_mock.go b/testing/broadcast_messages_mock.go index 3fa8261c..3578a9d6 100644 --- a/testing/broadcast_messages_mock.go +++ b/testing/broadcast_messages_mock.go @@ -86,7 +86,7 @@ func (c *MockBroadcastMessagesServiceInterfaceCreateBroadcastMessageCall) DoAndR } // DeleteBroadcastMessage mocks base method. -func (m *MockBroadcastMessagesServiceInterface) DeleteBroadcastMessage(broadcast int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockBroadcastMessagesServiceInterface) DeleteBroadcastMessage(broadcast int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{broadcast} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockBroadcastMessagesServiceInterfaceDeleteBroadcastMessageCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockBroadcastMessagesServiceInterfaceDeleteBroadcastMessageCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceDeleteBroadcastMessageCall { +func (c *MockBroadcastMessagesServiceInterfaceDeleteBroadcastMessageCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceDeleteBroadcastMessageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockBroadcastMessagesServiceInterfaceDeleteBroadcastMessageCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceDeleteBroadcastMessageCall { +func (c *MockBroadcastMessagesServiceInterfaceDeleteBroadcastMessageCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceDeleteBroadcastMessageCall { c.Call = c.Call.DoAndReturn(f) return c } // GetBroadcastMessage mocks base method. -func (m *MockBroadcastMessagesServiceInterface) GetBroadcastMessage(broadcast int, options ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error) { +func (m *MockBroadcastMessagesServiceInterface) GetBroadcastMessage(broadcast int64, options ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{broadcast} for _, a := range options { @@ -163,13 +163,13 @@ func (c *MockBroadcastMessagesServiceInterfaceGetBroadcastMessageCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockBroadcastMessagesServiceInterfaceGetBroadcastMessageCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceGetBroadcastMessageCall { +func (c *MockBroadcastMessagesServiceInterfaceGetBroadcastMessageCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceGetBroadcastMessageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockBroadcastMessagesServiceInterfaceGetBroadcastMessageCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceGetBroadcastMessageCall { +func (c *MockBroadcastMessagesServiceInterfaceGetBroadcastMessageCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceGetBroadcastMessageCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -220,7 +220,7 @@ func (c *MockBroadcastMessagesServiceInterfaceListBroadcastMessagesCall) DoAndRe } // UpdateBroadcastMessage mocks base method. -func (m *MockBroadcastMessagesServiceInterface) UpdateBroadcastMessage(broadcast int, opt *gitlab.UpdateBroadcastMessageOptions, options ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error) { +func (m *MockBroadcastMessagesServiceInterface) UpdateBroadcastMessage(broadcast int64, opt *gitlab.UpdateBroadcastMessageOptions, options ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{broadcast, opt} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockBroadcastMessagesServiceInterfaceUpdateBroadcastMessageCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockBroadcastMessagesServiceInterfaceUpdateBroadcastMessageCall) Do(f func(int, *gitlab.UpdateBroadcastMessageOptions, ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceUpdateBroadcastMessageCall { +func (c *MockBroadcastMessagesServiceInterfaceUpdateBroadcastMessageCall) Do(f func(int64, *gitlab.UpdateBroadcastMessageOptions, ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceUpdateBroadcastMessageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockBroadcastMessagesServiceInterfaceUpdateBroadcastMessageCall) DoAndReturn(f func(int, *gitlab.UpdateBroadcastMessageOptions, ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceUpdateBroadcastMessageCall { +func (c *MockBroadcastMessagesServiceInterfaceUpdateBroadcastMessageCall) DoAndReturn(f func(int64, *gitlab.UpdateBroadcastMessageOptions, ...gitlab.RequestOptionFunc) (*gitlab.BroadcastMessage, *gitlab.Response, error)) *MockBroadcastMessagesServiceInterfaceUpdateBroadcastMessageCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/cluster_agents_mock.go b/testing/cluster_agents_mock.go index 97fe61b3..7bddcfb4 100644 --- a/testing/cluster_agents_mock.go +++ b/testing/cluster_agents_mock.go @@ -41,7 +41,7 @@ func (m *MockClusterAgentsServiceInterface) EXPECT() *MockClusterAgentsServiceIn } // CreateAgentToken mocks base method. -func (m *MockClusterAgentsServiceInterface) CreateAgentToken(pid any, aid int, opt *gitlab.CreateAgentTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error) { +func (m *MockClusterAgentsServiceInterface) CreateAgentToken(pid any, aid int64, opt *gitlab.CreateAgentTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, aid, opt} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockClusterAgentsServiceInterfaceCreateAgentTokenCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockClusterAgentsServiceInterfaceCreateAgentTokenCall) Do(f func(any, int, *gitlab.CreateAgentTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceCreateAgentTokenCall { +func (c *MockClusterAgentsServiceInterfaceCreateAgentTokenCall) Do(f func(any, int64, *gitlab.CreateAgentTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceCreateAgentTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockClusterAgentsServiceInterfaceCreateAgentTokenCall) DoAndReturn(f func(any, int, *gitlab.CreateAgentTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceCreateAgentTokenCall { +func (c *MockClusterAgentsServiceInterfaceCreateAgentTokenCall) DoAndReturn(f func(any, int64, *gitlab.CreateAgentTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceCreateAgentTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteAgent mocks base method. -func (m *MockClusterAgentsServiceInterface) DeleteAgent(pid any, id int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockClusterAgentsServiceInterface) DeleteAgent(pid any, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, id} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockClusterAgentsServiceInterfaceDeleteAgentCall) Return(arg0 *gitlab.R } // Do rewrite *gomock.Call.Do -func (c *MockClusterAgentsServiceInterfaceDeleteAgentCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockClusterAgentsServiceInterfaceDeleteAgentCall { +func (c *MockClusterAgentsServiceInterfaceDeleteAgentCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockClusterAgentsServiceInterfaceDeleteAgentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockClusterAgentsServiceInterfaceDeleteAgentCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockClusterAgentsServiceInterfaceDeleteAgentCall { +func (c *MockClusterAgentsServiceInterfaceDeleteAgentCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockClusterAgentsServiceInterfaceDeleteAgentCall { c.Call = c.Call.DoAndReturn(f) return c } // GetAgent mocks base method. -func (m *MockClusterAgentsServiceInterface) GetAgent(pid any, id int, options ...gitlab.RequestOptionFunc) (*gitlab.Agent, *gitlab.Response, error) { +func (m *MockClusterAgentsServiceInterface) GetAgent(pid any, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.Agent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, id} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockClusterAgentsServiceInterfaceGetAgentCall) Return(arg0 *gitlab.Agen } // Do rewrite *gomock.Call.Do -func (c *MockClusterAgentsServiceInterfaceGetAgentCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Agent, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceGetAgentCall { +func (c *MockClusterAgentsServiceInterfaceGetAgentCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Agent, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceGetAgentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockClusterAgentsServiceInterfaceGetAgentCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Agent, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceGetAgentCall { +func (c *MockClusterAgentsServiceInterfaceGetAgentCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Agent, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceGetAgentCall { c.Call = c.Call.DoAndReturn(f) return c } // GetAgentToken mocks base method. -func (m *MockClusterAgentsServiceInterface) GetAgentToken(pid any, aid, id int, options ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error) { +func (m *MockClusterAgentsServiceInterface) GetAgentToken(pid any, aid, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, aid, id} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockClusterAgentsServiceInterfaceGetAgentTokenCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockClusterAgentsServiceInterfaceGetAgentTokenCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceGetAgentTokenCall { +func (c *MockClusterAgentsServiceInterfaceGetAgentTokenCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceGetAgentTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockClusterAgentsServiceInterfaceGetAgentTokenCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceGetAgentTokenCall { +func (c *MockClusterAgentsServiceInterfaceGetAgentTokenCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceGetAgentTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // ListAgentTokens mocks base method. -func (m *MockClusterAgentsServiceInterface) ListAgentTokens(pid any, aid int, opt *gitlab.ListAgentTokensOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AgentToken, *gitlab.Response, error) { +func (m *MockClusterAgentsServiceInterface) ListAgentTokens(pid any, aid int64, opt *gitlab.ListAgentTokensOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.AgentToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, aid, opt} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockClusterAgentsServiceInterfaceListAgentTokensCall) Return(arg0 []*gi } // Do rewrite *gomock.Call.Do -func (c *MockClusterAgentsServiceInterfaceListAgentTokensCall) Do(f func(any, int, *gitlab.ListAgentTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceListAgentTokensCall { +func (c *MockClusterAgentsServiceInterfaceListAgentTokensCall) Do(f func(any, int64, *gitlab.ListAgentTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceListAgentTokensCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockClusterAgentsServiceInterfaceListAgentTokensCall) DoAndReturn(f func(any, int, *gitlab.ListAgentTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceListAgentTokensCall { +func (c *MockClusterAgentsServiceInterfaceListAgentTokensCall) DoAndReturn(f func(any, int64, *gitlab.ListAgentTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.AgentToken, *gitlab.Response, error)) *MockClusterAgentsServiceInterfaceListAgentTokensCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -355,7 +355,7 @@ func (c *MockClusterAgentsServiceInterfaceRegisterAgentCall) DoAndReturn(f func( } // RevokeAgentToken mocks base method. -func (m *MockClusterAgentsServiceInterface) RevokeAgentToken(pid any, aid, id int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockClusterAgentsServiceInterface) RevokeAgentToken(pid any, aid, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, aid, id} for _, a := range options { @@ -387,13 +387,13 @@ func (c *MockClusterAgentsServiceInterfaceRevokeAgentTokenCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockClusterAgentsServiceInterfaceRevokeAgentTokenCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockClusterAgentsServiceInterfaceRevokeAgentTokenCall { +func (c *MockClusterAgentsServiceInterfaceRevokeAgentTokenCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockClusterAgentsServiceInterfaceRevokeAgentTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockClusterAgentsServiceInterfaceRevokeAgentTokenCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockClusterAgentsServiceInterfaceRevokeAgentTokenCall { +func (c *MockClusterAgentsServiceInterfaceRevokeAgentTokenCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockClusterAgentsServiceInterfaceRevokeAgentTokenCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/container_registry_mock.go b/testing/container_registry_mock.go index 88be1e18..c767efef 100644 --- a/testing/container_registry_mock.go +++ b/testing/container_registry_mock.go @@ -41,7 +41,7 @@ func (m *MockContainerRegistryServiceInterface) EXPECT() *MockContainerRegistryS } // DeleteRegistryRepository mocks base method. -func (m *MockContainerRegistryServiceInterface) DeleteRegistryRepository(pid any, repository int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockContainerRegistryServiceInterface) DeleteRegistryRepository(pid any, repository int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, repository} for _, a := range options { @@ -73,19 +73,19 @@ func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryCall { +func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryCall { +func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteRegistryRepositoryTag mocks base method. -func (m *MockContainerRegistryServiceInterface) DeleteRegistryRepositoryTag(pid any, repository int, tagName string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockContainerRegistryServiceInterface) DeleteRegistryRepositoryTag(pid any, repository int64, tagName string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, repository, tagName} for _, a := range options { @@ -117,19 +117,19 @@ func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagCall) R } // Do rewrite *gomock.Call.Do -func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagCall { +func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagCall { +func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteRegistryRepositoryTags mocks base method. -func (m *MockContainerRegistryServiceInterface) DeleteRegistryRepositoryTags(pid any, repository int, opt *gitlab.DeleteRegistryRepositoryTagsOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockContainerRegistryServiceInterface) DeleteRegistryRepositoryTags(pid any, repository int64, opt *gitlab.DeleteRegistryRepositoryTagsOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, repository, opt} for _, a := range options { @@ -161,19 +161,19 @@ func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagsCall) } // Do rewrite *gomock.Call.Do -func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagsCall) Do(f func(any, int, *gitlab.DeleteRegistryRepositoryTagsOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagsCall { +func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagsCall) Do(f func(any, int64, *gitlab.DeleteRegistryRepositoryTagsOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagsCall) DoAndReturn(f func(any, int, *gitlab.DeleteRegistryRepositoryTagsOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagsCall { +func (c *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagsCall) DoAndReturn(f func(any, int64, *gitlab.DeleteRegistryRepositoryTagsOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryServiceInterfaceDeleteRegistryRepositoryTagsCall { c.Call = c.Call.DoAndReturn(f) return c } // GetRegistryRepositoryTagDetail mocks base method. -func (m *MockContainerRegistryServiceInterface) GetRegistryRepositoryTagDetail(pid any, repository int, tagName string, options ...gitlab.RequestOptionFunc) (*gitlab.RegistryRepositoryTag, *gitlab.Response, error) { +func (m *MockContainerRegistryServiceInterface) GetRegistryRepositoryTagDetail(pid any, repository int64, tagName string, options ...gitlab.RequestOptionFunc) (*gitlab.RegistryRepositoryTag, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, repository, tagName} for _, a := range options { @@ -206,13 +206,13 @@ func (c *MockContainerRegistryServiceInterfaceGetRegistryRepositoryTagDetailCall } // Do rewrite *gomock.Call.Do -func (c *MockContainerRegistryServiceInterfaceGetRegistryRepositoryTagDetailCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.RegistryRepositoryTag, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceGetRegistryRepositoryTagDetailCall { +func (c *MockContainerRegistryServiceInterfaceGetRegistryRepositoryTagDetailCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.RegistryRepositoryTag, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceGetRegistryRepositoryTagDetailCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockContainerRegistryServiceInterfaceGetRegistryRepositoryTagDetailCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.RegistryRepositoryTag, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceGetRegistryRepositoryTagDetailCall { +func (c *MockContainerRegistryServiceInterfaceGetRegistryRepositoryTagDetailCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.RegistryRepositoryTag, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceGetRegistryRepositoryTagDetailCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -353,7 +353,7 @@ func (c *MockContainerRegistryServiceInterfaceListProjectRegistryRepositoriesCal } // ListRegistryRepositoryTags mocks base method. -func (m *MockContainerRegistryServiceInterface) ListRegistryRepositoryTags(pid any, repository int, opt *gitlab.ListRegistryRepositoryTagsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepositoryTag, *gitlab.Response, error) { +func (m *MockContainerRegistryServiceInterface) ListRegistryRepositoryTags(pid any, repository int64, opt *gitlab.ListRegistryRepositoryTagsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepositoryTag, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, repository, opt} for _, a := range options { @@ -386,13 +386,13 @@ func (c *MockContainerRegistryServiceInterfaceListRegistryRepositoryTagsCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockContainerRegistryServiceInterfaceListRegistryRepositoryTagsCall) Do(f func(any, int, *gitlab.ListRegistryRepositoryTagsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepositoryTag, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListRegistryRepositoryTagsCall { +func (c *MockContainerRegistryServiceInterfaceListRegistryRepositoryTagsCall) Do(f func(any, int64, *gitlab.ListRegistryRepositoryTagsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepositoryTag, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListRegistryRepositoryTagsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockContainerRegistryServiceInterfaceListRegistryRepositoryTagsCall) DoAndReturn(f func(any, int, *gitlab.ListRegistryRepositoryTagsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepositoryTag, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListRegistryRepositoryTagsCall { +func (c *MockContainerRegistryServiceInterfaceListRegistryRepositoryTagsCall) DoAndReturn(f func(any, int64, *gitlab.ListRegistryRepositoryTagsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.RegistryRepositoryTag, *gitlab.Response, error)) *MockContainerRegistryServiceInterfaceListRegistryRepositoryTagsCall { c.Call = c.Call.DoAndReturn(f) return c } -- GitLab From 73d79e1cb9e9f7a7540bd489c790220e8ad1876b Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Wed, 8 Oct 2025 02:44:23 -0500 Subject: [PATCH 13/26] chore(no-release): Round 2 of int-> int64 refactoring Changelog: Improvements --- container_registry_protection_rules.go | 12 +- custom_attributes.go | 56 +-- database_migrations.go | 4 +- dependency_list_export.go | 14 +- deploy_keys.go | 22 +- deploy_tokens.go | 18 +- deployments.go | 24 +- deployments_merge_requests.go | 4 +- discussions.go | 120 +++---- draft_notes.go | 34 +- enterprise_users.go | 8 +- environments.go | 22 +- environments_test.go | 6 +- epic_issues.go | 22 +- epics.go | 38 +- epics_test.go | 2 +- error_tracking.go | 6 +- event_parsing_webhook_test.go | 8 +- event_systemhook_types.go | 40 +-- event_webhook_types.go | 336 +++++++++--------- events.go | 36 +- external_status_checks.go | 50 +-- ...ontainer_registry_protection_rules_mock.go | 12 +- testing/custom_attributes_mock.go | 72 ++-- testing/database_migrations_mock.go | 6 +- testing/dependency_list_export_mock.go | 18 +- testing/deploy_keys_mock.go | 24 +- testing/deploy_tokens_mock.go | 24 +- testing/deployments_merge_requests_mock.go | 6 +- testing/deployments_mock.go | 24 +- testing/discussions_mock.go | 162 ++++----- testing/draft_notes_mock.go | 42 +-- testing/enterprise_users_mock.go | 12 +- testing/environments_mock.go | 24 +- testing/epic_issues_mock.go | 24 +- testing/epics_mock.go | 24 +- testing/error_tracking_mock.go | 6 +- testing/external_status_checks_mock.go | 60 ++-- 38 files changed, 711 insertions(+), 711 deletions(-) diff --git a/container_registry_protection_rules.go b/container_registry_protection_rules.go index 5871f398..ba91616e 100644 --- a/container_registry_protection_rules.go +++ b/container_registry_protection_rules.go @@ -23,8 +23,8 @@ type ( ContainerRegistryProtectionRulesServiceInterface interface { ListContainerRegistryProtectionRules(pid any, options ...RequestOptionFunc) ([]*ContainerRegistryProtectionRule, *Response, error) CreateContainerRegistryProtectionRule(pid any, opt *CreateContainerRegistryProtectionRuleOptions, options ...RequestOptionFunc) (*ContainerRegistryProtectionRule, *Response, error) - UpdateContainerRegistryProtectionRule(pid any, ruleID int, opt *UpdateContainerRegistryProtectionRuleOptions, options ...RequestOptionFunc) (*ContainerRegistryProtectionRule, *Response, error) - DeleteContainerRegistryProtectionRule(pid any, ruleID int, options ...RequestOptionFunc) (*Response, error) + UpdateContainerRegistryProtectionRule(pid any, ruleID int64, opt *UpdateContainerRegistryProtectionRuleOptions, options ...RequestOptionFunc) (*ContainerRegistryProtectionRule, *Response, error) + DeleteContainerRegistryProtectionRule(pid any, ruleID int64, options ...RequestOptionFunc) (*Response, error) } // ContainerRegistryProtectionRulesService handles communication with @@ -46,8 +46,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"` @@ -136,7 +136,7 @@ type UpdateContainerRegistryProtectionRuleOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/container_repository_protection_rules/#update-a-container-repository-protection-rule -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -162,7 +162,7 @@ func (s *ContainerRegistryProtectionRulesService) UpdateContainerRegistryProtect // // GitLab API docs: // https://docs.gitlab.com/api/container_repository_protection_rules/#delete-a-container-repository-protection-rule -func (s *ContainerRegistryProtectionRulesService) DeleteContainerRegistryProtectionRule(pid any, ruleID int, options ...RequestOptionFunc) (*Response, error) { +func (s *ContainerRegistryProtectionRulesService) DeleteContainerRegistryProtectionRule(pid any, ruleID int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/custom_attributes.go b/custom_attributes.go index 92e3babc..0591864f 100644 --- a/custom_attributes.go +++ b/custom_attributes.go @@ -23,18 +23,18 @@ import ( type ( CustomAttributesServiceInterface interface { - ListCustomUserAttributes(user int, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) - ListCustomGroupAttributes(group int, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) - ListCustomProjectAttributes(project int, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) - GetCustomUserAttribute(user int, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) - GetCustomGroupAttribute(group int, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) - GetCustomProjectAttribute(project int, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) - SetCustomUserAttribute(user int, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) - SetCustomGroupAttribute(group int, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) - SetCustomProjectAttribute(project int, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) - DeleteCustomUserAttribute(user int, key string, options ...RequestOptionFunc) (*Response, error) - DeleteCustomGroupAttribute(group int, key string, options ...RequestOptionFunc) (*Response, error) - DeleteCustomProjectAttribute(project int, key string, options ...RequestOptionFunc) (*Response, error) + ListCustomUserAttributes(user int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) + ListCustomGroupAttributes(group int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) + ListCustomProjectAttributes(project int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) + GetCustomUserAttribute(user int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + GetCustomGroupAttribute(group int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + GetCustomProjectAttribute(project int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + SetCustomUserAttribute(user int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + SetCustomGroupAttribute(group int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + SetCustomProjectAttribute(project int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) + DeleteCustomUserAttribute(user int64, key string, options ...RequestOptionFunc) (*Response, error) + DeleteCustomGroupAttribute(group int64, key string, options ...RequestOptionFunc) (*Response, error) + DeleteCustomProjectAttribute(project int64, key string, options ...RequestOptionFunc) (*Response, error) } // CustomAttributesService handles communication with the group, project and @@ -60,7 +60,7 @@ type CustomAttribute struct { // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#list-custom-attributes -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...) } @@ -68,7 +68,7 @@ func (s *CustomAttributesService) ListCustomUserAttributes(user int, options ... // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#list-custom-attributes -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...) } @@ -76,11 +76,11 @@ func (s *CustomAttributesService) ListCustomGroupAttributes(group int, options . // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#list-custom-attributes -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) { u := fmt.Sprintf("%s/%d/custom_attributes", resource, id) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) if err != nil { @@ -99,7 +99,7 @@ func (s *CustomAttributesService) listCustomAttributes(resource string, id int, // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#single-custom-attribute -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...) } @@ -107,7 +107,7 @@ func (s *CustomAttributesService) GetCustomUserAttribute(user int, key string, o // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#single-custom-attribute -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...) } @@ -115,11 +115,11 @@ func (s *CustomAttributesService) GetCustomGroupAttribute(group int, key string, // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#single-custom-attribute -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) { u := fmt.Sprintf("%s/%d/custom_attributes/%s", resource, id, key) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) if err != nil { @@ -138,7 +138,7 @@ func (s *CustomAttributesService) getCustomAttribute(resource string, id int, ke // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#set-custom-attribute -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...) } @@ -146,7 +146,7 @@ func (s *CustomAttributesService) SetCustomUserAttribute(user int, c CustomAttri // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#set-custom-attribute -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...) } @@ -154,11 +154,11 @@ func (s *CustomAttributesService) SetCustomGroupAttribute(group int, c CustomAtt // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#set-custom-attribute -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) { u := fmt.Sprintf("%s/%d/custom_attributes/%s", resource, id, c.Key) req, err := s.client.NewRequest(http.MethodPut, u, c, options) if err != nil { @@ -177,7 +177,7 @@ func (s *CustomAttributesService) setCustomAttribute(resource string, id int, c // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#delete-custom-attribute -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...) } @@ -185,7 +185,7 @@ func (s *CustomAttributesService) DeleteCustomUserAttribute(user int, key string // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#delete-custom-attribute -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...) } @@ -193,11 +193,11 @@ func (s *CustomAttributesService) DeleteCustomGroupAttribute(group int, key stri // // GitLab API docs: // https://docs.gitlab.com/api/custom_attributes/#delete-custom-attribute -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) { u := fmt.Sprintf("%s/%d/custom_attributes/%s", resource, id, key) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) if err != nil { diff --git a/database_migrations.go b/database_migrations.go index 058e32cc..223a0d95 100644 --- a/database_migrations.go +++ b/database_migrations.go @@ -21,7 +21,7 @@ import ( type ( DatabaseMigrationsServiceInterface interface { - MarkMigrationAsSuccessful(version int, opt *MarkMigrationAsSuccessfulOptions, options ...RequestOptionFunc) (*Response, error) + MarkMigrationAsSuccessful(version int64, opt *MarkMigrationAsSuccessfulOptions, options ...RequestOptionFunc) (*Response, error) } // DatabaseMigrationsService handles communication with the database @@ -50,7 +50,7 @@ type MarkMigrationAsSuccessfulOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/database_migrations/#mark-a-migration-as-successful -func (s *DatabaseMigrationsService) MarkMigrationAsSuccessful(version int, opt *MarkMigrationAsSuccessfulOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *DatabaseMigrationsService) MarkMigrationAsSuccessful(version int64, opt *MarkMigrationAsSuccessfulOptions, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("admin/migrations/%d/mark", version) req, err := s.client.NewRequest(http.MethodPost, u, opt, options) diff --git a/dependency_list_export.go b/dependency_list_export.go index ed475fd4..cd4508c5 100644 --- a/dependency_list_export.go +++ b/dependency_list_export.go @@ -9,9 +9,9 @@ import ( type ( DependencyListExportServiceInterface interface { - CreateDependencyListExport(pipelineID int, opt *CreateDependencyListExportOptions, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) - GetDependencyListExport(id int, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) - DownloadDependencyListExport(id int, options ...RequestOptionFunc) (io.Reader, *Response, error) + CreateDependencyListExport(pipelineID int64, opt *CreateDependencyListExportOptions, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) + GetDependencyListExport(id int64, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) + DownloadDependencyListExport(id int64, options ...RequestOptionFunc) (io.Reader, *Response, error) } // DependencyListExportService handles communication with the dependency list export @@ -39,7 +39,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"` @@ -57,7 +57,7 @@ const defaultExportType = "sbom" // // GitLab docs: // https://docs.gitlab.com/api/dependency_list_export/#create-a-dependency-list-export -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) @@ -86,7 +86,7 @@ func (s *DependencyListExportService) CreateDependencyListExport(pipelineID int, // // GitLab docs: // https://docs.gitlab.com/api/dependency_list_export/#get-single-dependency-list-export -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) @@ -117,7 +117,7 @@ func (s *DependencyListExportService) GetDependencyListExport(id int, options .. // // GitLab docs: // https://docs.gitlab.com/api/dependency_list_export/#download-dependency-list-export -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/deploy_keys.go b/deploy_keys.go index 4047f1df..ea2ef40f 100644 --- a/deploy_keys.go +++ b/deploy_keys.go @@ -28,11 +28,11 @@ type ( AddInstanceDeployKey(opt *AddInstanceDeployKeyOptions, options ...RequestOptionFunc) (*InstanceDeployKey, *Response, error) ListProjectDeployKeys(pid any, opt *ListProjectDeployKeysOptions, options ...RequestOptionFunc) ([]*ProjectDeployKey, *Response, error) ListUserProjectDeployKeys(uid any, opt *ListUserProjectDeployKeysOptions, options ...RequestOptionFunc) ([]*ProjectDeployKey, *Response, error) - GetDeployKey(pid any, deployKey int, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) + GetDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) AddDeployKey(pid any, opt *AddDeployKeyOptions, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) - DeleteDeployKey(pid any, deployKey int, options ...RequestOptionFunc) (*Response, error) - EnableDeployKey(pid any, deployKey int, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) - UpdateDeployKey(pid any, deployKey int, opt *UpdateDeployKeyOptions, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) + DeleteDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*Response, error) + EnableDeployKey(pid any, deployKey int64, 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 @@ -49,7 +49,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"` @@ -66,7 +66,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"` @@ -81,7 +81,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"` @@ -227,7 +227,7 @@ func (s *DeployKeysService) ListUserProjectDeployKeys(uid any, opt *ListUserProj // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#get-a-single-deploy-key -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -290,7 +290,7 @@ func (s *DeployKeysService) AddDeployKey(pid any, opt *AddDeployKeyOptions, opti // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#delete-deploy-key -func (s *DeployKeysService) DeleteDeployKey(pid any, deployKey int, options ...RequestOptionFunc) (*Response, error) { +func (s *DeployKeysService) DeleteDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -309,7 +309,7 @@ func (s *DeployKeysService) DeleteDeployKey(pid any, deployKey int, options ...R // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#enable-a-deploy-key -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -343,7 +343,7 @@ type UpdateDeployKeyOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/deploy_keys/#update-deploy-key -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) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/deploy_tokens.go b/deploy_tokens.go index ec95255a..8d88ec21 100644 --- a/deploy_tokens.go +++ b/deploy_tokens.go @@ -26,13 +26,13 @@ type ( DeployTokensServiceInterface interface { ListAllDeployTokens(options ...RequestOptionFunc) ([]*DeployToken, *Response, error) ListProjectDeployTokens(pid any, opt *ListProjectDeployTokensOptions, options ...RequestOptionFunc) ([]*DeployToken, *Response, error) - GetProjectDeployToken(pid any, deployToken int, options ...RequestOptionFunc) (*DeployToken, *Response, error) + GetProjectDeployToken(pid any, deployToken int64, options ...RequestOptionFunc) (*DeployToken, *Response, error) CreateProjectDeployToken(pid any, opt *CreateProjectDeployTokenOptions, options ...RequestOptionFunc) (*DeployToken, *Response, error) - DeleteProjectDeployToken(pid any, deployToken int, options ...RequestOptionFunc) (*Response, error) + DeleteProjectDeployToken(pid any, deployToken int64, options ...RequestOptionFunc) (*Response, error) ListGroupDeployTokens(gid any, opt *ListGroupDeployTokensOptions, options ...RequestOptionFunc) ([]*DeployToken, *Response, error) - GetGroupDeployToken(gid any, deployToken int, options ...RequestOptionFunc) (*DeployToken, *Response, error) + GetGroupDeployToken(gid any, deployToken int64, options ...RequestOptionFunc) (*DeployToken, *Response, error) CreateGroupDeployToken(gid any, opt *CreateGroupDeployTokenOptions, options ...RequestOptionFunc) (*DeployToken, *Response, error) - 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 @@ -46,7 +46,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"` @@ -117,7 +117,7 @@ func (s *DeployTokensService) ListProjectDeployTokens(pid any, opt *ListProjectD // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#get-a-project-deploy-token -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 @@ -178,7 +178,7 @@ func (s *DeployTokensService) CreateProjectDeployToken(pid any, opt *CreateProje // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#delete-a-project-deploy-token -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 @@ -231,7 +231,7 @@ func (s *DeployTokensService) ListGroupDeployTokens(gid any, opt *ListGroupDeplo // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#get-a-group-deploy-token -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 @@ -292,7 +292,7 @@ func (s *DeployTokensService) CreateGroupDeployToken(gid any, opt *CreateGroupDe // // GitLab API docs: // https://docs.gitlab.com/api/deploy_tokens/#delete-a-group-deploy-token -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/deployments.go b/deployments.go index 0a602777..7f3bd4b1 100644 --- a/deployments.go +++ b/deployments.go @@ -25,11 +25,11 @@ type ( // DeploymentsServiceInterface defines all the API methods for the DeploymentsService DeploymentsServiceInterface interface { ListProjectDeployments(pid any, opts *ListProjectDeploymentsOptions, options ...RequestOptionFunc) ([]*Deployment, *Response, error) - GetProjectDeployment(pid any, deployment int, options ...RequestOptionFunc) (*Deployment, *Response, error) + GetProjectDeployment(pid any, deployment int64, options ...RequestOptionFunc) (*Deployment, *Response, error) CreateProjectDeployment(pid any, opt *CreateProjectDeploymentOptions, options ...RequestOptionFunc) (*Deployment, *Response, error) - UpdateProjectDeployment(pid any, deployment int, opt *UpdateProjectDeploymentOptions, options ...RequestOptionFunc) (*Deployment, *Response, error) - ApproveOrRejectProjectDeployment(pid any, deployment int, opt *ApproveOrRejectProjectDeploymentOptions, options ...RequestOptionFunc) (*Response, error) - DeleteProjectDeployment(pid any, deployment int, options ...RequestOptionFunc) (*Response, error) + UpdateProjectDeployment(pid any, deployment int64, opt *UpdateProjectDeploymentOptions, options ...RequestOptionFunc) (*Deployment, *Response, error) + ApproveOrRejectProjectDeployment(pid any, deployment int64, opt *ApproveOrRejectProjectDeploymentOptions, options ...RequestOptionFunc) (*Response, error) + DeleteProjectDeployment(pid any, deployment int64, options ...RequestOptionFunc) (*Response, error) } // DeploymentsService handles communication with the deployment related methods @@ -45,8 +45,8 @@ var _ DeploymentsServiceInterface = (*DeploymentsService)(nil) // Deployment represents the Gitlab deployment type Deployment struct { - ID int `json:"id"` - IID int `json:"iid"` + ID int64 `json:"id"` + IID int64 `json:"iid"` Ref string `json:"ref"` SHA string `json:"sha"` Status string `json:"status"` @@ -59,7 +59,7 @@ type Deployment struct { // DeploymentDeployable represents the Gitlab deployment deployable type DeploymentDeployable struct { - ID int `json:"id"` + ID int64 `json:"id"` Status string `json:"status"` Stage string `json:"stage"` Name string `json:"name"` @@ -78,7 +78,7 @@ type DeploymentDeployable struct { // DeploymentDeployablePipeline represents the Gitlab deployment deployable pipeline type DeploymentDeployablePipeline struct { - ID int `json:"id"` + ID int64 `json:"id"` SHA string `json:"sha"` Ref string `json:"ref"` Status string `json:"status"` @@ -135,7 +135,7 @@ func (s *DeploymentsService) ListProjectDeployments(pid any, opts *ListProjectDe // // GitLab API docs: // https://docs.gitlab.com/api/deployments/#get-a-specific-deployment -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -207,7 +207,7 @@ type UpdateProjectDeploymentOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/deployments/#update-a-deployment -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -243,7 +243,7 @@ type ApproveOrRejectProjectDeploymentOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/deployments/#approve-or-reject-a-blocked-deployment -func (s *DeploymentsService) ApproveOrRejectProjectDeployment(pid any, deployment int, +func (s *DeploymentsService) ApproveOrRejectProjectDeployment(pid any, deployment int64, opt *ApproveOrRejectProjectDeploymentOptions, options ...RequestOptionFunc, ) (*Response, error) { project, err := parseID(pid) @@ -264,7 +264,7 @@ func (s *DeploymentsService) ApproveOrRejectProjectDeployment(pid any, deploymen // // GitLab API docs: // https://docs.gitlab.com/api/deployments/#delete-a-specific-deployment -func (s *DeploymentsService) DeleteProjectDeployment(pid any, deployment int, options ...RequestOptionFunc) (*Response, error) { +func (s *DeploymentsService) DeleteProjectDeployment(pid any, deployment int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/deployments_merge_requests.go b/deployments_merge_requests.go index a2b0e717..db64db30 100644 --- a/deployments_merge_requests.go +++ b/deployments_merge_requests.go @@ -21,7 +21,7 @@ import ( type ( // DeploymentMergeRequestsServiceInterface defines all the API methods for the DeploymentMergeRequestsService DeploymentMergeRequestsServiceInterface interface { - 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 @@ -40,7 +40,7 @@ var _ DeploymentMergeRequestsServiceInterface = (*DeploymentMergeRequestsService // // GitLab API docs: // https://docs.gitlab.com/api/deployments/#list-of-merge-requests-associated-with-a-deployment -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/discussions.go b/discussions.go index 04f39968..d4a92b04 100644 --- a/discussions.go +++ b/discussions.go @@ -25,37 +25,37 @@ import ( type ( // DiscussionsServiceInterface defines all the API methods for the DiscussionsService DiscussionsServiceInterface interface { - ListIssueDiscussions(pid any, issue int, opt *ListIssueDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) - GetIssueDiscussion(pid any, issue int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) - CreateIssueDiscussion(pid any, issue int, opt *CreateIssueDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) - AddIssueDiscussionNote(pid any, issue int, discussion string, opt *AddIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - UpdateIssueDiscussionNote(pid any, issue int, discussion string, note int, opt *UpdateIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - DeleteIssueDiscussionNote(pid any, issue int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) - ListSnippetDiscussions(pid any, snippet int, opt *ListSnippetDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) - GetSnippetDiscussion(pid any, snippet int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) - CreateSnippetDiscussion(pid any, snippet int, opt *CreateSnippetDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) - AddSnippetDiscussionNote(pid any, snippet int, discussion string, opt *AddSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - UpdateSnippetDiscussionNote(pid any, snippet int, discussion string, note int, opt *UpdateSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - DeleteSnippetDiscussionNote(pid any, snippet int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) - ListGroupEpicDiscussions(gid any, epic int, opt *ListGroupEpicDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) - GetEpicDiscussion(gid any, epic int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) - CreateEpicDiscussion(gid any, epic int, opt *CreateEpicDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) - AddEpicDiscussionNote(gid any, epic int, discussion string, opt *AddEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - UpdateEpicDiscussionNote(gid any, epic int, discussion string, note int, opt *UpdateEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - DeleteEpicDiscussionNote(gid any, epic int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) - ListMergeRequestDiscussions(pid any, mergeRequest int, opt *ListMergeRequestDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) - GetMergeRequestDiscussion(pid any, mergeRequest int, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) - CreateMergeRequestDiscussion(pid any, mergeRequest int, opt *CreateMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) - ResolveMergeRequestDiscussion(pid any, mergeRequest int, discussion string, opt *ResolveMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) - AddMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, opt *AddMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - UpdateMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, note int, opt *UpdateMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - DeleteMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, note int, options ...RequestOptionFunc) (*Response, error) + ListIssueDiscussions(pid any, issue int64, opt *ListIssueDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) + GetIssueDiscussion(pid any, issue int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) + CreateIssueDiscussion(pid any, issue int64, opt *CreateIssueDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + AddIssueDiscussionNote(pid any, issue int64, discussion string, opt *AddIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateIssueDiscussionNote(pid any, issue int64, discussion string, note int64, opt *UpdateIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + DeleteIssueDiscussionNote(pid any, issue int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) + ListSnippetDiscussions(pid any, snippet int64, opt *ListSnippetDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) + GetSnippetDiscussion(pid any, snippet int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) + CreateSnippetDiscussion(pid any, snippet int64, opt *CreateSnippetDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + AddSnippetDiscussionNote(pid any, snippet int64, discussion string, opt *AddSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateSnippetDiscussionNote(pid any, snippet int64, discussion string, note int64, opt *UpdateSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + DeleteSnippetDiscussionNote(pid any, snippet int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) + ListGroupEpicDiscussions(gid any, epic int64, opt *ListGroupEpicDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) + GetEpicDiscussion(gid any, epic int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) + CreateEpicDiscussion(gid any, epic int64, opt *CreateEpicDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + AddEpicDiscussionNote(gid any, epic int64, discussion string, opt *AddEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateEpicDiscussionNote(gid any, epic int64, discussion string, note int64, opt *UpdateEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + DeleteEpicDiscussionNote(gid any, epic int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) + ListMergeRequestDiscussions(pid any, mergeRequest int64, opt *ListMergeRequestDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) + GetMergeRequestDiscussion(pid any, mergeRequest int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) + CreateMergeRequestDiscussion(pid any, mergeRequest int64, opt *CreateMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + ResolveMergeRequestDiscussion(pid any, mergeRequest int64, discussion string, opt *ResolveMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) + AddMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, opt *AddMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + UpdateMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, note int64, opt *UpdateMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + DeleteMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) ListCommitDiscussions(pid any, commit string, opt *ListCommitDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) GetCommitDiscussion(pid any, commit string, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) CreateCommitDiscussion(pid any, commit string, opt *CreateCommitDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) AddCommitDiscussionNote(pid any, commit string, discussion string, opt *AddCommitDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - UpdateCommitDiscussionNote(pid any, commit string, discussion string, note int, opt *UpdateCommitDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) - DeleteCommitDiscussionNote(pid any, commit string, discussion string, note int, options ...RequestOptionFunc) (*Response, error) + UpdateCommitDiscussionNote(pid any, commit string, discussion string, note int64, opt *UpdateCommitDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + DeleteCommitDiscussionNote(pid any, commit string, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) } // DiscussionsService handles communication with the discussions related @@ -96,7 +96,7 @@ type ListIssueDiscussionsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items -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 @@ -121,7 +121,7 @@ func (s *DiscussionsService) ListIssueDiscussions(pid any, issue int, opt *ListI // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#get-single-issue-discussion-item -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 @@ -160,7 +160,7 @@ type CreateIssueDiscussionOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#create-new-issue-thread -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 @@ -195,7 +195,7 @@ type AddIssueDiscussionNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#add-note-to-existing-issue-thread -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 @@ -234,7 +234,7 @@ type UpdateIssueDiscussionNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#modify-existing-issue-thread-note -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 @@ -264,7 +264,7 @@ func (s *DiscussionsService) UpdateIssueDiscussionNote(pid any, issue int, discu // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#delete-an-issue-thread-note -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 @@ -298,7 +298,7 @@ type ListSnippetDiscussionsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-project-snippet-discussion-items -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 @@ -323,7 +323,7 @@ func (s *DiscussionsService) ListSnippetDiscussions(pid any, snippet int, opt *L // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#get-single-snippet-discussion-item -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 @@ -363,7 +363,7 @@ type CreateSnippetDiscussionOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#create-new-snippet-thread -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 @@ -399,7 +399,7 @@ type AddSnippetDiscussionNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#add-note-to-existing-snippet-thread -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 @@ -438,7 +438,7 @@ type UpdateSnippetDiscussionNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#modify-existing-snippet-thread-note -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 @@ -468,7 +468,7 @@ func (s *DiscussionsService) UpdateSnippetDiscussionNote(pid any, snippet int, d // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#delete-a-snippet-thread-note -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 @@ -502,7 +502,7 @@ type ListGroupEpicDiscussionsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-group-epic-discussion-items -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 @@ -530,7 +530,7 @@ func (s *DiscussionsService) ListGroupEpicDiscussions(gid any, epic int, opt *Li // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#get-single-epic-discussion-item -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 @@ -570,7 +570,7 @@ type CreateEpicDiscussionOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#create-new-epic-thread -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 @@ -608,7 +608,7 @@ type AddEpicDiscussionNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#add-note-to-existing-epic-thread -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 @@ -647,7 +647,7 @@ type UpdateEpicDiscussionNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#modify-existing-epic-thread-note -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 @@ -677,7 +677,7 @@ func (s *DiscussionsService) UpdateEpicDiscussionNote(gid any, epic int, discuss // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#delete-an-epic-thread-note -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 @@ -711,7 +711,7 @@ type ListMergeRequestDiscussionsOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#list-project-merge-request-discussion-items -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 @@ -740,7 +740,7 @@ func (s *DiscussionsService) ListMergeRequestDiscussions(pid any, mergeRequest i // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#get-single-merge-request-discussion-item -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 @@ -785,11 +785,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"` } @@ -804,8 +804,8 @@ 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"` } // CreateMergeRequestDiscussion creates a new discussion for a single merge @@ -813,7 +813,7 @@ type LinePositionOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#create-new-merge-request-thread -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 @@ -851,7 +851,7 @@ type ResolveMergeRequestDiscussionOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#resolve-a-merge-request-thread -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 @@ -891,7 +891,7 @@ type AddMergeRequestDiscussionNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#add-note-to-existing-merge-request-thread -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 @@ -932,7 +932,7 @@ type UpdateMergeRequestDiscussionNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#modify-an-existing-merge-request-thread-note -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 @@ -963,7 +963,7 @@ func (s *DiscussionsService) UpdateMergeRequestDiscussionNote(pid any, mergeRequ // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#delete-a-merge-request-thread-note -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 @@ -1143,7 +1143,7 @@ type UpdateCommitDiscussionNoteOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#modify-an-existing-commit-thread-note -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 @@ -1173,7 +1173,7 @@ func (s *DiscussionsService) UpdateCommitDiscussionNote(pid any, commit string, // // GitLab API docs: // https://docs.gitlab.com/api/discussions/#delete-a-commit-thread-note -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/draft_notes.go b/draft_notes.go index 45209656..178e4207 100644 --- a/draft_notes.go +++ b/draft_notes.go @@ -24,13 +24,13 @@ import ( type ( // DraftNotesServiceInterface defines all the API methods for the DraftNotesService DraftNotesServiceInterface interface { - ListDraftNotes(pid any, mergeRequest int, opt *ListDraftNotesOptions, options ...RequestOptionFunc) ([]*DraftNote, *Response, error) - GetDraftNote(pid any, mergeRequest int, note int, options ...RequestOptionFunc) (*DraftNote, *Response, error) - CreateDraftNote(pid any, mergeRequest int, opt *CreateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) - UpdateDraftNote(pid any, mergeRequest int, note int, opt *UpdateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) - DeleteDraftNote(pid any, mergeRequest int, note int, options ...RequestOptionFunc) (*Response, error) - PublishDraftNote(pid any, mergeRequest int, note int, options ...RequestOptionFunc) (*Response, error) - PublishAllDraftNotes(pid any, mergeRequest int, options ...RequestOptionFunc) (*Response, error) + ListDraftNotes(pid any, mergeRequest int64, opt *ListDraftNotesOptions, options ...RequestOptionFunc) ([]*DraftNote, *Response, error) + GetDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*DraftNote, *Response, error) + CreateDraftNote(pid any, mergeRequest int64, opt *CreateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) + UpdateDraftNote(pid any, mergeRequest int64, note int64, opt *UpdateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) + DeleteDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*Response, error) + PublishDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*Response, error) + PublishAllDraftNotes(pid any, mergeRequest int64, options ...RequestOptionFunc) (*Response, error) } // DraftNotesService handles communication with the draft notes related methods @@ -46,9 +46,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"` @@ -72,7 +72,7 @@ type ListDraftNotesOptions struct { // // Gitlab API docs: // https://docs.gitlab.com/api/draft_notes/#list-all-merge-request-draft-notes -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 @@ -97,7 +97,7 @@ func (s *DraftNotesService) ListDraftNotes(pid any, mergeRequest int, opt *ListD // // Gitlab API docs: // https://docs.gitlab.com/api/draft_notes/#get-a-single-draft-note -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 @@ -135,7 +135,7 @@ type CreateDraftNoteOptions struct { // // Gitlab API docs: // https://docs.gitlab.com/api/draft_notes/#create-a-draft-note -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 @@ -169,7 +169,7 @@ type UpdateDraftNoteOptions struct { // UpdateDraftNote updates a draft note for a merge request. // // Gitlab API docs: https://docs.gitlab.com/api/draft_notes/#create-a-draft-note -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 @@ -194,7 +194,7 @@ func (s *DraftNotesService) UpdateDraftNote(pid any, mergeRequest int, note int, // // Gitlab API docs: // https://docs.gitlab.com/api/draft_notes/#delete-a-draft-note -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 @@ -213,7 +213,7 @@ func (s *DraftNotesService) DeleteDraftNote(pid any, mergeRequest int, note int, // // Gitlab API docs: // https://docs.gitlab.com/api/draft_notes/#publish-a-draft-note -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 @@ -232,7 +232,7 @@ func (s *DraftNotesService) PublishDraftNote(pid any, mergeRequest int, note int // // Gitlab API docs: // https://docs.gitlab.com/api/draft_notes/#publish-a-draft-note -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/enterprise_users.go b/enterprise_users.go index e50b5c51..098758c0 100644 --- a/enterprise_users.go +++ b/enterprise_users.go @@ -23,8 +23,8 @@ import ( type ( EnterpriseUsersServiceInterface interface { ListEnterpriseUsers(gid any, opt *ListEnterpriseUsersOptions, options ...RequestOptionFunc) ([]*User, *Response, error) - GetEnterpriseUser(gid any, uid int, options ...RequestOptionFunc) (*User, *Response, error) - Disable2FAForEnterpriseUser(gid any, uid int, options ...RequestOptionFunc) (*Response, error) + GetEnterpriseUser(gid any, uid int64, options ...RequestOptionFunc) (*User, *Response, error) + Disable2FAForEnterpriseUser(gid any, uid int64, options ...RequestOptionFunc) (*Response, error) } // EnterpriseUsersService handles communication with the enterprise users @@ -83,7 +83,7 @@ func (s *EnterpriseUsersService) ListEnterpriseUsers(gid any, opt *ListEnterpris // // GitLab API docs: // https://docs.gitlab.com/api/group_enterprise_users/#get-details-on-an-enterprise-user -func (s *EnterpriseUsersService) GetEnterpriseUser(gid any, uid int, options ...RequestOptionFunc) (*User, *Response, error) { +func (s *EnterpriseUsersService) GetEnterpriseUser(gid any, uid int64, options ...RequestOptionFunc) (*User, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -109,7 +109,7 @@ func (s *EnterpriseUsersService) GetEnterpriseUser(gid any, uid int, options ... // // 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 int, options ...RequestOptionFunc) (*Response, error) { +func (s *EnterpriseUsersService) Disable2FAForEnterpriseUser(gid any, uid int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/environments.go b/environments.go index 9d8f9fed..907b7e22 100644 --- a/environments.go +++ b/environments.go @@ -26,11 +26,11 @@ type ( // EnvironmentsServiceInterface defines all the API methods for the EnvironmentsService EnvironmentsServiceInterface interface { ListEnvironments(pid any, opts *ListEnvironmentsOptions, options ...RequestOptionFunc) ([]*Environment, *Response, error) - GetEnvironment(pid any, environment int, options ...RequestOptionFunc) (*Environment, *Response, error) + GetEnvironment(pid any, environment int64, options ...RequestOptionFunc) (*Environment, *Response, error) CreateEnvironment(pid any, opt *CreateEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) - EditEnvironment(pid any, environment int, opt *EditEnvironmentOptions, options ...RequestOptionFunc) (*Environment, *Response, error) - DeleteEnvironment(pid any, environment int, options ...RequestOptionFunc) (*Response, error) - 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 @@ -48,7 +48,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"` @@ -111,7 +111,7 @@ func (s *EnvironmentsService) ListEnvironments(pid any, opts *ListEnvironmentsOp // // GitLab API docs: // https://docs.gitlab.com/api/environments/#get-a-specific-environment -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -141,7 +141,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"` @@ -183,7 +183,7 @@ 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"` @@ -193,7 +193,7 @@ type EditEnvironmentOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/environments/#update-an-existing-environment -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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -218,7 +218,7 @@ func (s *EnvironmentsService) EditEnvironment(pid any, environment int, opt *Edi // // GitLab API docs: // https://docs.gitlab.com/api/environments/#delete-an-environment -func (s *EnvironmentsService) DeleteEnvironment(pid any, environment int, options ...RequestOptionFunc) (*Response, error) { +func (s *EnvironmentsService) DeleteEnvironment(pid any, environment int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -245,7 +245,7 @@ type StopEnvironmentOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/environments/#stop-an-environment -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) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/environments_test.go b/environments_test.go index 7c655024..16d4734c 100644 --- a/environments_test.go +++ b/environments_test.go @@ -217,7 +217,7 @@ func TestCreateEnvironment(t *testing.T) { Description: Ptr("test"), ExternalURL: Ptr("https://deploy.example.gitlab.com"), Tier: Ptr("production"), - ClusterAgentID: Ptr(1), + ClusterAgentID: Ptr(int64(1)), KubernetesNamespace: Ptr("flux-system"), FluxResourcePath: Ptr("HelmRelease/flux-system"), AutoStopSetting: Ptr("always"), @@ -297,7 +297,7 @@ func TestEditEnvironment(t *testing.T) { Description: Ptr("test"), ExternalURL: Ptr("https://staging.example.gitlab.com"), Tier: Ptr("staging"), - ClusterAgentID: Ptr(1), + ClusterAgentID: Ptr(int64(1)), KubernetesNamespace: Ptr("flux-system"), FluxResourcePath: Ptr("HelmRelease/flux-system"), AutoStopSetting: Ptr("with_action"), @@ -421,7 +421,7 @@ func TestUnmarshal(t *testing.T) { err := json.Unmarshal([]byte(jsonObject), &env) if assert.NoError(t, err) { - assert.Equal(t, 10, env.ID) + assert.Equal(t, int64(10), env.ID) assert.Equal(t, "production", env.Name) assert.Equal(t, "test", env.Description) assert.Equal(t, "https://example.com", env.ExternalURL) diff --git a/epic_issues.go b/epic_issues.go index 625d86c1..41c36d4f 100644 --- a/epic_issues.go +++ b/epic_issues.go @@ -26,13 +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(gid any, epic int, opt *ListOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) + 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 - AssignEpicIssue(gid any, epic, issue int, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) + AssignEpicIssue(gid any, epic, issue int64, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) // Will be removed in v5 of the API, use Work Items API instead - RemoveEpicIssue(gid any, epic, epicIssue int, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) + RemoveEpicIssue(gid any, epic, epicIssue int64, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) // Will be removed in v5 of the API, use Work Items API instead - 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 @@ -54,7 +54,7 @@ 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"` } @@ -64,7 +64,7 @@ type EpicIssueAssignment struct { // // Gitlab API docs: // https://docs.gitlab.com/api/epic_issues/#list-issues-for-an-epic -func (s *EpicIssuesService) ListEpicIssues(gid any, epic int, opt *ListOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { +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 @@ -90,7 +90,7 @@ func (s *EpicIssuesService) ListEpicIssues(gid any, epic int, opt *ListOptions, // // Gitlab API Docs: // https://docs.gitlab.com/api/epic_issues/#assign-an-issue-to-the-epic -func (s *EpicIssuesService) AssignEpicIssue(gid any, epic, issue int, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) { +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 @@ -116,7 +116,7 @@ func (s *EpicIssuesService) AssignEpicIssue(gid any, epic, issue int, options .. // // Gitlab API Docs: // https://docs.gitlab.com/api/epic_issues/#remove-an-issue-from-the-epic -func (s *EpicIssuesService) RemoveEpicIssue(gid any, epic, epicIssue int, options ...RequestOptionFunc) (*EpicIssueAssignment, *Response, error) { +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 @@ -145,8 +145,8 @@ func (s *EpicIssuesService) RemoveEpicIssue(gid any, epic, epicIssue int, option // https://docs.gitlab.com/api/epic_issues/#update-epic---issue-association 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. @@ -159,7 +159,7 @@ type UpdateEpicIsssueAssignmentOptions = UpdateEpicIssueAssignmentOptions // // 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/epics.go b/epics.go index fa3f6b61..36080201 100644 --- a/epics.go +++ b/epics.go @@ -29,15 +29,15 @@ type ( // Will be removed in v5 of the API, use Work Items API instead ListGroupEpics(gid any, opt *ListGroupEpicsOptions, options ...RequestOptionFunc) ([]*Epic, *Response, error) // Will be removed in v5 of the API, use Work Items API instead - GetEpic(gid any, epic int, options ...RequestOptionFunc) (*Epic, *Response, error) + GetEpic(gid any, epic int64, options ...RequestOptionFunc) (*Epic, *Response, error) // Will be removed in v5 of the API, use Work Items API instead - GetEpicLinks(gid any, epic int, options ...RequestOptionFunc) ([]*Epic, *Response, error) + GetEpicLinks(gid any, epic int64, options ...RequestOptionFunc) ([]*Epic, *Response, error) // Will be removed in v5 of the API, use Work Items API instead CreateEpic(gid any, opt *CreateEpicOptions, options ...RequestOptionFunc) (*Epic, *Response, error) // Will be removed in v5 of the API, use Work Items API instead - UpdateEpic(gid any, epic int, opt *UpdateEpicOptions, options ...RequestOptionFunc) (*Epic, *Response, error) + 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 - 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 @@ -56,7 +56,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"` @@ -69,10 +69,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"` @@ -91,9 +91,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"` } @@ -110,7 +110,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"` @@ -156,7 +156,7 @@ func (s *EpicsService) ListGroupEpics(gid any, opt *ListGroupEpicsOptions, optio // 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 int, options ...RequestOptionFunc) (*Epic, *Response, error) { +func (s *EpicsService) GetEpic(gid any, epic int64, options ...RequestOptionFunc) (*Epic, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -181,7 +181,7 @@ func (s *EpicsService) GetEpic(gid any, epic int, options ...RequestOptionFunc) // 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 int, options ...RequestOptionFunc) ([]*Epic, *Response, error) { +func (s *EpicsService) GetEpicLinks(gid any, epic int64, options ...RequestOptionFunc) ([]*Epic, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -217,7 +217,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"` } // CreateEpic creates a new group epic. @@ -256,7 +256,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"` @@ -271,7 +271,7 @@ type UpdateEpicOptions struct { // 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 int, opt *UpdateEpicOptions, options ...RequestOptionFunc) (*Epic, *Response, error) { +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 @@ -296,7 +296,7 @@ func (s *EpicsService) UpdateEpic(gid any, epic int, opt *UpdateEpicOptions, opt // 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 int, options ...RequestOptionFunc) (*Response, error) { +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/epics_test.go b/epics_test.go index e9bbd8d7..7d3e378d 100644 --- a/epics_test.go +++ b/epics_test.go @@ -74,7 +74,7 @@ func TestListGroupEpics(t *testing.T) { }) listGroupEpics := &ListGroupEpicsOptions{ - AuthorID: Ptr(26), + AuthorID: Ptr(int64(26)), State: Ptr("opened"), } diff --git a/error_tracking.go b/error_tracking.go index 22e5e231..80256d3f 100644 --- a/error_tracking.go +++ b/error_tracking.go @@ -28,7 +28,7 @@ type ( EnableDisableErrorTracking(pid any, opt *EnableDisableErrorTrackingOptions, options ...RequestOptionFunc) (*ErrorTrackingSettings, *Response, error) ListClientKeys(pid any, opt *ListClientKeysOptions, options ...RequestOptionFunc) ([]*ErrorTrackingClientKey, *Response, error) CreateClientKey(pid any, options ...RequestOptionFunc) (*ErrorTrackingClientKey, *Response, error) - 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 @@ -47,7 +47,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"` @@ -195,7 +195,7 @@ func (s *ErrorTrackingService) CreateClientKey(pid any, options ...RequestOption // // GitLab API docs: // https://docs.gitlab.com/api/error_tracking/#delete-a-client-key -func (s *ErrorTrackingService) DeleteClientKey(pid any, keyID int, options ...RequestOptionFunc) (*Response, error) { +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/event_parsing_webhook_test.go b/event_parsing_webhook_test.go index 4c47d399..e7c0c18a 100644 --- a/event_parsing_webhook_test.go +++ b/event_parsing_webhook_test.go @@ -261,8 +261,8 @@ func TestParseIssueHook(t *testing.T) { t.Errorf("Assignee username is %v, want %v", event.Assignee.Username, "user1") } assert.Len(t, event.Labels, 1) - assert.Equal(t, 0, event.Changes.UpdatedByID.Previous) - assert.Equal(t, 1, event.Changes.UpdatedByID.Current) + assert.Equal(t, int64(0), event.Changes.UpdatedByID.Previous) + assert.Equal(t, int64(1), event.Changes.UpdatedByID.Current) assert.Len(t, event.Changes.Labels.Previous, 1) assert.Len(t, event.Changes.Labels.Current, 1) assert.Empty(t, event.Changes.Description.Previous) @@ -356,8 +356,8 @@ func TestParseMergeRequestHook(t *testing.T) { t.Errorf("WorkInProgress is %v, want %v", event.ObjectAttributes.WorkInProgress, false) } assert.Len(t, event.Labels, 1) - assert.Equal(t, 0, event.Changes.UpdatedByID.Previous) - assert.Equal(t, 1, event.Changes.UpdatedByID.Current) + assert.Equal(t, int64(0), event.Changes.UpdatedByID.Previous) + assert.Equal(t, int64(1), event.Changes.UpdatedByID.Current) assert.Len(t, event.Changes.Labels.Previous, 1) assert.Len(t, event.Changes.Labels.Current, 1) } diff --git a/event_systemhook_types.go b/event_systemhook_types.go index de0cd7f5..fdbc1351 100644 --- a/event_systemhook_types.go +++ b/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"` @@ -137,15 +137,15 @@ type PushSystemEvent struct { After string `json:"after"` Ref string `json:"ref"` CheckoutSHA string `json:"checkout_sha"` - UserID int `json:"user_id"` + 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 int `json:"project_id"` + ProjectID int64 `json:"project_id"` Project PushSystemEventProject `json:"project"` Commits []PushSystemEventCommit `json:"commits"` - TotalCommitsCount int `json:"total_commits_count"` + TotalCommitsCount int64 `json:"total_commits_count"` } // PushSystemEventProject represents a push system event's project. @@ -160,7 +160,7 @@ type PushSystemEventProject struct { GitHTTPURL string `json:"git_http_url"` GitSSHURL string `json:"git_ssh_url"` Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` + VisibilityLevel int64 `json:"visibility_level"` PathWithNamespace string `json:"path_with_namespace"` DefaultBranch string `json:"default_branch"` Homepage string `json:"homepage"` @@ -198,15 +198,15 @@ type TagPushSystemEvent struct { After string `json:"after"` Ref string `json:"ref"` CheckoutSHA string `json:"checkout_sha"` - UserID int `json:"user_id"` + 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 int `json:"project_id"` + ProjectID int64 `json:"project_id"` Project TagPushSystemEventProject `json:"project"` Commits []TagPushSystemEventCommit `json:"commits"` - TotalCommitsCount int `json:"total_commits_count"` + TotalCommitsCount int64 `json:"total_commits_count"` } // TagPushSystemEventProject represents a tag push system event's project. @@ -221,7 +221,7 @@ type TagPushSystemEventProject struct { GitHTTPURL string `json:"git_http_url"` GitSSHURL string `json:"git_ssh_url"` Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` + VisibilityLevel int64 `json:"visibility_level"` PathWithNamespace string `json:"path_with_namespace"` DefaultBranch string `json:"default_branch"` Homepage string `json:"homepage"` @@ -255,11 +255,11 @@ type TagPushSystemEventCommitAuthor struct { // https://docs.gitlab.com/administration/system_hooks/#repository-update-events type RepositoryUpdateSystemEvent struct { BaseSystemEvent - UserID int `json:"user_id"` + UserID int64 `json:"user_id"` UserName string `json:"user_name"` UserEmail string `json:"user_email"` UserAvatar string `json:"user_avatar"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Project RepositoryUpdateSystemEventProject `json:"project"` Changes []RepositoryUpdateSystemEventChange `json:"changes"` Refs []string `json:"refs"` @@ -270,7 +270,7 @@ type RepositoryUpdateSystemEvent struct { // GitLab API docs: // https://docs.gitlab.com/administration/system_hooks/#repository-update-events type RepositoryUpdateSystemEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` WebURL string `json:"web_url"` @@ -278,7 +278,7 @@ type RepositoryUpdateSystemEventProject struct { GitHTTPURL string `json:"git_http_url"` GitSSHURL string `json:"git_ssh_url"` Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` + VisibilityLevel int64 `json:"visibility_level"` PathWithNamespace string `json:"path_with_namespace"` DefaultBranch string `json:"default_branch"` CiConfigPath string `json:"ci_config_path"` diff --git a/event_webhook_types.go b/event_webhook_types.go index 04092950..0d4af58b 100644 --- a/event_webhook_types.go +++ b/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 @@ -48,7 +48,7 @@ type BuildEvent struct { Tag bool `json:"tag"` BeforeSHA string `json:"before_sha"` SHA string `json:"sha"` - BuildID int `json:"build_id"` + BuildID int64 `json:"build_id"` BuildName string `json:"build_name"` BuildStage string `json:"build_stage"` BuildStatus string `json:"build_status"` @@ -57,7 +57,7 @@ type BuildEvent struct { BuildFinishedAt string `json:"build_finished_at"` BuildDuration float64 `json:"build_duration"` BuildAllowFailure bool `json:"build_allow_failure"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` ProjectName string `json:"project_name"` User *EventUser `json:"user"` Commit BuildEventCommit `json:"commit"` @@ -65,13 +65,13 @@ type BuildEvent struct { } type BuildEventCommit struct { - ID int `json:"id"` + 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 int `json:"duration"` + Duration int64 `json:"duration"` StartedAt string `json:"started_at"` FinishedAt string `json:"finished_at"` } @@ -84,7 +84,7 @@ type CommitCommentEvent struct { ObjectKind string `json:"object_kind"` EventType string `json:"event_type"` User *User `json:"user"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Project CommitCommentEventProject `json:"project"` Repository *Repository `json:"repository"` ObjectAttributes CommitCommentEventObjectAttributes `json:"object_attributes"` @@ -92,7 +92,7 @@ type CommitCommentEvent struct { } type CommitCommentEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` AvatarURL string `json:"avatar_url"` @@ -110,17 +110,17 @@ type CommitCommentEventProject struct { } type CommitCommentEventObjectAttributes struct { - ID int `json:"id"` + ID int64 `json:"id"` Note string `json:"note"` NoteableType string `json:"noteable_type"` - AuthorID int `json:"author_id"` + AuthorID int64 `json:"author_id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Attachment string `json:"attachment"` LineCode string `json:"line_code"` CommitID string `json:"commit_id"` - NoteableID int `json:"noteable_id"` + NoteableID int64 `json:"noteable_id"` System bool `json:"system"` StDiff *Diff `json:"st_diff"` Description string `json:"description"` @@ -150,8 +150,8 @@ 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"` + DeploymentID int64 `json:"deployment_id"` + DeployableID int64 `json:"deployable_id"` DeployableURL string `json:"deployable_url"` Environment string `json:"environment"` EnvironmentSlug string `json:"environment_slug"` @@ -166,7 +166,7 @@ type DeploymentEvent struct { } type DeploymentEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` AvatarURL *string `json:"avatar_url"` @@ -180,7 +180,7 @@ type DeploymentEventProject struct { SSHURL string `json:"ssh_url"` HTTPURL string `json:"http_url"` WebURL string `json:"web_url"` - VisibilityLevel int `json:"visibility_level"` + VisibilityLevel int64 `json:"visibility_level"` CIConfigPath string `json:"ci_config_path"` } @@ -197,7 +197,7 @@ type FeatureFlagEvent struct { } type FeatureFlagEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` AvatarURL *string `json:"avatar_url"` @@ -211,12 +211,12 @@ type FeatureFlagEventProject struct { SSHURL string `json:"ssh_url"` HTTPURL string `json:"http_url"` WebURL string `json:"web_url"` - VisibilityLevel int `json:"visibility_level"` + VisibilityLevel int64 `json:"visibility_level"` CIConfigPath string `json:"ci_config_path"` } type FeatureFlagEventObjectAttributes struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` Active bool `json:"active"` @@ -235,14 +235,14 @@ type GroupResourceAccessTokenEvent struct { } type GroupResourceAccessTokenEventGroup struct { - GroupID int `json:"group_id"` + GroupID int64 `json:"group_id"` GroupName string `json:"group_name"` GroupPath string `json:"group_path"` } type GroupResourceAccessTokenEventObjectAttributes struct { - ID int `json:"id"` - UserID int `json:"user_id"` + ID int64 `json:"id"` + UserID int64 `json:"user_id"` Name string `json:"name"` CreatedAt string `json:"created_at"` ExpiresAt *ISOTime `json:"expires_at"` @@ -256,7 +256,7 @@ type IssueCommentEvent struct { ObjectKind string `json:"object_kind"` EventType string `json:"event_type"` User *User `json:"user"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Project IssueCommentEventProject `json:"project"` Repository *Repository `json:"repository"` ObjectAttributes IssueCommentEventObjectAttributes `json:"object_attributes"` @@ -281,18 +281,18 @@ type IssueCommentEventProject struct { } type IssueCommentEventObjectAttributes struct { - ID int `json:"id"` + ID int64 `json:"id"` Note string `json:"note"` NoteableType string `json:"noteable_type"` - AuthorID int `json:"author_id"` + AuthorID int64 `json:"author_id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` - ProjectID int `json:"project_id"` + 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 int `json:"noteable_id"` + NoteableID int64 `json:"noteable_id"` System bool `json:"system"` StDiff []*Diff `json:"st_diff"` Description string `json:"description"` @@ -301,32 +301,32 @@ type IssueCommentEventObjectAttributes struct { } type IssueCommentEventIssue 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"` + 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 int `json:"last_edited_by_id"` + LastEditedByID int64 `json:"last_edited_by_id"` UpdatedAt string `json:"updated_at"` - UpdatedByID int `json:"updated_by_id"` + 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 int `json:"time_estimate"` + TimeEstimate int64 `json:"time_estimate"` Confidential bool `json:"confidential"` - TotalTimeSpent int `json:"total_time_spent"` + TotalTimeSpent int64 `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"` + AssigneeIDs []int64 `json:"assignee_ids"` + AssigneeID int64 `json:"assignee_id"` } // IssueEvent represents a issue event. @@ -347,7 +347,7 @@ type IssueEvent struct { } type IssueEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` AvatarURL string `json:"avatar_url"` @@ -365,35 +365,35 @@ type IssueEventProject struct { } type IssueEventObjectAttributes struct { - ID int `json:"id"` + ID int64 `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"` + 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 int `json:"updated_by_id"` + UpdatedByID int64 `json:"updated_by_id"` LastEditedAt string `json:"last_edited_at"` - LastEditedByID int `json:"last_edited_by_id"` - RelativePosition int `json:"relative_position"` + LastEditedByID int64 `json:"last_edited_by_id"` + RelativePosition int64 `json:"relative_position"` BranchName string `json:"branch_name"` Description string `json:"description"` - MilestoneID int `json:"milestone_id"` + 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 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"` + 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 int `json:"weight"` - IID int `json:"iid"` + Weight int64 `json:"weight"` + IID int64 `json:"iid"` URL string `json:"url"` State string `json:"state"` Action string `json:"action"` @@ -404,7 +404,7 @@ type IssueEventObjectAttributes struct { } type IssueEventObjectAttributesEscalationPolicy struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` } @@ -456,13 +456,13 @@ type EventChangesUpdatedAt struct { } type EventChangesUpdatedByID struct { - Previous int `json:"previous"` - Current int `json:"current"` + Previous int64 `json:"previous"` + Current int64 `json:"current"` } type IssueEventChangesTotalTimeSpent struct { - Previous int `json:"previous"` - Current int `json:"current"` + Previous int64 `json:"previous"` + Current int64 `json:"current"` } // JobEvent represents a job event. @@ -475,7 +475,7 @@ type JobEvent struct { Tag bool `json:"tag"` BeforeSHA string `json:"before_sha"` SHA string `json:"sha"` - BuildID int `json:"build_id"` + BuildID int64 `json:"build_id"` BuildName string `json:"build_name"` BuildStage string `json:"build_stage"` BuildStatus string `json:"build_status"` @@ -486,9 +486,9 @@ type JobEvent struct { 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"` + 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"` @@ -499,7 +499,7 @@ type JobEvent struct { } type JobEventCommit struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` SHA string `json:"sha"` Message string `json:"message"` @@ -507,13 +507,13 @@ type JobEventCommit struct { AuthorEmail string `json:"author_email"` AuthorURL string `json:"author_url"` Status string `json:"status"` - Duration int `json:"duration"` + Duration int64 `json:"duration"` StartedAt string `json:"started_at"` FinishedAt string `json:"finished_at"` } type JobEventRunner struct { - ID int `json:"id"` + ID int64 `json:"id"` Active bool `json:"active"` RunnerType string `json:"runner_type"` IsShared bool `json:"is_shared"` @@ -529,12 +529,12 @@ type EventEnvironment struct { type EventSourcePipeline struct { Project EventSourcePipelineProject `json:"project"` - PipelineID int `json:"pipeline_id"` - JobID int `json:"job_id"` + PipelineID int64 `json:"pipeline_id"` + JobID int64 `json:"job_id"` } type EventSourcePipelineProject struct { - ID int `json:"id"` + ID int64 `json:"id"` WebURL string `json:"web_url"` PathWithNamespace string `json:"path_with_namespace"` } @@ -548,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"` @@ -567,7 +567,7 @@ type MergeCommentEvent struct { ObjectKind string `json:"object_kind"` EventType string `json:"event_type"` User *EventUser `json:"user"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Project MergeCommentEventProject `json:"project"` ObjectAttributes MergeCommentEventObjectAttributes `json:"object_attributes"` Repository *Repository `json:"repository"` @@ -575,7 +575,7 @@ type MergeCommentEvent struct { } type MergeCommentEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` AvatarURL string `json:"avatar_url"` @@ -594,74 +594,74 @@ type MergeCommentEventProject struct { type MergeCommentEventObjectAttributes struct { Attachment string `json:"attachment"` - AuthorID int `json:"author_id"` + 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 int `json:"id"` + ID int64 `json:"id"` LineCode string `json:"line_code"` Note string `json:"note"` - NoteableID int `json:"noteable_id"` + NoteableID int64 `json:"noteable_id"` NoteableType string `json:"noteable_type"` OriginalPosition *NotePosition `json:"original_position"` Position *NotePosition `json:"position"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` ResolvedAt string `json:"resolved_at"` - ResolvedByID int `json:"resolved_by_id"` + 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 int `json:"updated_by_id"` + UpdatedByID int64 `json:"updated_by_id"` Description string `json:"description"` Action CommentEventAction `json:"action"` URL string `json:"url"` } type MergeCommentEventMergeRequest struct { - ID int `json:"id"` + ID int64 `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"` + 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 int `json:"milestone_id"` + MilestoneID int64 `json:"milestone_id"` State string `json:"state"` MergeStatus string `json:"merge_status"` - TargetProjectID int `json:"target_project_id"` - IID int `json:"iid"` + TargetProjectID int64 `json:"target_project_id"` + IID int64 `json:"iid"` Description string `json:"description"` - Position int `json:"position"` + Position int64 `json:"position"` Labels []*EventLabel `json:"labels"` LockedAt string `json:"locked_at"` - UpdatedByID int `json:"updated_by_id"` + UpdatedByID int64 `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"` + 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 int `json:"lock_version"` + LockVersion int64 `json:"lock_version"` ApprovalsBeforeMerge string `json:"approvals_before_merge"` RebaseCommitSHA string `json:"rebase_commit_sha"` - TimeEstimate int `json:"time_estimate"` + TimeEstimate int64 `json:"time_estimate"` Squash bool `json:"squash"` LastEditedAt string `json:"last_edited_at"` - LastEditedByID int `json:"last_edited_by_id"` + 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 int `json:"total_time_spent"` - HeadPipelineID int `json:"head_pipeline_id"` + 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"` @@ -694,7 +694,7 @@ type MergeEvent struct { } type MergeEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` AvatarURL string `json:"avatar_url"` @@ -713,51 +713,51 @@ type MergeEventProject struct { } type MergeEventObjectAttributes struct { - ID int `json:"id"` + ID int64 `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"` + 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 int `json:"last_edited_by_id"` - MilestoneID int `json:"milestone_id"` + 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 int `json:"target_project_id"` - IID int `json:"iid"` + TargetProjectID int64 `json:"target_project_id"` + IID int64 `json:"iid"` Description string `json:"description"` - Position int `json:"position"` + Position int64 `json:"position"` LockedAt string `json:"locked_at"` - UpdatedByID int `json:"updated_by_id"` + UpdatedByID int64 `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"` + 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 int `json:"lock_version"` - TimeEstimate int `json:"time_estimate"` + LockVersion int64 `json:"lock_version"` + TimeEstimate int64 `json:"time_estimate"` Source *Repository `json:"source"` Target *Repository `json:"target"` - HeadPipelineID *int `json:"head_pipeline_id"` + 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 int `json:"total_time_spent"` - TimeChange int `json:"time_change"` + 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"` @@ -805,8 +805,8 @@ type MergeEventChangesLastEditedAt struct { } type MergeEventChangesLastEditedByID struct { - Previous int `json:"previous"` - Current int `json:"current"` + Previous int64 `json:"previous"` + Current int64 `json:"current"` } type MergeEventChangesMergeStatus struct { @@ -815,8 +815,8 @@ type MergeEventChangesMergeStatus struct { } type MergeEventChangesMilestoneID struct { - Previous int `json:"previous"` - Current int `json:"current"` + Previous int64 `json:"previous"` + Current int64 `json:"current"` } type MergeEventChangesSourceBranch struct { @@ -825,8 +825,8 @@ type MergeEventChangesSourceBranch struct { } type MergeEventChangesSourceProjectID struct { - Previous int `json:"previous"` - Current int `json:"current"` + Previous int64 `json:"previous"` + Current int64 `json:"current"` } type MergeEventChangesTargetBranch struct { @@ -835,14 +835,14 @@ type MergeEventChangesTargetBranch struct { } type MergeEventChangesTargetProjectID struct { - Previous int `json:"previous"` - Current int `json:"current"` + 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"` @@ -905,8 +905,8 @@ type PipelineEvent struct { } type PipelineEventObjectAttributes struct { - ID int `json:"id"` - IID int `json:"iid"` + ID int64 `json:"id"` + IID int64 `json:"iid"` Name string `json:"name"` Ref string `json:"ref"` Tag bool `json:"tag"` @@ -918,8 +918,8 @@ type PipelineEventObjectAttributes struct { Stages []string `json:"stages"` CreatedAt string `json:"created_at"` FinishedAt string `json:"finished_at"` - Duration int `json:"duration"` - QueuedDuration int `json:"queued_duration"` + Duration int64 `json:"duration"` + QueuedDuration int64 `json:"queued_duration"` URL string `json:"url"` Variables []PipelineEventObjectAttributesVariable `json:"variables"` } @@ -930,13 +930,13 @@ type PipelineEventObjectAttributesVariable struct { } type PipelineEventMergeRequest struct { - ID int `json:"id"` - IID int `json:"iid"` + ID int64 `json:"id"` + IID int64 `json:"iid"` Title string `json:"title"` SourceBranch string `json:"source_branch"` - SourceProjectID int `json:"source_project_id"` + SourceProjectID int64 `json:"source_project_id"` TargetBranch string `json:"target_branch"` - TargetProjectID int `json:"target_project_id"` + TargetProjectID int64 `json:"target_project_id"` State string `json:"state"` MergeRequestStatus string `json:"merge_status"` DetailedMergeStatus string `json:"detailed_merge_status"` @@ -944,7 +944,7 @@ type PipelineEventMergeRequest struct { } type PipelineEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` AvatarURL string `json:"avatar_url"` @@ -971,7 +971,7 @@ type PipelineEventCommit struct { } type PipelineEventBuild struct { - ID int `json:"id"` + ID int64 `json:"id"` Stage string `json:"stage"` Name string `json:"name"` Status string `json:"status"` @@ -991,7 +991,7 @@ type PipelineEventBuild struct { } type PipelineEventBuildRunner struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` Active bool `json:"active"` IsShared bool `json:"is_shared"` @@ -1001,7 +1001,7 @@ type PipelineEventBuildRunner struct { type PipelineEventBuildArtifactsFile struct { Filename string `json:"filename"` - Size int `json:"size"` + Size int64 `json:"size"` } // ProjectResourceAccessTokenEvent represents a resource access token event for @@ -1017,7 +1017,7 @@ type ProjectResourceAccessTokenEvent struct { } type ProjectResourceAccessTokenEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` WebURL string `json:"web_url"` @@ -1025,7 +1025,7 @@ type ProjectResourceAccessTokenEventProject struct { GitSSHURL string `json:"git_ssh_url"` GitHTTPURL string `json:"git_http_url"` Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` + VisibilityLevel int64 `json:"visibility_level"` PathWithNamespace string `json:"path_with_namespace"` DefaultBranch string `json:"default_branch"` CIConfigPath string `json:"ci_config_path"` @@ -1036,8 +1036,8 @@ type ProjectResourceAccessTokenEventProject struct { } type ProjectResourceAccessTokenEventObjectAttributes struct { - ID int `json:"id"` - UserID int `json:"user_id"` + ID int64 `json:"id"` + UserID int64 `json:"user_id"` Name string `json:"name"` CreatedAt string `json:"created_at"` ExpiresAt *ISOTime `json:"expires_at"` @@ -1055,20 +1055,20 @@ type PushEvent struct { Ref string `json:"ref"` RefProtected bool `json:"ref_protected"` CheckoutSHA string `json:"checkout_sha"` - UserID int `json:"user_id"` + 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 int `json:"project_id"` + ProjectID int64 `json:"project_id"` Project PushEventProject `json:"project"` Repository *Repository `json:"repository"` Commits []*PushEventCommit `json:"commits"` - TotalCommitsCount int `json:"total_commits_count"` + TotalCommitsCount int64 `json:"total_commits_count"` } type PushEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` AvatarURL string `json:"avatar_url"` @@ -1102,7 +1102,7 @@ type PushEventCommit struct { // GitLab API docs: // https://docs.gitlab.com/user/project/integrations/webhook_events/#release-events type ReleaseEvent struct { - ID int `json:"id"` + 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"` @@ -1117,7 +1117,7 @@ type ReleaseEvent struct { } type ReleaseEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` WebURL string `json:"web_url"` @@ -1125,7 +1125,7 @@ type ReleaseEventProject struct { GitSSHURL string `json:"git_ssh_url"` GitHTTPURL string `json:"git_http_url"` Namespace string `json:"namespace"` - VisibilityLevel int `json:"visibility_level"` + VisibilityLevel int64 `json:"visibility_level"` PathWithNamespace string `json:"path_with_namespace"` DefaultBranch string `json:"default_branch"` CIConfigPath string `json:"ci_config_path"` @@ -1136,13 +1136,13 @@ type ReleaseEventProject struct { } type ReleaseEventAssets struct { - Count int `json:"count"` + Count int64 `json:"count"` Links []ReleaseEventAssetsLink `json:"links"` Sources []ReleaseEventAssetsSource `json:"sources"` } type ReleaseEventAssetsLink struct { - ID int `json:"id"` + ID int64 `json:"id"` External bool `json:"external"` LinkType string `json:"link_type"` Name string `json:"name"` @@ -1171,7 +1171,7 @@ type SnippetCommentEvent struct { ObjectKind string `json:"object_kind"` EventType string `json:"event_type"` User *EventUser `json:"user"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Project SnippetCommentEventProject `json:"project"` Repository *Repository `json:"repository"` ObjectAttributes SnippetCommentEventObjectAttributes `json:"object_attributes"` @@ -1196,17 +1196,17 @@ type SnippetCommentEventProject struct { } type SnippetCommentEventObjectAttributes struct { - ID int `json:"id"` + ID int64 `json:"id"` Note string `json:"note"` NoteableType string `json:"noteable_type"` - AuthorID int `json:"author_id"` + AuthorID int64 `json:"author_id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Attachment string `json:"attachment"` LineCode string `json:"line_code"` CommitID string `json:"commit_id"` - NoteableID int `json:"noteable_id"` + NoteableID int64 `json:"noteable_id"` System bool `json:"system"` StDiff *Diff `json:"st_diff"` Description string `json:"description"` @@ -1215,17 +1215,17 @@ type SnippetCommentEventObjectAttributes struct { } type SnippetCommentEventSnippet struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` Content string `json:"content"` - AuthorID int `json:"author_id"` - ProjectID int `json:"project_id"` + 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 int `json:"visibility_level"` + VisibilityLevel int64 `json:"visibility_level"` Description string `json:"description"` Secret bool `json:"secret"` RepositoryReadOnly bool `json:"repository_read_only"` @@ -1242,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"` @@ -1260,21 +1260,21 @@ type TagEvent struct { After string `json:"after"` Ref string `json:"ref"` CheckoutSHA string `json:"checkout_sha"` - UserID int `json:"user_id"` + 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 int `json:"project_id"` + ProjectID int64 `json:"project_id"` Message string `json:"message"` Project TagEventProject `json:"project"` Repository *Repository `json:"repository"` Commits []*TagEventCommit `json:"commits"` - TotalCommitsCount int `json:"total_commits_count"` + TotalCommitsCount int64 `json:"total_commits_count"` } type TagEventProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` AvatarURL string `json:"avatar_url"` @@ -1356,14 +1356,14 @@ type WikiPageEventObjectAttributes 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/events.go b/events.go index 62f7bd59..f3ed263b 100644 --- a/events.go +++ b/events.go @@ -45,14 +45,14 @@ var _ EventsServiceInterface = (*EventsService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/events/#get-user-contribution-events type ContributionEvent struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` ActionName string `json:"action_name"` - TargetID int `json:"target_id"` - TargetIID int `json:"target_iid"` + TargetID int64 `json:"target_id"` + TargetIID int64 `json:"target_iid"` TargetType string `json:"target_type"` - AuthorID int `json:"author_id"` + AuthorID int64 `json:"author_id"` TargetTitle string `json:"target_title"` CreatedAt *time.Time `json:"created_at"` PushData ContributionEventPushData `json:"push_data"` @@ -66,7 +66,7 @@ type ContributionEvent struct { // GitLab API docs: // https://docs.gitlab.com/api/events/#get-user-contribution-events type ContributionEventPushData struct { - CommitCount int `json:"commit_count"` + CommitCount int64 `json:"commit_count"` Action string `json:"action"` RefType string `json:"ref_type"` CommitFrom string `json:"commit_from"` @@ -137,14 +137,14 @@ 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"` + ID int64 `json:"id"` Title string `json:"title"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` ActionName string `json:"action_name"` - TargetID int `json:"target_id"` - TargetIID int `json:"target_iid"` + TargetID int64 `json:"target_id"` + TargetIID int64 `json:"target_iid"` TargetType string `json:"target_type"` - AuthorID int `json:"author_id"` + AuthorID int64 `json:"author_id"` TargetTitle string `json:"target_title"` CreatedAt string `json:"created_at"` Author BasicUser `json:"author"` @@ -166,11 +166,11 @@ type ProjectEventData struct { Before string `json:"before"` After string `json:"after"` Ref string `json:"ref"` - UserID int `json:"user_id"` + UserID int64 `json:"user_id"` UserName string `json:"user_name"` Repository *Repository `json:"repository"` Commits []*Commit `json:"commits"` - TotalCommitsCount int `json:"total_commits_count"` + TotalCommitsCount int64 `json:"total_commits_count"` } func (d ProjectEventData) String() string { @@ -182,15 +182,15 @@ func (d ProjectEventData) String() string { // GitLab API docs: // https://docs.gitlab.com/api/events/#list-a-projects-visible-events type ProjectEventNote struct { - ID int `json:"id"` + 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 int `json:"noteable_id"` + NoteableID int64 `json:"noteable_id"` NoteableType string `json:"noteable_type"` - NoteableIID int `json:"noteable_iid"` + NoteableIID int64 `json:"noteable_iid"` } func (n ProjectEventNote) String() string { @@ -202,7 +202,7 @@ func (n ProjectEventNote) String() string { // GitLab API docs: // https://docs.gitlab.com/api/events/#list-a-projects-visible-events type ProjectEventNoteAuthor struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Email string `json:"email"` Name string `json:"name"` @@ -220,7 +220,7 @@ func (a ProjectEventNoteAuthor) String() string { // GitLab API docs: // https://docs.gitlab.com/api/events/#list-a-projects-visible-events type ProjectEventPushData struct { - CommitCount int `json:"commit_count"` + CommitCount int64 `json:"commit_count"` Action string `json:"action"` RefType string `json:"ref_type"` CommitFrom string `json:"commit_from"` diff --git a/external_status_checks.go b/external_status_checks.go index aff042ad..4e235bd5 100644 --- a/external_status_checks.go +++ b/external_status_checks.go @@ -12,25 +12,25 @@ type ( // Deprecated: to be removed in 1.0; use CreateProjectExternalStatusCheck instead CreateExternalStatusCheck(pid any, opt *CreateExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) // Deprecated: to be removed in 1.0; use DeleteProjectExternalStatusCheck instead - DeleteExternalStatusCheck(pid any, check int, options ...RequestOptionFunc) (*Response, error) + DeleteExternalStatusCheck(pid any, check int64, options ...RequestOptionFunc) (*Response, error) // Deprecated: to be removed in 1.0; use UpdateProjectExternalStatusCheck instead - UpdateExternalStatusCheck(pid any, check int, opt *UpdateExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) + UpdateExternalStatusCheck(pid any, check int64, opt *UpdateExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) // Deprecated: to be removed in 1.0; use ListProjectMergeRequestExternalStatusChecks instead - ListMergeStatusChecks(pid any, mr int, opt *ListOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) + ListMergeStatusChecks(pid any, mr int64, opt *ListOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) // Deprecated: to be removed in 1.0; use ListProjectExternalStatusChecks instead ListProjectStatusChecks(pid any, opt *ListOptions, options ...RequestOptionFunc) ([]*ProjectStatusCheck, *Response, error) // Deprecated: to be removed in 1.0; use RetryFailedExternalStatusCheckForProjectMergeRequest instead - RetryFailedStatusCheckForAMergeRequest(pid any, mergeRequest int, externalStatusCheck int, options ...RequestOptionFunc) (*Response, error) + RetryFailedStatusCheckForAMergeRequest(pid any, mergeRequest int64, externalStatusCheck int64, options ...RequestOptionFunc) (*Response, error) // Deprecated: to be removed in 1.0; use SetProjectMergeRequestExternalStatusCheckStatus instead - SetExternalStatusCheckStatus(pid any, mergeRequest int, opt *SetExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) + SetExternalStatusCheckStatus(pid any, mergeRequest int64, opt *SetExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) - 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(pid any, opt *ListProjectExternalStatusChecksOptions, options ...RequestOptionFunc) ([]*ProjectStatusCheck, *Response, error) - 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(pid any, opt *CreateProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*ProjectStatusCheck, *Response, error) - UpdateProjectExternalStatusCheck(pid any, check int, opt *UpdateProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*ProjectStatusCheck, *Response, error) - DeleteProjectExternalStatusCheck(pid any, check int, opt *DeleteProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) - SetProjectMergeRequestExternalStatusCheckStatus(pid any, mergeRequest int, opt *SetProjectMergeRequestExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) + UpdateProjectExternalStatusCheck(pid any, check int64, opt *UpdateProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*ProjectStatusCheck, *Response, error) + DeleteProjectExternalStatusCheck(pid any, check int64, opt *DeleteProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) + SetProjectMergeRequestExternalStatusCheckStatus(pid any, mergeRequest int64, opt *SetProjectMergeRequestExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) } // ExternalStatusChecksService handles communication with the external @@ -45,24 +45,24 @@ 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"` @@ -75,7 +75,7 @@ type StatusCheckProtectedBranch struct { // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#list-status-checks-for-a-merge-request -func (s *ExternalStatusChecksService) ListMergeStatusChecks(pid any, mr int, opt *ListOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) { +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 @@ -113,7 +113,7 @@ type SetExternalStatusCheckStatusOptions struct { // // Gitlab API docs: // https://docs.gitlab.com/api/status_checks/#set-status-of-an-external-status-check -func (s *ExternalStatusChecksService) SetExternalStatusCheckStatus(pid any, mergeRequest int, opt *SetExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *ExternalStatusChecksService) SetExternalStatusCheckStatus(pid any, mergeRequest int64, opt *SetExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -191,7 +191,7 @@ func (s *ExternalStatusChecksService) CreateExternalStatusCheck(pid any, opt *Cr // // Gitlab API docs: // https://docs.gitlab.com/api/status_checks/#delete-external-status-check-service -func (s *ExternalStatusChecksService) DeleteExternalStatusCheck(pid any, check int, options ...RequestOptionFunc) (*Response, error) { +func (s *ExternalStatusChecksService) DeleteExternalStatusCheck(pid any, check int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -223,7 +223,7 @@ type UpdateExternalStatusCheckOptions struct { // // Gitlab API docs: // https://docs.gitlab.com/api/status_checks/#update-external-status-check-service -func (s *ExternalStatusChecksService) UpdateExternalStatusCheck(pid any, check int, opt *UpdateExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *ExternalStatusChecksService) UpdateExternalStatusCheck(pid any, check int64, opt *UpdateExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -243,7 +243,7 @@ func (s *ExternalStatusChecksService) UpdateExternalStatusCheck(pid any, check i // // 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 int, externalStatusCheck int, options ...RequestOptionFunc) (*Response, error) { +func (s *ExternalStatusChecksService) RetryFailedStatusCheckForAMergeRequest(pid any, mergeRequest int64, externalStatusCheck int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -272,7 +272,7 @@ type ListProjectMergeRequestExternalStatusChecksOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/status_checks/#list-status-checks-for-a-merge-request -func (s *ExternalStatusChecksService) ListProjectMergeRequestExternalStatusChecks(pid any, mr int, opt *ListProjectMergeRequestExternalStatusChecksOptions, options ...RequestOptionFunc) ([]*MergeStatusCheck, *Response, error) { +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 @@ -375,7 +375,7 @@ type DeleteProjectExternalStatusCheckOptions struct{} // // Gitlab API docs: // https://docs.gitlab.com/api/status_checks/#delete-external-status-check-service -func (s *ExternalStatusChecksService) DeleteProjectExternalStatusCheck(pid any, check int, opt *DeleteProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) { +func (s *ExternalStatusChecksService) DeleteProjectExternalStatusCheck(pid any, check int64, opt *DeleteProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -406,7 +406,7 @@ type UpdateProjectExternalStatusCheckOptions struct { // // Gitlab API docs: // https://docs.gitlab.com/api/status_checks/#update-external-status-check-service -func (s *ExternalStatusChecksService) UpdateProjectExternalStatusCheck(pid any, check int, opt *UpdateProjectExternalStatusCheckOptions, options ...RequestOptionFunc) (*ProjectStatusCheck, *Response, error) { +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 @@ -438,7 +438,7 @@ type RetryFailedExternalStatusCheckForProjectMergeRequestOptions struct{} // // 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 int, externalStatusCheck int, opt *RetryFailedExternalStatusCheckForProjectMergeRequestOptions, options ...RequestOptionFunc) (*Response, error) { +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 @@ -468,7 +468,7 @@ type SetProjectMergeRequestExternalStatusCheckStatusOptions struct { // // Gitlab API docs: // https://docs.gitlab.com/api/status_checks/#set-status-of-an-external-status-check -func (s *ExternalStatusChecksService) SetProjectMergeRequestExternalStatusCheckStatus(pid any, mergeRequest int, opt *SetProjectMergeRequestExternalStatusCheckStatusOptions, options ...RequestOptionFunc) (*Response, error) { +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/testing/container_registry_protection_rules_mock.go b/testing/container_registry_protection_rules_mock.go index 28e41b40..2f12b304 100644 --- a/testing/container_registry_protection_rules_mock.go +++ b/testing/container_registry_protection_rules_mock.go @@ -86,7 +86,7 @@ func (c *MockContainerRegistryProtectionRulesServiceInterfaceCreateContainerRegi } // DeleteContainerRegistryProtectionRule mocks base method. -func (m *MockContainerRegistryProtectionRulesServiceInterface) DeleteContainerRegistryProtectionRule(pid any, ruleID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockContainerRegistryProtectionRulesServiceInterface) DeleteContainerRegistryProtectionRule(pid any, ruleID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, ruleID} for _, a := range options { @@ -118,13 +118,13 @@ func (c *MockContainerRegistryProtectionRulesServiceInterfaceDeleteContainerRegi } // Do rewrite *gomock.Call.Do -func (c *MockContainerRegistryProtectionRulesServiceInterfaceDeleteContainerRegistryProtectionRuleCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryProtectionRulesServiceInterfaceDeleteContainerRegistryProtectionRuleCall { +func (c *MockContainerRegistryProtectionRulesServiceInterfaceDeleteContainerRegistryProtectionRuleCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryProtectionRulesServiceInterfaceDeleteContainerRegistryProtectionRuleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockContainerRegistryProtectionRulesServiceInterfaceDeleteContainerRegistryProtectionRuleCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryProtectionRulesServiceInterfaceDeleteContainerRegistryProtectionRuleCall { +func (c *MockContainerRegistryProtectionRulesServiceInterfaceDeleteContainerRegistryProtectionRuleCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockContainerRegistryProtectionRulesServiceInterfaceDeleteContainerRegistryProtectionRuleCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -175,7 +175,7 @@ func (c *MockContainerRegistryProtectionRulesServiceInterfaceListContainerRegist } // UpdateContainerRegistryProtectionRule mocks base method. -func (m *MockContainerRegistryProtectionRulesServiceInterface) UpdateContainerRegistryProtectionRule(pid any, ruleID int, opt *gitlab.UpdateContainerRegistryProtectionRuleOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ContainerRegistryProtectionRule, *gitlab.Response, error) { +func (m *MockContainerRegistryProtectionRulesServiceInterface) UpdateContainerRegistryProtectionRule(pid any, ruleID int64, opt *gitlab.UpdateContainerRegistryProtectionRuleOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ContainerRegistryProtectionRule, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, ruleID, opt} for _, a := range options { @@ -208,13 +208,13 @@ func (c *MockContainerRegistryProtectionRulesServiceInterfaceUpdateContainerRegi } // Do rewrite *gomock.Call.Do -func (c *MockContainerRegistryProtectionRulesServiceInterfaceUpdateContainerRegistryProtectionRuleCall) Do(f func(any, int, *gitlab.UpdateContainerRegistryProtectionRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.ContainerRegistryProtectionRule, *gitlab.Response, error)) *MockContainerRegistryProtectionRulesServiceInterfaceUpdateContainerRegistryProtectionRuleCall { +func (c *MockContainerRegistryProtectionRulesServiceInterfaceUpdateContainerRegistryProtectionRuleCall) Do(f func(any, int64, *gitlab.UpdateContainerRegistryProtectionRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.ContainerRegistryProtectionRule, *gitlab.Response, error)) *MockContainerRegistryProtectionRulesServiceInterfaceUpdateContainerRegistryProtectionRuleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockContainerRegistryProtectionRulesServiceInterfaceUpdateContainerRegistryProtectionRuleCall) DoAndReturn(f func(any, int, *gitlab.UpdateContainerRegistryProtectionRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.ContainerRegistryProtectionRule, *gitlab.Response, error)) *MockContainerRegistryProtectionRulesServiceInterfaceUpdateContainerRegistryProtectionRuleCall { +func (c *MockContainerRegistryProtectionRulesServiceInterfaceUpdateContainerRegistryProtectionRuleCall) DoAndReturn(f func(any, int64, *gitlab.UpdateContainerRegistryProtectionRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.ContainerRegistryProtectionRule, *gitlab.Response, error)) *MockContainerRegistryProtectionRulesServiceInterfaceUpdateContainerRegistryProtectionRuleCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/custom_attributes_mock.go b/testing/custom_attributes_mock.go index 247a0bfa..2ab1ec3f 100644 --- a/testing/custom_attributes_mock.go +++ b/testing/custom_attributes_mock.go @@ -41,7 +41,7 @@ func (m *MockCustomAttributesServiceInterface) EXPECT() *MockCustomAttributesSer } // DeleteCustomGroupAttribute mocks base method. -func (m *MockCustomAttributesServiceInterface) DeleteCustomGroupAttribute(group int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) DeleteCustomGroupAttribute(group int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{group, key} for _, a := range options { @@ -73,19 +73,19 @@ func (c *MockCustomAttributesServiceInterfaceDeleteCustomGroupAttributeCall) Ret } // Do rewrite *gomock.Call.Do -func (c *MockCustomAttributesServiceInterfaceDeleteCustomGroupAttributeCall) Do(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomGroupAttributeCall { +func (c *MockCustomAttributesServiceInterfaceDeleteCustomGroupAttributeCall) Do(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomGroupAttributeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockCustomAttributesServiceInterfaceDeleteCustomGroupAttributeCall) DoAndReturn(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomGroupAttributeCall { +func (c *MockCustomAttributesServiceInterfaceDeleteCustomGroupAttributeCall) DoAndReturn(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomGroupAttributeCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteCustomProjectAttribute mocks base method. -func (m *MockCustomAttributesServiceInterface) DeleteCustomProjectAttribute(project int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) DeleteCustomProjectAttribute(project int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{project, key} for _, a := range options { @@ -117,19 +117,19 @@ func (c *MockCustomAttributesServiceInterfaceDeleteCustomProjectAttributeCall) R } // Do rewrite *gomock.Call.Do -func (c *MockCustomAttributesServiceInterfaceDeleteCustomProjectAttributeCall) Do(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomProjectAttributeCall { +func (c *MockCustomAttributesServiceInterfaceDeleteCustomProjectAttributeCall) Do(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomProjectAttributeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockCustomAttributesServiceInterfaceDeleteCustomProjectAttributeCall) DoAndReturn(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomProjectAttributeCall { +func (c *MockCustomAttributesServiceInterfaceDeleteCustomProjectAttributeCall) DoAndReturn(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomProjectAttributeCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteCustomUserAttribute mocks base method. -func (m *MockCustomAttributesServiceInterface) DeleteCustomUserAttribute(user int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) DeleteCustomUserAttribute(user int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, key} for _, a := range options { @@ -161,19 +161,19 @@ func (c *MockCustomAttributesServiceInterfaceDeleteCustomUserAttributeCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockCustomAttributesServiceInterfaceDeleteCustomUserAttributeCall) Do(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomUserAttributeCall { +func (c *MockCustomAttributesServiceInterfaceDeleteCustomUserAttributeCall) Do(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomUserAttributeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockCustomAttributesServiceInterfaceDeleteCustomUserAttributeCall) DoAndReturn(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomUserAttributeCall { +func (c *MockCustomAttributesServiceInterfaceDeleteCustomUserAttributeCall) DoAndReturn(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockCustomAttributesServiceInterfaceDeleteCustomUserAttributeCall { c.Call = c.Call.DoAndReturn(f) return c } // GetCustomGroupAttribute mocks base method. -func (m *MockCustomAttributesServiceInterface) GetCustomGroupAttribute(group int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) GetCustomGroupAttribute(group int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{group, key} for _, a := range options { @@ -206,19 +206,19 @@ func (c *MockCustomAttributesServiceInterfaceGetCustomGroupAttributeCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockCustomAttributesServiceInterfaceGetCustomGroupAttributeCall) Do(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomGroupAttributeCall { +func (c *MockCustomAttributesServiceInterfaceGetCustomGroupAttributeCall) Do(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomGroupAttributeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockCustomAttributesServiceInterfaceGetCustomGroupAttributeCall) DoAndReturn(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomGroupAttributeCall { +func (c *MockCustomAttributesServiceInterfaceGetCustomGroupAttributeCall) DoAndReturn(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomGroupAttributeCall { c.Call = c.Call.DoAndReturn(f) return c } // GetCustomProjectAttribute mocks base method. -func (m *MockCustomAttributesServiceInterface) GetCustomProjectAttribute(project int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) GetCustomProjectAttribute(project int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{project, key} for _, a := range options { @@ -251,19 +251,19 @@ func (c *MockCustomAttributesServiceInterfaceGetCustomProjectAttributeCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockCustomAttributesServiceInterfaceGetCustomProjectAttributeCall) Do(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomProjectAttributeCall { +func (c *MockCustomAttributesServiceInterfaceGetCustomProjectAttributeCall) Do(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomProjectAttributeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockCustomAttributesServiceInterfaceGetCustomProjectAttributeCall) DoAndReturn(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomProjectAttributeCall { +func (c *MockCustomAttributesServiceInterfaceGetCustomProjectAttributeCall) DoAndReturn(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomProjectAttributeCall { c.Call = c.Call.DoAndReturn(f) return c } // GetCustomUserAttribute mocks base method. -func (m *MockCustomAttributesServiceInterface) GetCustomUserAttribute(user int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) GetCustomUserAttribute(user int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, key} for _, a := range options { @@ -296,19 +296,19 @@ func (c *MockCustomAttributesServiceInterfaceGetCustomUserAttributeCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockCustomAttributesServiceInterfaceGetCustomUserAttributeCall) Do(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomUserAttributeCall { +func (c *MockCustomAttributesServiceInterfaceGetCustomUserAttributeCall) Do(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomUserAttributeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockCustomAttributesServiceInterfaceGetCustomUserAttributeCall) DoAndReturn(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomUserAttributeCall { +func (c *MockCustomAttributesServiceInterfaceGetCustomUserAttributeCall) DoAndReturn(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceGetCustomUserAttributeCall { c.Call = c.Call.DoAndReturn(f) return c } // ListCustomGroupAttributes mocks base method. -func (m *MockCustomAttributesServiceInterface) ListCustomGroupAttributes(group int, options ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) ListCustomGroupAttributes(group int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{group} for _, a := range options { @@ -341,19 +341,19 @@ func (c *MockCustomAttributesServiceInterfaceListCustomGroupAttributesCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockCustomAttributesServiceInterfaceListCustomGroupAttributesCall) Do(f func(int, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomGroupAttributesCall { +func (c *MockCustomAttributesServiceInterfaceListCustomGroupAttributesCall) Do(f func(int64, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomGroupAttributesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockCustomAttributesServiceInterfaceListCustomGroupAttributesCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomGroupAttributesCall { +func (c *MockCustomAttributesServiceInterfaceListCustomGroupAttributesCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomGroupAttributesCall { c.Call = c.Call.DoAndReturn(f) return c } // ListCustomProjectAttributes mocks base method. -func (m *MockCustomAttributesServiceInterface) ListCustomProjectAttributes(project int, options ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) ListCustomProjectAttributes(project int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{project} for _, a := range options { @@ -386,19 +386,19 @@ func (c *MockCustomAttributesServiceInterfaceListCustomProjectAttributesCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockCustomAttributesServiceInterfaceListCustomProjectAttributesCall) Do(f func(int, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomProjectAttributesCall { +func (c *MockCustomAttributesServiceInterfaceListCustomProjectAttributesCall) Do(f func(int64, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomProjectAttributesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockCustomAttributesServiceInterfaceListCustomProjectAttributesCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomProjectAttributesCall { +func (c *MockCustomAttributesServiceInterfaceListCustomProjectAttributesCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomProjectAttributesCall { c.Call = c.Call.DoAndReturn(f) return c } // ListCustomUserAttributes mocks base method. -func (m *MockCustomAttributesServiceInterface) ListCustomUserAttributes(user int, options ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) ListCustomUserAttributes(user int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -431,19 +431,19 @@ func (c *MockCustomAttributesServiceInterfaceListCustomUserAttributesCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockCustomAttributesServiceInterfaceListCustomUserAttributesCall) Do(f func(int, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomUserAttributesCall { +func (c *MockCustomAttributesServiceInterfaceListCustomUserAttributesCall) Do(f func(int64, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomUserAttributesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockCustomAttributesServiceInterfaceListCustomUserAttributesCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomUserAttributesCall { +func (c *MockCustomAttributesServiceInterfaceListCustomUserAttributesCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) ([]*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceListCustomUserAttributesCall { c.Call = c.Call.DoAndReturn(f) return c } // SetCustomGroupAttribute mocks base method. -func (m *MockCustomAttributesServiceInterface) SetCustomGroupAttribute(group int, c gitlab.CustomAttribute, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) SetCustomGroupAttribute(group int64, c gitlab.CustomAttribute, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{group, c} for _, a := range options { @@ -476,19 +476,19 @@ func (c_2 *MockCustomAttributesServiceInterfaceSetCustomGroupAttributeCall) Retu } // Do rewrite *gomock.Call.Do -func (c_2 *MockCustomAttributesServiceInterfaceSetCustomGroupAttributeCall) Do(f func(int, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomGroupAttributeCall { +func (c_2 *MockCustomAttributesServiceInterfaceSetCustomGroupAttributeCall) Do(f func(int64, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomGroupAttributeCall { c_2.Call = c_2.Call.Do(f) return c_2 } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c_2 *MockCustomAttributesServiceInterfaceSetCustomGroupAttributeCall) DoAndReturn(f func(int, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomGroupAttributeCall { +func (c_2 *MockCustomAttributesServiceInterfaceSetCustomGroupAttributeCall) DoAndReturn(f func(int64, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomGroupAttributeCall { c_2.Call = c_2.Call.DoAndReturn(f) return c_2 } // SetCustomProjectAttribute mocks base method. -func (m *MockCustomAttributesServiceInterface) SetCustomProjectAttribute(project int, c gitlab.CustomAttribute, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) SetCustomProjectAttribute(project int64, c gitlab.CustomAttribute, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{project, c} for _, a := range options { @@ -521,19 +521,19 @@ func (c_2 *MockCustomAttributesServiceInterfaceSetCustomProjectAttributeCall) Re } // Do rewrite *gomock.Call.Do -func (c_2 *MockCustomAttributesServiceInterfaceSetCustomProjectAttributeCall) Do(f func(int, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomProjectAttributeCall { +func (c_2 *MockCustomAttributesServiceInterfaceSetCustomProjectAttributeCall) Do(f func(int64, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomProjectAttributeCall { c_2.Call = c_2.Call.Do(f) return c_2 } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c_2 *MockCustomAttributesServiceInterfaceSetCustomProjectAttributeCall) DoAndReturn(f func(int, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomProjectAttributeCall { +func (c_2 *MockCustomAttributesServiceInterfaceSetCustomProjectAttributeCall) DoAndReturn(f func(int64, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomProjectAttributeCall { c_2.Call = c_2.Call.DoAndReturn(f) return c_2 } // SetCustomUserAttribute mocks base method. -func (m *MockCustomAttributesServiceInterface) SetCustomUserAttribute(user int, c gitlab.CustomAttribute, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { +func (m *MockCustomAttributesServiceInterface) SetCustomUserAttribute(user int64, c gitlab.CustomAttribute, options ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, c} for _, a := range options { @@ -566,13 +566,13 @@ func (c_2 *MockCustomAttributesServiceInterfaceSetCustomUserAttributeCall) Retur } // Do rewrite *gomock.Call.Do -func (c_2 *MockCustomAttributesServiceInterfaceSetCustomUserAttributeCall) Do(f func(int, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomUserAttributeCall { +func (c_2 *MockCustomAttributesServiceInterfaceSetCustomUserAttributeCall) Do(f func(int64, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomUserAttributeCall { c_2.Call = c_2.Call.Do(f) return c_2 } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c_2 *MockCustomAttributesServiceInterfaceSetCustomUserAttributeCall) DoAndReturn(f func(int, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomUserAttributeCall { +func (c_2 *MockCustomAttributesServiceInterfaceSetCustomUserAttributeCall) DoAndReturn(f func(int64, gitlab.CustomAttribute, ...gitlab.RequestOptionFunc) (*gitlab.CustomAttribute, *gitlab.Response, error)) *MockCustomAttributesServiceInterfaceSetCustomUserAttributeCall { c_2.Call = c_2.Call.DoAndReturn(f) return c_2 } diff --git a/testing/database_migrations_mock.go b/testing/database_migrations_mock.go index ffa58d3b..b59ada99 100644 --- a/testing/database_migrations_mock.go +++ b/testing/database_migrations_mock.go @@ -41,7 +41,7 @@ func (m *MockDatabaseMigrationsServiceInterface) EXPECT() *MockDatabaseMigration } // MarkMigrationAsSuccessful mocks base method. -func (m *MockDatabaseMigrationsServiceInterface) MarkMigrationAsSuccessful(version int, opt *gitlab.MarkMigrationAsSuccessfulOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDatabaseMigrationsServiceInterface) MarkMigrationAsSuccessful(version int64, opt *gitlab.MarkMigrationAsSuccessfulOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{version, opt} for _, a := range options { @@ -73,13 +73,13 @@ func (c *MockDatabaseMigrationsServiceInterfaceMarkMigrationAsSuccessfulCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockDatabaseMigrationsServiceInterfaceMarkMigrationAsSuccessfulCall) Do(f func(int, *gitlab.MarkMigrationAsSuccessfulOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDatabaseMigrationsServiceInterfaceMarkMigrationAsSuccessfulCall { +func (c *MockDatabaseMigrationsServiceInterfaceMarkMigrationAsSuccessfulCall) Do(f func(int64, *gitlab.MarkMigrationAsSuccessfulOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDatabaseMigrationsServiceInterfaceMarkMigrationAsSuccessfulCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDatabaseMigrationsServiceInterfaceMarkMigrationAsSuccessfulCall) DoAndReturn(f func(int, *gitlab.MarkMigrationAsSuccessfulOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDatabaseMigrationsServiceInterfaceMarkMigrationAsSuccessfulCall { +func (c *MockDatabaseMigrationsServiceInterfaceMarkMigrationAsSuccessfulCall) DoAndReturn(f func(int64, *gitlab.MarkMigrationAsSuccessfulOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDatabaseMigrationsServiceInterfaceMarkMigrationAsSuccessfulCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/dependency_list_export_mock.go b/testing/dependency_list_export_mock.go index 53f266fa..3c995c38 100644 --- a/testing/dependency_list_export_mock.go +++ b/testing/dependency_list_export_mock.go @@ -42,7 +42,7 @@ func (m *MockDependencyListExportServiceInterface) EXPECT() *MockDependencyListE } // CreateDependencyListExport mocks base method. -func (m *MockDependencyListExportServiceInterface) CreateDependencyListExport(pipelineID int, opt *gitlab.CreateDependencyListExportOptions, options ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error) { +func (m *MockDependencyListExportServiceInterface) CreateDependencyListExport(pipelineID int64, opt *gitlab.CreateDependencyListExportOptions, options ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pipelineID, opt} for _, a := range options { @@ -75,19 +75,19 @@ func (c *MockDependencyListExportServiceInterfaceCreateDependencyListExportCall) } // Do rewrite *gomock.Call.Do -func (c *MockDependencyListExportServiceInterfaceCreateDependencyListExportCall) Do(f func(int, *gitlab.CreateDependencyListExportOptions, ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceCreateDependencyListExportCall { +func (c *MockDependencyListExportServiceInterfaceCreateDependencyListExportCall) Do(f func(int64, *gitlab.CreateDependencyListExportOptions, ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceCreateDependencyListExportCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDependencyListExportServiceInterfaceCreateDependencyListExportCall) DoAndReturn(f func(int, *gitlab.CreateDependencyListExportOptions, ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceCreateDependencyListExportCall { +func (c *MockDependencyListExportServiceInterfaceCreateDependencyListExportCall) DoAndReturn(f func(int64, *gitlab.CreateDependencyListExportOptions, ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceCreateDependencyListExportCall { c.Call = c.Call.DoAndReturn(f) return c } // DownloadDependencyListExport mocks base method. -func (m *MockDependencyListExportServiceInterface) DownloadDependencyListExport(id int, options ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error) { +func (m *MockDependencyListExportServiceInterface) DownloadDependencyListExport(id int64, options ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{id} for _, a := range options { @@ -120,19 +120,19 @@ func (c *MockDependencyListExportServiceInterfaceDownloadDependencyListExportCal } // Do rewrite *gomock.Call.Do -func (c *MockDependencyListExportServiceInterfaceDownloadDependencyListExportCall) Do(f func(int, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceDownloadDependencyListExportCall { +func (c *MockDependencyListExportServiceInterfaceDownloadDependencyListExportCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceDownloadDependencyListExportCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDependencyListExportServiceInterfaceDownloadDependencyListExportCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceDownloadDependencyListExportCall { +func (c *MockDependencyListExportServiceInterfaceDownloadDependencyListExportCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceDownloadDependencyListExportCall { c.Call = c.Call.DoAndReturn(f) return c } // GetDependencyListExport mocks base method. -func (m *MockDependencyListExportServiceInterface) GetDependencyListExport(id int, options ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error) { +func (m *MockDependencyListExportServiceInterface) GetDependencyListExport(id int64, options ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{id} for _, a := range options { @@ -165,13 +165,13 @@ func (c *MockDependencyListExportServiceInterfaceGetDependencyListExportCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockDependencyListExportServiceInterfaceGetDependencyListExportCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceGetDependencyListExportCall { +func (c *MockDependencyListExportServiceInterfaceGetDependencyListExportCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceGetDependencyListExportCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDependencyListExportServiceInterfaceGetDependencyListExportCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceGetDependencyListExportCall { +func (c *MockDependencyListExportServiceInterfaceGetDependencyListExportCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.DependencyListExport, *gitlab.Response, error)) *MockDependencyListExportServiceInterfaceGetDependencyListExportCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/deploy_keys_mock.go b/testing/deploy_keys_mock.go index 406d8b41..129d3c01 100644 --- a/testing/deploy_keys_mock.go +++ b/testing/deploy_keys_mock.go @@ -131,7 +131,7 @@ func (c *MockDeployKeysServiceInterfaceAddInstanceDeployKeyCall) DoAndReturn(f f } // DeleteDeployKey mocks base method. -func (m *MockDeployKeysServiceInterface) DeleteDeployKey(pid any, deployKey int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDeployKeysServiceInterface) DeleteDeployKey(pid any, deployKey int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployKey} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockDeployKeysServiceInterfaceDeleteDeployKeyCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockDeployKeysServiceInterfaceDeleteDeployKeyCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployKeysServiceInterfaceDeleteDeployKeyCall { +func (c *MockDeployKeysServiceInterfaceDeleteDeployKeyCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployKeysServiceInterfaceDeleteDeployKeyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeployKeysServiceInterfaceDeleteDeployKeyCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployKeysServiceInterfaceDeleteDeployKeyCall { +func (c *MockDeployKeysServiceInterfaceDeleteDeployKeyCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployKeysServiceInterfaceDeleteDeployKeyCall { c.Call = c.Call.DoAndReturn(f) return c } // EnableDeployKey mocks base method. -func (m *MockDeployKeysServiceInterface) EnableDeployKey(pid any, deployKey int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error) { +func (m *MockDeployKeysServiceInterface) EnableDeployKey(pid any, deployKey int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployKey} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockDeployKeysServiceInterfaceEnableDeployKeyCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockDeployKeysServiceInterfaceEnableDeployKeyCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceEnableDeployKeyCall { +func (c *MockDeployKeysServiceInterfaceEnableDeployKeyCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceEnableDeployKeyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeployKeysServiceInterfaceEnableDeployKeyCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceEnableDeployKeyCall { +func (c *MockDeployKeysServiceInterfaceEnableDeployKeyCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceEnableDeployKeyCall { c.Call = c.Call.DoAndReturn(f) return c } // GetDeployKey mocks base method. -func (m *MockDeployKeysServiceInterface) GetDeployKey(pid any, deployKey int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error) { +func (m *MockDeployKeysServiceInterface) GetDeployKey(pid any, deployKey int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployKey} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockDeployKeysServiceInterfaceGetDeployKeyCall) Return(arg0 *gitlab.Pro } // Do rewrite *gomock.Call.Do -func (c *MockDeployKeysServiceInterfaceGetDeployKeyCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceGetDeployKeyCall { +func (c *MockDeployKeysServiceInterfaceGetDeployKeyCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceGetDeployKeyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeployKeysServiceInterfaceGetDeployKeyCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceGetDeployKeyCall { +func (c *MockDeployKeysServiceInterfaceGetDeployKeyCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceGetDeployKeyCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -400,7 +400,7 @@ func (c *MockDeployKeysServiceInterfaceListUserProjectDeployKeysCall) DoAndRetur } // UpdateDeployKey mocks base method. -func (m *MockDeployKeysServiceInterface) UpdateDeployKey(pid any, deployKey int, opt *gitlab.UpdateDeployKeyOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error) { +func (m *MockDeployKeysServiceInterface) UpdateDeployKey(pid any, deployKey int64, opt *gitlab.UpdateDeployKeyOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployKey, opt} for _, a := range options { @@ -433,13 +433,13 @@ func (c *MockDeployKeysServiceInterfaceUpdateDeployKeyCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockDeployKeysServiceInterfaceUpdateDeployKeyCall) Do(f func(any, int, *gitlab.UpdateDeployKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceUpdateDeployKeyCall { +func (c *MockDeployKeysServiceInterfaceUpdateDeployKeyCall) Do(f func(any, int64, *gitlab.UpdateDeployKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceUpdateDeployKeyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeployKeysServiceInterfaceUpdateDeployKeyCall) DoAndReturn(f func(any, int, *gitlab.UpdateDeployKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceUpdateDeployKeyCall { +func (c *MockDeployKeysServiceInterfaceUpdateDeployKeyCall) DoAndReturn(f func(any, int64, *gitlab.UpdateDeployKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectDeployKey, *gitlab.Response, error)) *MockDeployKeysServiceInterfaceUpdateDeployKeyCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/deploy_tokens_mock.go b/testing/deploy_tokens_mock.go index 4cffe2f8..f4445001 100644 --- a/testing/deploy_tokens_mock.go +++ b/testing/deploy_tokens_mock.go @@ -131,7 +131,7 @@ func (c *MockDeployTokensServiceInterfaceCreateProjectDeployTokenCall) DoAndRetu } // DeleteGroupDeployToken mocks base method. -func (m *MockDeployTokensServiceInterface) DeleteGroupDeployToken(gid any, deployToken int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDeployTokensServiceInterface) DeleteGroupDeployToken(gid any, deployToken int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, deployToken} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockDeployTokensServiceInterfaceDeleteGroupDeployTokenCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockDeployTokensServiceInterfaceDeleteGroupDeployTokenCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployTokensServiceInterfaceDeleteGroupDeployTokenCall { +func (c *MockDeployTokensServiceInterfaceDeleteGroupDeployTokenCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployTokensServiceInterfaceDeleteGroupDeployTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeployTokensServiceInterfaceDeleteGroupDeployTokenCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployTokensServiceInterfaceDeleteGroupDeployTokenCall { +func (c *MockDeployTokensServiceInterfaceDeleteGroupDeployTokenCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployTokensServiceInterfaceDeleteGroupDeployTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteProjectDeployToken mocks base method. -func (m *MockDeployTokensServiceInterface) DeleteProjectDeployToken(pid any, deployToken int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDeployTokensServiceInterface) DeleteProjectDeployToken(pid any, deployToken int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployToken} for _, a := range options { @@ -207,19 +207,19 @@ func (c *MockDeployTokensServiceInterfaceDeleteProjectDeployTokenCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockDeployTokensServiceInterfaceDeleteProjectDeployTokenCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployTokensServiceInterfaceDeleteProjectDeployTokenCall { +func (c *MockDeployTokensServiceInterfaceDeleteProjectDeployTokenCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployTokensServiceInterfaceDeleteProjectDeployTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeployTokensServiceInterfaceDeleteProjectDeployTokenCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployTokensServiceInterfaceDeleteProjectDeployTokenCall { +func (c *MockDeployTokensServiceInterfaceDeleteProjectDeployTokenCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeployTokensServiceInterfaceDeleteProjectDeployTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGroupDeployToken mocks base method. -func (m *MockDeployTokensServiceInterface) GetGroupDeployToken(gid any, deployToken int, options ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error) { +func (m *MockDeployTokensServiceInterface) GetGroupDeployToken(gid any, deployToken int64, options ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, deployToken} for _, a := range options { @@ -252,19 +252,19 @@ func (c *MockDeployTokensServiceInterfaceGetGroupDeployTokenCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockDeployTokensServiceInterfaceGetGroupDeployTokenCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error)) *MockDeployTokensServiceInterfaceGetGroupDeployTokenCall { +func (c *MockDeployTokensServiceInterfaceGetGroupDeployTokenCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error)) *MockDeployTokensServiceInterfaceGetGroupDeployTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeployTokensServiceInterfaceGetGroupDeployTokenCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error)) *MockDeployTokensServiceInterfaceGetGroupDeployTokenCall { +func (c *MockDeployTokensServiceInterfaceGetGroupDeployTokenCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error)) *MockDeployTokensServiceInterfaceGetGroupDeployTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // GetProjectDeployToken mocks base method. -func (m *MockDeployTokensServiceInterface) GetProjectDeployToken(pid any, deployToken int, options ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error) { +func (m *MockDeployTokensServiceInterface) GetProjectDeployToken(pid any, deployToken int64, options ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployToken} for _, a := range options { @@ -297,13 +297,13 @@ func (c *MockDeployTokensServiceInterfaceGetProjectDeployTokenCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockDeployTokensServiceInterfaceGetProjectDeployTokenCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error)) *MockDeployTokensServiceInterfaceGetProjectDeployTokenCall { +func (c *MockDeployTokensServiceInterfaceGetProjectDeployTokenCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error)) *MockDeployTokensServiceInterfaceGetProjectDeployTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeployTokensServiceInterfaceGetProjectDeployTokenCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error)) *MockDeployTokensServiceInterfaceGetProjectDeployTokenCall { +func (c *MockDeployTokensServiceInterfaceGetProjectDeployTokenCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.DeployToken, *gitlab.Response, error)) *MockDeployTokensServiceInterfaceGetProjectDeployTokenCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/deployments_merge_requests_mock.go b/testing/deployments_merge_requests_mock.go index e787c1fd..247f44cf 100644 --- a/testing/deployments_merge_requests_mock.go +++ b/testing/deployments_merge_requests_mock.go @@ -41,7 +41,7 @@ func (m *MockDeploymentMergeRequestsServiceInterface) EXPECT() *MockDeploymentMe } // ListDeploymentMergeRequests mocks base method. -func (m *MockDeploymentMergeRequestsServiceInterface) ListDeploymentMergeRequests(pid any, deployment int, opts *gitlab.ListMergeRequestsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequest, *gitlab.Response, error) { +func (m *MockDeploymentMergeRequestsServiceInterface) ListDeploymentMergeRequests(pid any, deployment int64, opts *gitlab.ListMergeRequestsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployment, opts} for _, a := range options { @@ -74,13 +74,13 @@ func (c *MockDeploymentMergeRequestsServiceInterfaceListDeploymentMergeRequestsC } // Do rewrite *gomock.Call.Do -func (c *MockDeploymentMergeRequestsServiceInterfaceListDeploymentMergeRequestsCall) Do(f func(any, int, *gitlab.ListMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequest, *gitlab.Response, error)) *MockDeploymentMergeRequestsServiceInterfaceListDeploymentMergeRequestsCall { +func (c *MockDeploymentMergeRequestsServiceInterfaceListDeploymentMergeRequestsCall) Do(f func(any, int64, *gitlab.ListMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequest, *gitlab.Response, error)) *MockDeploymentMergeRequestsServiceInterfaceListDeploymentMergeRequestsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeploymentMergeRequestsServiceInterfaceListDeploymentMergeRequestsCall) DoAndReturn(f func(any, int, *gitlab.ListMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequest, *gitlab.Response, error)) *MockDeploymentMergeRequestsServiceInterfaceListDeploymentMergeRequestsCall { +func (c *MockDeploymentMergeRequestsServiceInterfaceListDeploymentMergeRequestsCall) DoAndReturn(f func(any, int64, *gitlab.ListMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequest, *gitlab.Response, error)) *MockDeploymentMergeRequestsServiceInterfaceListDeploymentMergeRequestsCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/deployments_mock.go b/testing/deployments_mock.go index 66ff2b7e..9b1e5d23 100644 --- a/testing/deployments_mock.go +++ b/testing/deployments_mock.go @@ -41,7 +41,7 @@ func (m *MockDeploymentsServiceInterface) EXPECT() *MockDeploymentsServiceInterf } // ApproveOrRejectProjectDeployment mocks base method. -func (m *MockDeploymentsServiceInterface) ApproveOrRejectProjectDeployment(pid any, deployment int, opt *gitlab.ApproveOrRejectProjectDeploymentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDeploymentsServiceInterface) ApproveOrRejectProjectDeployment(pid any, deployment int64, opt *gitlab.ApproveOrRejectProjectDeploymentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployment, opt} for _, a := range options { @@ -73,13 +73,13 @@ func (c *MockDeploymentsServiceInterfaceApproveOrRejectProjectDeploymentCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockDeploymentsServiceInterfaceApproveOrRejectProjectDeploymentCall) Do(f func(any, int, *gitlab.ApproveOrRejectProjectDeploymentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeploymentsServiceInterfaceApproveOrRejectProjectDeploymentCall { +func (c *MockDeploymentsServiceInterfaceApproveOrRejectProjectDeploymentCall) Do(f func(any, int64, *gitlab.ApproveOrRejectProjectDeploymentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeploymentsServiceInterfaceApproveOrRejectProjectDeploymentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeploymentsServiceInterfaceApproveOrRejectProjectDeploymentCall) DoAndReturn(f func(any, int, *gitlab.ApproveOrRejectProjectDeploymentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeploymentsServiceInterfaceApproveOrRejectProjectDeploymentCall { +func (c *MockDeploymentsServiceInterfaceApproveOrRejectProjectDeploymentCall) DoAndReturn(f func(any, int64, *gitlab.ApproveOrRejectProjectDeploymentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeploymentsServiceInterfaceApproveOrRejectProjectDeploymentCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -130,7 +130,7 @@ func (c *MockDeploymentsServiceInterfaceCreateProjectDeploymentCall) DoAndReturn } // DeleteProjectDeployment mocks base method. -func (m *MockDeploymentsServiceInterface) DeleteProjectDeployment(pid any, deployment int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDeploymentsServiceInterface) DeleteProjectDeployment(pid any, deployment int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployment} for _, a := range options { @@ -162,19 +162,19 @@ func (c *MockDeploymentsServiceInterfaceDeleteProjectDeploymentCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockDeploymentsServiceInterfaceDeleteProjectDeploymentCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeploymentsServiceInterfaceDeleteProjectDeploymentCall { +func (c *MockDeploymentsServiceInterfaceDeleteProjectDeploymentCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeploymentsServiceInterfaceDeleteProjectDeploymentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeploymentsServiceInterfaceDeleteProjectDeploymentCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeploymentsServiceInterfaceDeleteProjectDeploymentCall { +func (c *MockDeploymentsServiceInterfaceDeleteProjectDeploymentCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDeploymentsServiceInterfaceDeleteProjectDeploymentCall { c.Call = c.Call.DoAndReturn(f) return c } // GetProjectDeployment mocks base method. -func (m *MockDeploymentsServiceInterface) GetProjectDeployment(pid any, deployment int, options ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error) { +func (m *MockDeploymentsServiceInterface) GetProjectDeployment(pid any, deployment int64, options ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployment} for _, a := range options { @@ -207,13 +207,13 @@ func (c *MockDeploymentsServiceInterfaceGetProjectDeploymentCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockDeploymentsServiceInterfaceGetProjectDeploymentCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error)) *MockDeploymentsServiceInterfaceGetProjectDeploymentCall { +func (c *MockDeploymentsServiceInterfaceGetProjectDeploymentCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error)) *MockDeploymentsServiceInterfaceGetProjectDeploymentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeploymentsServiceInterfaceGetProjectDeploymentCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error)) *MockDeploymentsServiceInterfaceGetProjectDeploymentCall { +func (c *MockDeploymentsServiceInterfaceGetProjectDeploymentCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error)) *MockDeploymentsServiceInterfaceGetProjectDeploymentCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -264,7 +264,7 @@ func (c *MockDeploymentsServiceInterfaceListProjectDeploymentsCall) DoAndReturn( } // UpdateProjectDeployment mocks base method. -func (m *MockDeploymentsServiceInterface) UpdateProjectDeployment(pid any, deployment int, opt *gitlab.UpdateProjectDeploymentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error) { +func (m *MockDeploymentsServiceInterface) UpdateProjectDeployment(pid any, deployment int64, opt *gitlab.UpdateProjectDeploymentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, deployment, opt} for _, a := range options { @@ -297,13 +297,13 @@ func (c *MockDeploymentsServiceInterfaceUpdateProjectDeploymentCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockDeploymentsServiceInterfaceUpdateProjectDeploymentCall) Do(f func(any, int, *gitlab.UpdateProjectDeploymentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error)) *MockDeploymentsServiceInterfaceUpdateProjectDeploymentCall { +func (c *MockDeploymentsServiceInterfaceUpdateProjectDeploymentCall) Do(f func(any, int64, *gitlab.UpdateProjectDeploymentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error)) *MockDeploymentsServiceInterfaceUpdateProjectDeploymentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDeploymentsServiceInterfaceUpdateProjectDeploymentCall) DoAndReturn(f func(any, int, *gitlab.UpdateProjectDeploymentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error)) *MockDeploymentsServiceInterfaceUpdateProjectDeploymentCall { +func (c *MockDeploymentsServiceInterfaceUpdateProjectDeploymentCall) DoAndReturn(f func(any, int64, *gitlab.UpdateProjectDeploymentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Deployment, *gitlab.Response, error)) *MockDeploymentsServiceInterfaceUpdateProjectDeploymentCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/discussions_mock.go b/testing/discussions_mock.go index 58556e4f..a9d4d844 100644 --- a/testing/discussions_mock.go +++ b/testing/discussions_mock.go @@ -86,7 +86,7 @@ func (c *MockDiscussionsServiceInterfaceAddCommitDiscussionNoteCall) DoAndReturn } // AddEpicDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) AddEpicDiscussionNote(gid any, epic int, discussion string, opt *gitlab.AddEpicDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) AddEpicDiscussionNote(gid any, epic int64, discussion string, opt *gitlab.AddEpicDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, discussion, opt} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockDiscussionsServiceInterfaceAddEpicDiscussionNoteCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceAddEpicDiscussionNoteCall) Do(f func(any, int, string, *gitlab.AddEpicDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddEpicDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceAddEpicDiscussionNoteCall) Do(f func(any, int64, string, *gitlab.AddEpicDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddEpicDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceAddEpicDiscussionNoteCall) DoAndReturn(f func(any, int, string, *gitlab.AddEpicDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddEpicDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceAddEpicDiscussionNoteCall) DoAndReturn(f func(any, int64, string, *gitlab.AddEpicDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddEpicDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // AddIssueDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) AddIssueDiscussionNote(pid any, issue int, discussion string, opt *gitlab.AddIssueDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) AddIssueDiscussionNote(pid any, issue int64, discussion string, opt *gitlab.AddIssueDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, discussion, opt} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockDiscussionsServiceInterfaceAddIssueDiscussionNoteCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceAddIssueDiscussionNoteCall) Do(f func(any, int, string, *gitlab.AddIssueDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddIssueDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceAddIssueDiscussionNoteCall) Do(f func(any, int64, string, *gitlab.AddIssueDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddIssueDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceAddIssueDiscussionNoteCall) DoAndReturn(f func(any, int, string, *gitlab.AddIssueDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddIssueDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceAddIssueDiscussionNoteCall) DoAndReturn(f func(any, int64, string, *gitlab.AddIssueDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddIssueDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // AddMergeRequestDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) AddMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, opt *gitlab.AddMergeRequestDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) AddMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, opt *gitlab.AddMergeRequestDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, discussion, opt} for _, a := range options { @@ -209,19 +209,19 @@ func (c *MockDiscussionsServiceInterfaceAddMergeRequestDiscussionNoteCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceAddMergeRequestDiscussionNoteCall) Do(f func(any, int, string, *gitlab.AddMergeRequestDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddMergeRequestDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceAddMergeRequestDiscussionNoteCall) Do(f func(any, int64, string, *gitlab.AddMergeRequestDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddMergeRequestDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceAddMergeRequestDiscussionNoteCall) DoAndReturn(f func(any, int, string, *gitlab.AddMergeRequestDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddMergeRequestDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceAddMergeRequestDiscussionNoteCall) DoAndReturn(f func(any, int64, string, *gitlab.AddMergeRequestDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddMergeRequestDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // AddSnippetDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) AddSnippetDiscussionNote(pid any, snippet int, discussion string, opt *gitlab.AddSnippetDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) AddSnippetDiscussionNote(pid any, snippet int64, discussion string, opt *gitlab.AddSnippetDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, discussion, opt} for _, a := range options { @@ -254,13 +254,13 @@ func (c *MockDiscussionsServiceInterfaceAddSnippetDiscussionNoteCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceAddSnippetDiscussionNoteCall) Do(f func(any, int, string, *gitlab.AddSnippetDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddSnippetDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceAddSnippetDiscussionNoteCall) Do(f func(any, int64, string, *gitlab.AddSnippetDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddSnippetDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceAddSnippetDiscussionNoteCall) DoAndReturn(f func(any, int, string, *gitlab.AddSnippetDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddSnippetDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceAddSnippetDiscussionNoteCall) DoAndReturn(f func(any, int64, string, *gitlab.AddSnippetDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceAddSnippetDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -311,7 +311,7 @@ func (c *MockDiscussionsServiceInterfaceCreateCommitDiscussionCall) DoAndReturn( } // CreateEpicDiscussion mocks base method. -func (m *MockDiscussionsServiceInterface) CreateEpicDiscussion(gid any, epic int, opt *gitlab.CreateEpicDiscussionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) CreateEpicDiscussion(gid any, epic int64, opt *gitlab.CreateEpicDiscussionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, opt} for _, a := range options { @@ -344,19 +344,19 @@ func (c *MockDiscussionsServiceInterfaceCreateEpicDiscussionCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceCreateEpicDiscussionCall) Do(f func(any, int, *gitlab.CreateEpicDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateEpicDiscussionCall { +func (c *MockDiscussionsServiceInterfaceCreateEpicDiscussionCall) Do(f func(any, int64, *gitlab.CreateEpicDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateEpicDiscussionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceCreateEpicDiscussionCall) DoAndReturn(f func(any, int, *gitlab.CreateEpicDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateEpicDiscussionCall { +func (c *MockDiscussionsServiceInterfaceCreateEpicDiscussionCall) DoAndReturn(f func(any, int64, *gitlab.CreateEpicDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateEpicDiscussionCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateIssueDiscussion mocks base method. -func (m *MockDiscussionsServiceInterface) CreateIssueDiscussion(pid any, issue int, opt *gitlab.CreateIssueDiscussionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) CreateIssueDiscussion(pid any, issue int64, opt *gitlab.CreateIssueDiscussionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -389,19 +389,19 @@ func (c *MockDiscussionsServiceInterfaceCreateIssueDiscussionCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceCreateIssueDiscussionCall) Do(f func(any, int, *gitlab.CreateIssueDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateIssueDiscussionCall { +func (c *MockDiscussionsServiceInterfaceCreateIssueDiscussionCall) Do(f func(any, int64, *gitlab.CreateIssueDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateIssueDiscussionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceCreateIssueDiscussionCall) DoAndReturn(f func(any, int, *gitlab.CreateIssueDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateIssueDiscussionCall { +func (c *MockDiscussionsServiceInterfaceCreateIssueDiscussionCall) DoAndReturn(f func(any, int64, *gitlab.CreateIssueDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateIssueDiscussionCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateMergeRequestDiscussion mocks base method. -func (m *MockDiscussionsServiceInterface) CreateMergeRequestDiscussion(pid any, mergeRequest int, opt *gitlab.CreateMergeRequestDiscussionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) CreateMergeRequestDiscussion(pid any, mergeRequest int64, opt *gitlab.CreateMergeRequestDiscussionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -434,19 +434,19 @@ func (c *MockDiscussionsServiceInterfaceCreateMergeRequestDiscussionCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceCreateMergeRequestDiscussionCall) Do(f func(any, int, *gitlab.CreateMergeRequestDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateMergeRequestDiscussionCall { +func (c *MockDiscussionsServiceInterfaceCreateMergeRequestDiscussionCall) Do(f func(any, int64, *gitlab.CreateMergeRequestDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateMergeRequestDiscussionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceCreateMergeRequestDiscussionCall) DoAndReturn(f func(any, int, *gitlab.CreateMergeRequestDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateMergeRequestDiscussionCall { +func (c *MockDiscussionsServiceInterfaceCreateMergeRequestDiscussionCall) DoAndReturn(f func(any, int64, *gitlab.CreateMergeRequestDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateMergeRequestDiscussionCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateSnippetDiscussion mocks base method. -func (m *MockDiscussionsServiceInterface) CreateSnippetDiscussion(pid any, snippet int, opt *gitlab.CreateSnippetDiscussionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) CreateSnippetDiscussion(pid any, snippet int64, opt *gitlab.CreateSnippetDiscussionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, opt} for _, a := range options { @@ -479,19 +479,19 @@ func (c *MockDiscussionsServiceInterfaceCreateSnippetDiscussionCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceCreateSnippetDiscussionCall) Do(f func(any, int, *gitlab.CreateSnippetDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateSnippetDiscussionCall { +func (c *MockDiscussionsServiceInterfaceCreateSnippetDiscussionCall) Do(f func(any, int64, *gitlab.CreateSnippetDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateSnippetDiscussionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceCreateSnippetDiscussionCall) DoAndReturn(f func(any, int, *gitlab.CreateSnippetDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateSnippetDiscussionCall { +func (c *MockDiscussionsServiceInterfaceCreateSnippetDiscussionCall) DoAndReturn(f func(any, int64, *gitlab.CreateSnippetDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceCreateSnippetDiscussionCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteCommitDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) DeleteCommitDiscussionNote(pid any, commit, discussion string, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) DeleteCommitDiscussionNote(pid any, commit, discussion string, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, commit, discussion, note} for _, a := range options { @@ -523,19 +523,19 @@ func (c *MockDiscussionsServiceInterfaceDeleteCommitDiscussionNoteCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceDeleteCommitDiscussionNoteCall) Do(f func(any, string, string, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteCommitDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceDeleteCommitDiscussionNoteCall) Do(f func(any, string, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteCommitDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceDeleteCommitDiscussionNoteCall) DoAndReturn(f func(any, string, string, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteCommitDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceDeleteCommitDiscussionNoteCall) DoAndReturn(f func(any, string, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteCommitDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteEpicDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) DeleteEpicDiscussionNote(gid any, epic int, discussion string, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) DeleteEpicDiscussionNote(gid any, epic int64, discussion string, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, discussion, note} for _, a := range options { @@ -567,19 +567,19 @@ func (c *MockDiscussionsServiceInterfaceDeleteEpicDiscussionNoteCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceDeleteEpicDiscussionNoteCall) Do(f func(any, int, string, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteEpicDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceDeleteEpicDiscussionNoteCall) Do(f func(any, int64, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteEpicDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceDeleteEpicDiscussionNoteCall) DoAndReturn(f func(any, int, string, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteEpicDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceDeleteEpicDiscussionNoteCall) DoAndReturn(f func(any, int64, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteEpicDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteIssueDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) DeleteIssueDiscussionNote(pid any, issue int, discussion string, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) DeleteIssueDiscussionNote(pid any, issue int64, discussion string, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, discussion, note} for _, a := range options { @@ -611,19 +611,19 @@ func (c *MockDiscussionsServiceInterfaceDeleteIssueDiscussionNoteCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceDeleteIssueDiscussionNoteCall) Do(f func(any, int, string, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteIssueDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceDeleteIssueDiscussionNoteCall) Do(f func(any, int64, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteIssueDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceDeleteIssueDiscussionNoteCall) DoAndReturn(f func(any, int, string, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteIssueDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceDeleteIssueDiscussionNoteCall) DoAndReturn(f func(any, int64, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteIssueDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteMergeRequestDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) DeleteMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) DeleteMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, discussion, note} for _, a := range options { @@ -655,19 +655,19 @@ func (c *MockDiscussionsServiceInterfaceDeleteMergeRequestDiscussionNoteCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceDeleteMergeRequestDiscussionNoteCall) Do(f func(any, int, string, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteMergeRequestDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceDeleteMergeRequestDiscussionNoteCall) Do(f func(any, int64, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteMergeRequestDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceDeleteMergeRequestDiscussionNoteCall) DoAndReturn(f func(any, int, string, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteMergeRequestDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceDeleteMergeRequestDiscussionNoteCall) DoAndReturn(f func(any, int64, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteMergeRequestDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteSnippetDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) DeleteSnippetDiscussionNote(pid any, snippet int, discussion string, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) DeleteSnippetDiscussionNote(pid any, snippet int64, discussion string, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, discussion, note} for _, a := range options { @@ -699,13 +699,13 @@ func (c *MockDiscussionsServiceInterfaceDeleteSnippetDiscussionNoteCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceDeleteSnippetDiscussionNoteCall) Do(f func(any, int, string, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteSnippetDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceDeleteSnippetDiscussionNoteCall) Do(f func(any, int64, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteSnippetDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceDeleteSnippetDiscussionNoteCall) DoAndReturn(f func(any, int, string, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteSnippetDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceDeleteSnippetDiscussionNoteCall) DoAndReturn(f func(any, int64, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDiscussionsServiceInterfaceDeleteSnippetDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -756,7 +756,7 @@ func (c *MockDiscussionsServiceInterfaceGetCommitDiscussionCall) DoAndReturn(f f } // GetEpicDiscussion mocks base method. -func (m *MockDiscussionsServiceInterface) GetEpicDiscussion(gid any, epic int, discussion string, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) GetEpicDiscussion(gid any, epic int64, discussion string, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, discussion} for _, a := range options { @@ -789,19 +789,19 @@ func (c *MockDiscussionsServiceInterfaceGetEpicDiscussionCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceGetEpicDiscussionCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetEpicDiscussionCall { +func (c *MockDiscussionsServiceInterfaceGetEpicDiscussionCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetEpicDiscussionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceGetEpicDiscussionCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetEpicDiscussionCall { +func (c *MockDiscussionsServiceInterfaceGetEpicDiscussionCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetEpicDiscussionCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssueDiscussion mocks base method. -func (m *MockDiscussionsServiceInterface) GetIssueDiscussion(pid any, issue int, discussion string, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) GetIssueDiscussion(pid any, issue int64, discussion string, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, discussion} for _, a := range options { @@ -834,19 +834,19 @@ func (c *MockDiscussionsServiceInterfaceGetIssueDiscussionCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceGetIssueDiscussionCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetIssueDiscussionCall { +func (c *MockDiscussionsServiceInterfaceGetIssueDiscussionCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetIssueDiscussionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceGetIssueDiscussionCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetIssueDiscussionCall { +func (c *MockDiscussionsServiceInterfaceGetIssueDiscussionCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetIssueDiscussionCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestDiscussion mocks base method. -func (m *MockDiscussionsServiceInterface) GetMergeRequestDiscussion(pid any, mergeRequest int, discussion string, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) GetMergeRequestDiscussion(pid any, mergeRequest int64, discussion string, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, discussion} for _, a := range options { @@ -879,19 +879,19 @@ func (c *MockDiscussionsServiceInterfaceGetMergeRequestDiscussionCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceGetMergeRequestDiscussionCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetMergeRequestDiscussionCall { +func (c *MockDiscussionsServiceInterfaceGetMergeRequestDiscussionCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetMergeRequestDiscussionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceGetMergeRequestDiscussionCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetMergeRequestDiscussionCall { +func (c *MockDiscussionsServiceInterfaceGetMergeRequestDiscussionCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetMergeRequestDiscussionCall { c.Call = c.Call.DoAndReturn(f) return c } // GetSnippetDiscussion mocks base method. -func (m *MockDiscussionsServiceInterface) GetSnippetDiscussion(pid any, snippet int, discussion string, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) GetSnippetDiscussion(pid any, snippet int64, discussion string, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, discussion} for _, a := range options { @@ -924,13 +924,13 @@ func (c *MockDiscussionsServiceInterfaceGetSnippetDiscussionCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceGetSnippetDiscussionCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetSnippetDiscussionCall { +func (c *MockDiscussionsServiceInterfaceGetSnippetDiscussionCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetSnippetDiscussionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceGetSnippetDiscussionCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetSnippetDiscussionCall { +func (c *MockDiscussionsServiceInterfaceGetSnippetDiscussionCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceGetSnippetDiscussionCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -981,7 +981,7 @@ func (c *MockDiscussionsServiceInterfaceListCommitDiscussionsCall) DoAndReturn(f } // ListGroupEpicDiscussions mocks base method. -func (m *MockDiscussionsServiceInterface) ListGroupEpicDiscussions(gid any, epic int, opt *gitlab.ListGroupEpicDiscussionsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) ListGroupEpicDiscussions(gid any, epic int64, opt *gitlab.ListGroupEpicDiscussionsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, opt} for _, a := range options { @@ -1014,19 +1014,19 @@ func (c *MockDiscussionsServiceInterfaceListGroupEpicDiscussionsCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceListGroupEpicDiscussionsCall) Do(f func(any, int, *gitlab.ListGroupEpicDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListGroupEpicDiscussionsCall { +func (c *MockDiscussionsServiceInterfaceListGroupEpicDiscussionsCall) Do(f func(any, int64, *gitlab.ListGroupEpicDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListGroupEpicDiscussionsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceListGroupEpicDiscussionsCall) DoAndReturn(f func(any, int, *gitlab.ListGroupEpicDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListGroupEpicDiscussionsCall { +func (c *MockDiscussionsServiceInterfaceListGroupEpicDiscussionsCall) DoAndReturn(f func(any, int64, *gitlab.ListGroupEpicDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListGroupEpicDiscussionsCall { c.Call = c.Call.DoAndReturn(f) return c } // ListIssueDiscussions mocks base method. -func (m *MockDiscussionsServiceInterface) ListIssueDiscussions(pid any, issue int, opt *gitlab.ListIssueDiscussionsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) ListIssueDiscussions(pid any, issue int64, opt *gitlab.ListIssueDiscussionsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -1059,19 +1059,19 @@ func (c *MockDiscussionsServiceInterfaceListIssueDiscussionsCall) Return(arg0 [] } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceListIssueDiscussionsCall) Do(f func(any, int, *gitlab.ListIssueDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListIssueDiscussionsCall { +func (c *MockDiscussionsServiceInterfaceListIssueDiscussionsCall) Do(f func(any, int64, *gitlab.ListIssueDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListIssueDiscussionsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceListIssueDiscussionsCall) DoAndReturn(f func(any, int, *gitlab.ListIssueDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListIssueDiscussionsCall { +func (c *MockDiscussionsServiceInterfaceListIssueDiscussionsCall) DoAndReturn(f func(any, int64, *gitlab.ListIssueDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListIssueDiscussionsCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMergeRequestDiscussions mocks base method. -func (m *MockDiscussionsServiceInterface) ListMergeRequestDiscussions(pid any, mergeRequest int, opt *gitlab.ListMergeRequestDiscussionsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) ListMergeRequestDiscussions(pid any, mergeRequest int64, opt *gitlab.ListMergeRequestDiscussionsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -1104,19 +1104,19 @@ func (c *MockDiscussionsServiceInterfaceListMergeRequestDiscussionsCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceListMergeRequestDiscussionsCall) Do(f func(any, int, *gitlab.ListMergeRequestDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListMergeRequestDiscussionsCall { +func (c *MockDiscussionsServiceInterfaceListMergeRequestDiscussionsCall) Do(f func(any, int64, *gitlab.ListMergeRequestDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListMergeRequestDiscussionsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceListMergeRequestDiscussionsCall) DoAndReturn(f func(any, int, *gitlab.ListMergeRequestDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListMergeRequestDiscussionsCall { +func (c *MockDiscussionsServiceInterfaceListMergeRequestDiscussionsCall) DoAndReturn(f func(any, int64, *gitlab.ListMergeRequestDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListMergeRequestDiscussionsCall { c.Call = c.Call.DoAndReturn(f) return c } // ListSnippetDiscussions mocks base method. -func (m *MockDiscussionsServiceInterface) ListSnippetDiscussions(pid any, snippet int, opt *gitlab.ListSnippetDiscussionsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) ListSnippetDiscussions(pid any, snippet int64, opt *gitlab.ListSnippetDiscussionsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, opt} for _, a := range options { @@ -1149,19 +1149,19 @@ func (c *MockDiscussionsServiceInterfaceListSnippetDiscussionsCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceListSnippetDiscussionsCall) Do(f func(any, int, *gitlab.ListSnippetDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListSnippetDiscussionsCall { +func (c *MockDiscussionsServiceInterfaceListSnippetDiscussionsCall) Do(f func(any, int64, *gitlab.ListSnippetDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListSnippetDiscussionsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceListSnippetDiscussionsCall) DoAndReturn(f func(any, int, *gitlab.ListSnippetDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListSnippetDiscussionsCall { +func (c *MockDiscussionsServiceInterfaceListSnippetDiscussionsCall) DoAndReturn(f func(any, int64, *gitlab.ListSnippetDiscussionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceListSnippetDiscussionsCall { c.Call = c.Call.DoAndReturn(f) return c } // ResolveMergeRequestDiscussion mocks base method. -func (m *MockDiscussionsServiceInterface) ResolveMergeRequestDiscussion(pid any, mergeRequest int, discussion string, opt *gitlab.ResolveMergeRequestDiscussionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) ResolveMergeRequestDiscussion(pid any, mergeRequest int64, discussion string, opt *gitlab.ResolveMergeRequestDiscussionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, discussion, opt} for _, a := range options { @@ -1194,19 +1194,19 @@ func (c *MockDiscussionsServiceInterfaceResolveMergeRequestDiscussionCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceResolveMergeRequestDiscussionCall) Do(f func(any, int, string, *gitlab.ResolveMergeRequestDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceResolveMergeRequestDiscussionCall { +func (c *MockDiscussionsServiceInterfaceResolveMergeRequestDiscussionCall) Do(f func(any, int64, string, *gitlab.ResolveMergeRequestDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceResolveMergeRequestDiscussionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceResolveMergeRequestDiscussionCall) DoAndReturn(f func(any, int, string, *gitlab.ResolveMergeRequestDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceResolveMergeRequestDiscussionCall { +func (c *MockDiscussionsServiceInterfaceResolveMergeRequestDiscussionCall) DoAndReturn(f func(any, int64, string, *gitlab.ResolveMergeRequestDiscussionOptions, ...gitlab.RequestOptionFunc) (*gitlab.Discussion, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceResolveMergeRequestDiscussionCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateCommitDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) UpdateCommitDiscussionNote(pid any, commit, discussion string, note int, opt *gitlab.UpdateCommitDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) UpdateCommitDiscussionNote(pid any, commit, discussion string, note int64, opt *gitlab.UpdateCommitDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, commit, discussion, note, opt} for _, a := range options { @@ -1239,19 +1239,19 @@ func (c *MockDiscussionsServiceInterfaceUpdateCommitDiscussionNoteCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceUpdateCommitDiscussionNoteCall) Do(f func(any, string, string, int, *gitlab.UpdateCommitDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateCommitDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceUpdateCommitDiscussionNoteCall) Do(f func(any, string, string, int64, *gitlab.UpdateCommitDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateCommitDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceUpdateCommitDiscussionNoteCall) DoAndReturn(f func(any, string, string, int, *gitlab.UpdateCommitDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateCommitDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceUpdateCommitDiscussionNoteCall) DoAndReturn(f func(any, string, string, int64, *gitlab.UpdateCommitDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateCommitDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateEpicDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) UpdateEpicDiscussionNote(gid any, epic int, discussion string, note int, opt *gitlab.UpdateEpicDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) UpdateEpicDiscussionNote(gid any, epic int64, discussion string, note int64, opt *gitlab.UpdateEpicDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, discussion, note, opt} for _, a := range options { @@ -1284,19 +1284,19 @@ func (c *MockDiscussionsServiceInterfaceUpdateEpicDiscussionNoteCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceUpdateEpicDiscussionNoteCall) Do(f func(any, int, string, int, *gitlab.UpdateEpicDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateEpicDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceUpdateEpicDiscussionNoteCall) Do(f func(any, int64, string, int64, *gitlab.UpdateEpicDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateEpicDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceUpdateEpicDiscussionNoteCall) DoAndReturn(f func(any, int, string, int, *gitlab.UpdateEpicDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateEpicDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceUpdateEpicDiscussionNoteCall) DoAndReturn(f func(any, int64, string, int64, *gitlab.UpdateEpicDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateEpicDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateIssueDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) UpdateIssueDiscussionNote(pid any, issue int, discussion string, note int, opt *gitlab.UpdateIssueDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) UpdateIssueDiscussionNote(pid any, issue int64, discussion string, note int64, opt *gitlab.UpdateIssueDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, discussion, note, opt} for _, a := range options { @@ -1329,19 +1329,19 @@ func (c *MockDiscussionsServiceInterfaceUpdateIssueDiscussionNoteCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceUpdateIssueDiscussionNoteCall) Do(f func(any, int, string, int, *gitlab.UpdateIssueDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateIssueDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceUpdateIssueDiscussionNoteCall) Do(f func(any, int64, string, int64, *gitlab.UpdateIssueDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateIssueDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceUpdateIssueDiscussionNoteCall) DoAndReturn(f func(any, int, string, int, *gitlab.UpdateIssueDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateIssueDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceUpdateIssueDiscussionNoteCall) DoAndReturn(f func(any, int64, string, int64, *gitlab.UpdateIssueDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateIssueDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateMergeRequestDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) UpdateMergeRequestDiscussionNote(pid any, mergeRequest int, discussion string, note int, opt *gitlab.UpdateMergeRequestDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) UpdateMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, note int64, opt *gitlab.UpdateMergeRequestDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, discussion, note, opt} for _, a := range options { @@ -1374,19 +1374,19 @@ func (c *MockDiscussionsServiceInterfaceUpdateMergeRequestDiscussionNoteCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceUpdateMergeRequestDiscussionNoteCall) Do(f func(any, int, string, int, *gitlab.UpdateMergeRequestDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateMergeRequestDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceUpdateMergeRequestDiscussionNoteCall) Do(f func(any, int64, string, int64, *gitlab.UpdateMergeRequestDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateMergeRequestDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceUpdateMergeRequestDiscussionNoteCall) DoAndReturn(f func(any, int, string, int, *gitlab.UpdateMergeRequestDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateMergeRequestDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceUpdateMergeRequestDiscussionNoteCall) DoAndReturn(f func(any, int64, string, int64, *gitlab.UpdateMergeRequestDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateMergeRequestDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateSnippetDiscussionNote mocks base method. -func (m *MockDiscussionsServiceInterface) UpdateSnippetDiscussionNote(pid any, snippet int, discussion string, note int, opt *gitlab.UpdateSnippetDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockDiscussionsServiceInterface) UpdateSnippetDiscussionNote(pid any, snippet int64, discussion string, note int64, opt *gitlab.UpdateSnippetDiscussionNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, discussion, note, opt} for _, a := range options { @@ -1419,13 +1419,13 @@ func (c *MockDiscussionsServiceInterfaceUpdateSnippetDiscussionNoteCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockDiscussionsServiceInterfaceUpdateSnippetDiscussionNoteCall) Do(f func(any, int, string, int, *gitlab.UpdateSnippetDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateSnippetDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceUpdateSnippetDiscussionNoteCall) Do(f func(any, int64, string, int64, *gitlab.UpdateSnippetDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateSnippetDiscussionNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDiscussionsServiceInterfaceUpdateSnippetDiscussionNoteCall) DoAndReturn(f func(any, int, string, int, *gitlab.UpdateSnippetDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateSnippetDiscussionNoteCall { +func (c *MockDiscussionsServiceInterfaceUpdateSnippetDiscussionNoteCall) DoAndReturn(f func(any, int64, string, int64, *gitlab.UpdateSnippetDiscussionNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockDiscussionsServiceInterfaceUpdateSnippetDiscussionNoteCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/draft_notes_mock.go b/testing/draft_notes_mock.go index 9dcbc82d..876d311b 100644 --- a/testing/draft_notes_mock.go +++ b/testing/draft_notes_mock.go @@ -41,7 +41,7 @@ func (m *MockDraftNotesServiceInterface) EXPECT() *MockDraftNotesServiceInterfac } // CreateDraftNote mocks base method. -func (m *MockDraftNotesServiceInterface) CreateDraftNote(pid any, mergeRequest int, opt *gitlab.CreateDraftNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error) { +func (m *MockDraftNotesServiceInterface) CreateDraftNote(pid any, mergeRequest int64, opt *gitlab.CreateDraftNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockDraftNotesServiceInterfaceCreateDraftNoteCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockDraftNotesServiceInterfaceCreateDraftNoteCall) Do(f func(any, int, *gitlab.CreateDraftNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceCreateDraftNoteCall { +func (c *MockDraftNotesServiceInterfaceCreateDraftNoteCall) Do(f func(any, int64, *gitlab.CreateDraftNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceCreateDraftNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDraftNotesServiceInterfaceCreateDraftNoteCall) DoAndReturn(f func(any, int, *gitlab.CreateDraftNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceCreateDraftNoteCall { +func (c *MockDraftNotesServiceInterfaceCreateDraftNoteCall) DoAndReturn(f func(any, int64, *gitlab.CreateDraftNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceCreateDraftNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteDraftNote mocks base method. -func (m *MockDraftNotesServiceInterface) DeleteDraftNote(pid any, mergeRequest, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDraftNotesServiceInterface) DeleteDraftNote(pid any, mergeRequest, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, note} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockDraftNotesServiceInterfaceDeleteDraftNoteCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockDraftNotesServiceInterfaceDeleteDraftNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfaceDeleteDraftNoteCall { +func (c *MockDraftNotesServiceInterfaceDeleteDraftNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfaceDeleteDraftNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDraftNotesServiceInterfaceDeleteDraftNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfaceDeleteDraftNoteCall { +func (c *MockDraftNotesServiceInterfaceDeleteDraftNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfaceDeleteDraftNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // GetDraftNote mocks base method. -func (m *MockDraftNotesServiceInterface) GetDraftNote(pid any, mergeRequest, note int, options ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error) { +func (m *MockDraftNotesServiceInterface) GetDraftNote(pid any, mergeRequest, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, note} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockDraftNotesServiceInterfaceGetDraftNoteCall) Return(arg0 *gitlab.Dra } // Do rewrite *gomock.Call.Do -func (c *MockDraftNotesServiceInterfaceGetDraftNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceGetDraftNoteCall { +func (c *MockDraftNotesServiceInterfaceGetDraftNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceGetDraftNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDraftNotesServiceInterfaceGetDraftNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceGetDraftNoteCall { +func (c *MockDraftNotesServiceInterfaceGetDraftNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceGetDraftNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // ListDraftNotes mocks base method. -func (m *MockDraftNotesServiceInterface) ListDraftNotes(pid any, mergeRequest int, opt *gitlab.ListDraftNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.DraftNote, *gitlab.Response, error) { +func (m *MockDraftNotesServiceInterface) ListDraftNotes(pid any, mergeRequest int64, opt *gitlab.ListDraftNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.DraftNote, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockDraftNotesServiceInterfaceListDraftNotesCall) Return(arg0 []*gitlab } // Do rewrite *gomock.Call.Do -func (c *MockDraftNotesServiceInterfaceListDraftNotesCall) Do(f func(any, int, *gitlab.ListDraftNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceListDraftNotesCall { +func (c *MockDraftNotesServiceInterfaceListDraftNotesCall) Do(f func(any, int64, *gitlab.ListDraftNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceListDraftNotesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDraftNotesServiceInterfaceListDraftNotesCall) DoAndReturn(f func(any, int, *gitlab.ListDraftNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceListDraftNotesCall { +func (c *MockDraftNotesServiceInterfaceListDraftNotesCall) DoAndReturn(f func(any, int64, *gitlab.ListDraftNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceListDraftNotesCall { c.Call = c.Call.DoAndReturn(f) return c } // PublishAllDraftNotes mocks base method. -func (m *MockDraftNotesServiceInterface) PublishAllDraftNotes(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDraftNotesServiceInterface) PublishAllDraftNotes(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -252,19 +252,19 @@ func (c *MockDraftNotesServiceInterfacePublishAllDraftNotesCall) Return(arg0 *gi } // Do rewrite *gomock.Call.Do -func (c *MockDraftNotesServiceInterfacePublishAllDraftNotesCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfacePublishAllDraftNotesCall { +func (c *MockDraftNotesServiceInterfacePublishAllDraftNotesCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfacePublishAllDraftNotesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDraftNotesServiceInterfacePublishAllDraftNotesCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfacePublishAllDraftNotesCall { +func (c *MockDraftNotesServiceInterfacePublishAllDraftNotesCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfacePublishAllDraftNotesCall { c.Call = c.Call.DoAndReturn(f) return c } // PublishDraftNote mocks base method. -func (m *MockDraftNotesServiceInterface) PublishDraftNote(pid any, mergeRequest, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockDraftNotesServiceInterface) PublishDraftNote(pid any, mergeRequest, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, note} for _, a := range options { @@ -296,19 +296,19 @@ func (c *MockDraftNotesServiceInterfacePublishDraftNoteCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockDraftNotesServiceInterfacePublishDraftNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfacePublishDraftNoteCall { +func (c *MockDraftNotesServiceInterfacePublishDraftNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfacePublishDraftNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDraftNotesServiceInterfacePublishDraftNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfacePublishDraftNoteCall { +func (c *MockDraftNotesServiceInterfacePublishDraftNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockDraftNotesServiceInterfacePublishDraftNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateDraftNote mocks base method. -func (m *MockDraftNotesServiceInterface) UpdateDraftNote(pid any, mergeRequest, note int, opt *gitlab.UpdateDraftNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error) { +func (m *MockDraftNotesServiceInterface) UpdateDraftNote(pid any, mergeRequest, note int64, opt *gitlab.UpdateDraftNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, note, opt} for _, a := range options { @@ -341,13 +341,13 @@ func (c *MockDraftNotesServiceInterfaceUpdateDraftNoteCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockDraftNotesServiceInterfaceUpdateDraftNoteCall) Do(f func(any, int, int, *gitlab.UpdateDraftNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceUpdateDraftNoteCall { +func (c *MockDraftNotesServiceInterfaceUpdateDraftNoteCall) Do(f func(any, int64, int64, *gitlab.UpdateDraftNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceUpdateDraftNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockDraftNotesServiceInterfaceUpdateDraftNoteCall) DoAndReturn(f func(any, int, int, *gitlab.UpdateDraftNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceUpdateDraftNoteCall { +func (c *MockDraftNotesServiceInterfaceUpdateDraftNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.UpdateDraftNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.DraftNote, *gitlab.Response, error)) *MockDraftNotesServiceInterfaceUpdateDraftNoteCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/enterprise_users_mock.go b/testing/enterprise_users_mock.go index ee230d87..4684ab1f 100644 --- a/testing/enterprise_users_mock.go +++ b/testing/enterprise_users_mock.go @@ -41,7 +41,7 @@ func (m *MockEnterpriseUsersServiceInterface) EXPECT() *MockEnterpriseUsersServi } // Disable2FAForEnterpriseUser mocks base method. -func (m *MockEnterpriseUsersServiceInterface) Disable2FAForEnterpriseUser(gid any, uid int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockEnterpriseUsersServiceInterface) Disable2FAForEnterpriseUser(gid any, uid int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, uid} for _, a := range options { @@ -73,19 +73,19 @@ func (c *MockEnterpriseUsersServiceInterfaceDisable2FAForEnterpriseUserCall) Ret } // Do rewrite *gomock.Call.Do -func (c *MockEnterpriseUsersServiceInterfaceDisable2FAForEnterpriseUserCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceDisable2FAForEnterpriseUserCall { +func (c *MockEnterpriseUsersServiceInterfaceDisable2FAForEnterpriseUserCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceDisable2FAForEnterpriseUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEnterpriseUsersServiceInterfaceDisable2FAForEnterpriseUserCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceDisable2FAForEnterpriseUserCall { +func (c *MockEnterpriseUsersServiceInterfaceDisable2FAForEnterpriseUserCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceDisable2FAForEnterpriseUserCall { c.Call = c.Call.DoAndReturn(f) return c } // GetEnterpriseUser mocks base method. -func (m *MockEnterpriseUsersServiceInterface) GetEnterpriseUser(gid any, uid int, options ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error) { +func (m *MockEnterpriseUsersServiceInterface) GetEnterpriseUser(gid any, uid int64, options ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, uid} for _, a := range options { @@ -118,13 +118,13 @@ func (c *MockEnterpriseUsersServiceInterfaceGetEnterpriseUserCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockEnterpriseUsersServiceInterfaceGetEnterpriseUserCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceGetEnterpriseUserCall { +func (c *MockEnterpriseUsersServiceInterfaceGetEnterpriseUserCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceGetEnterpriseUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEnterpriseUsersServiceInterfaceGetEnterpriseUserCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceGetEnterpriseUserCall { +func (c *MockEnterpriseUsersServiceInterfaceGetEnterpriseUserCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceGetEnterpriseUserCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/environments_mock.go b/testing/environments_mock.go index bf33a318..8cf4b33f 100644 --- a/testing/environments_mock.go +++ b/testing/environments_mock.go @@ -86,7 +86,7 @@ func (c *MockEnvironmentsServiceInterfaceCreateEnvironmentCall) DoAndReturn(f fu } // DeleteEnvironment mocks base method. -func (m *MockEnvironmentsServiceInterface) DeleteEnvironment(pid any, environment int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockEnvironmentsServiceInterface) DeleteEnvironment(pid any, environment int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, environment} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockEnvironmentsServiceInterfaceDeleteEnvironmentCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockEnvironmentsServiceInterfaceDeleteEnvironmentCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnvironmentsServiceInterfaceDeleteEnvironmentCall { +func (c *MockEnvironmentsServiceInterfaceDeleteEnvironmentCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnvironmentsServiceInterfaceDeleteEnvironmentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEnvironmentsServiceInterfaceDeleteEnvironmentCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnvironmentsServiceInterfaceDeleteEnvironmentCall { +func (c *MockEnvironmentsServiceInterfaceDeleteEnvironmentCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnvironmentsServiceInterfaceDeleteEnvironmentCall { c.Call = c.Call.DoAndReturn(f) return c } // EditEnvironment mocks base method. -func (m *MockEnvironmentsServiceInterface) EditEnvironment(pid any, environment int, opt *gitlab.EditEnvironmentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error) { +func (m *MockEnvironmentsServiceInterface) EditEnvironment(pid any, environment int64, opt *gitlab.EditEnvironmentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, environment, opt} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockEnvironmentsServiceInterfaceEditEnvironmentCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockEnvironmentsServiceInterfaceEditEnvironmentCall) Do(f func(any, int, *gitlab.EditEnvironmentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceEditEnvironmentCall { +func (c *MockEnvironmentsServiceInterfaceEditEnvironmentCall) Do(f func(any, int64, *gitlab.EditEnvironmentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceEditEnvironmentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEnvironmentsServiceInterfaceEditEnvironmentCall) DoAndReturn(f func(any, int, *gitlab.EditEnvironmentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceEditEnvironmentCall { +func (c *MockEnvironmentsServiceInterfaceEditEnvironmentCall) DoAndReturn(f func(any, int64, *gitlab.EditEnvironmentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceEditEnvironmentCall { c.Call = c.Call.DoAndReturn(f) return c } // GetEnvironment mocks base method. -func (m *MockEnvironmentsServiceInterface) GetEnvironment(pid any, environment int, options ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error) { +func (m *MockEnvironmentsServiceInterface) GetEnvironment(pid any, environment int64, options ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, environment} for _, a := range options { @@ -208,13 +208,13 @@ func (c *MockEnvironmentsServiceInterfaceGetEnvironmentCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockEnvironmentsServiceInterfaceGetEnvironmentCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceGetEnvironmentCall { +func (c *MockEnvironmentsServiceInterfaceGetEnvironmentCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceGetEnvironmentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEnvironmentsServiceInterfaceGetEnvironmentCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceGetEnvironmentCall { +func (c *MockEnvironmentsServiceInterfaceGetEnvironmentCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceGetEnvironmentCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -265,7 +265,7 @@ func (c *MockEnvironmentsServiceInterfaceListEnvironmentsCall) DoAndReturn(f fun } // StopEnvironment mocks base method. -func (m *MockEnvironmentsServiceInterface) StopEnvironment(pid any, environmentID int, opt *gitlab.StopEnvironmentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error) { +func (m *MockEnvironmentsServiceInterface) StopEnvironment(pid any, environmentID int64, opt *gitlab.StopEnvironmentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, environmentID, opt} for _, a := range options { @@ -298,13 +298,13 @@ func (c *MockEnvironmentsServiceInterfaceStopEnvironmentCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockEnvironmentsServiceInterfaceStopEnvironmentCall) Do(f func(any, int, *gitlab.StopEnvironmentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceStopEnvironmentCall { +func (c *MockEnvironmentsServiceInterfaceStopEnvironmentCall) Do(f func(any, int64, *gitlab.StopEnvironmentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceStopEnvironmentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEnvironmentsServiceInterfaceStopEnvironmentCall) DoAndReturn(f func(any, int, *gitlab.StopEnvironmentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceStopEnvironmentCall { +func (c *MockEnvironmentsServiceInterfaceStopEnvironmentCall) DoAndReturn(f func(any, int64, *gitlab.StopEnvironmentOptions, ...gitlab.RequestOptionFunc) (*gitlab.Environment, *gitlab.Response, error)) *MockEnvironmentsServiceInterfaceStopEnvironmentCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/epic_issues_mock.go b/testing/epic_issues_mock.go index 8e9ff291..8edc1697 100644 --- a/testing/epic_issues_mock.go +++ b/testing/epic_issues_mock.go @@ -41,7 +41,7 @@ func (m *MockEpicIssuesServiceInterface) EXPECT() *MockEpicIssuesServiceInterfac } // AssignEpicIssue mocks base method. -func (m *MockEpicIssuesServiceInterface) AssignEpicIssue(gid any, epic, issue int, options ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error) { +func (m *MockEpicIssuesServiceInterface) AssignEpicIssue(gid any, epic, issue int64, options ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, issue} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockEpicIssuesServiceInterfaceAssignEpicIssueCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockEpicIssuesServiceInterfaceAssignEpicIssueCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceAssignEpicIssueCall { +func (c *MockEpicIssuesServiceInterfaceAssignEpicIssueCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceAssignEpicIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEpicIssuesServiceInterfaceAssignEpicIssueCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceAssignEpicIssueCall { +func (c *MockEpicIssuesServiceInterfaceAssignEpicIssueCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceAssignEpicIssueCall { c.Call = c.Call.DoAndReturn(f) return c } // ListEpicIssues mocks base method. -func (m *MockEpicIssuesServiceInterface) ListEpicIssues(gid any, epic int, opt *gitlab.ListOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { +func (m *MockEpicIssuesServiceInterface) ListEpicIssues(gid any, epic int64, opt *gitlab.ListOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, opt} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockEpicIssuesServiceInterfaceListEpicIssuesCall) Return(arg0 []*gitlab } // Do rewrite *gomock.Call.Do -func (c *MockEpicIssuesServiceInterfaceListEpicIssuesCall) Do(f func(any, int, *gitlab.ListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceListEpicIssuesCall { +func (c *MockEpicIssuesServiceInterfaceListEpicIssuesCall) Do(f func(any, int64, *gitlab.ListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceListEpicIssuesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEpicIssuesServiceInterfaceListEpicIssuesCall) DoAndReturn(f func(any, int, *gitlab.ListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceListEpicIssuesCall { +func (c *MockEpicIssuesServiceInterfaceListEpicIssuesCall) DoAndReturn(f func(any, int64, *gitlab.ListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceListEpicIssuesCall { c.Call = c.Call.DoAndReturn(f) return c } // RemoveEpicIssue mocks base method. -func (m *MockEpicIssuesServiceInterface) RemoveEpicIssue(gid any, epic, epicIssue int, options ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error) { +func (m *MockEpicIssuesServiceInterface) RemoveEpicIssue(gid any, epic, epicIssue int64, options ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, epicIssue} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockEpicIssuesServiceInterfaceRemoveEpicIssueCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockEpicIssuesServiceInterfaceRemoveEpicIssueCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceRemoveEpicIssueCall { +func (c *MockEpicIssuesServiceInterfaceRemoveEpicIssueCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceRemoveEpicIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEpicIssuesServiceInterfaceRemoveEpicIssueCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceRemoveEpicIssueCall { +func (c *MockEpicIssuesServiceInterfaceRemoveEpicIssueCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.EpicIssueAssignment, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceRemoveEpicIssueCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateEpicIssueAssignment mocks base method. -func (m *MockEpicIssuesServiceInterface) UpdateEpicIssueAssignment(gid any, epic, epicIssue int, opt *gitlab.UpdateEpicIssueAssignmentOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { +func (m *MockEpicIssuesServiceInterface) UpdateEpicIssueAssignment(gid any, epic, epicIssue int64, opt *gitlab.UpdateEpicIssueAssignmentOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, epicIssue, opt} for _, a := range options { @@ -209,13 +209,13 @@ func (c *MockEpicIssuesServiceInterfaceUpdateEpicIssueAssignmentCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockEpicIssuesServiceInterfaceUpdateEpicIssueAssignmentCall) Do(f func(any, int, int, *gitlab.UpdateEpicIssueAssignmentOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceUpdateEpicIssueAssignmentCall { +func (c *MockEpicIssuesServiceInterfaceUpdateEpicIssueAssignmentCall) Do(f func(any, int64, int64, *gitlab.UpdateEpicIssueAssignmentOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceUpdateEpicIssueAssignmentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEpicIssuesServiceInterfaceUpdateEpicIssueAssignmentCall) DoAndReturn(f func(any, int, int, *gitlab.UpdateEpicIssueAssignmentOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceUpdateEpicIssueAssignmentCall { +func (c *MockEpicIssuesServiceInterfaceUpdateEpicIssueAssignmentCall) DoAndReturn(f func(any, int64, int64, *gitlab.UpdateEpicIssueAssignmentOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockEpicIssuesServiceInterfaceUpdateEpicIssueAssignmentCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/epics_mock.go b/testing/epics_mock.go index a20511dc..1e4eeda9 100644 --- a/testing/epics_mock.go +++ b/testing/epics_mock.go @@ -86,7 +86,7 @@ func (c *MockEpicsServiceInterfaceCreateEpicCall) DoAndReturn(f func(any, *gitla } // DeleteEpic mocks base method. -func (m *MockEpicsServiceInterface) DeleteEpic(gid any, epic int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockEpicsServiceInterface) DeleteEpic(gid any, epic int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockEpicsServiceInterfaceDeleteEpicCall) Return(arg0 *gitlab.Response, } // Do rewrite *gomock.Call.Do -func (c *MockEpicsServiceInterfaceDeleteEpicCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEpicsServiceInterfaceDeleteEpicCall { +func (c *MockEpicsServiceInterfaceDeleteEpicCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEpicsServiceInterfaceDeleteEpicCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEpicsServiceInterfaceDeleteEpicCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEpicsServiceInterfaceDeleteEpicCall { +func (c *MockEpicsServiceInterfaceDeleteEpicCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEpicsServiceInterfaceDeleteEpicCall { c.Call = c.Call.DoAndReturn(f) return c } // GetEpic mocks base method. -func (m *MockEpicsServiceInterface) GetEpic(gid any, epic int, options ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error) { +func (m *MockEpicsServiceInterface) GetEpic(gid any, epic int64, options ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockEpicsServiceInterfaceGetEpicCall) Return(arg0 *gitlab.Epic, arg1 *g } // Do rewrite *gomock.Call.Do -func (c *MockEpicsServiceInterfaceGetEpicCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceGetEpicCall { +func (c *MockEpicsServiceInterfaceGetEpicCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceGetEpicCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEpicsServiceInterfaceGetEpicCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceGetEpicCall { +func (c *MockEpicsServiceInterfaceGetEpicCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceGetEpicCall { c.Call = c.Call.DoAndReturn(f) return c } // GetEpicLinks mocks base method. -func (m *MockEpicsServiceInterface) GetEpicLinks(gid any, epic int, options ...gitlab.RequestOptionFunc) ([]*gitlab.Epic, *gitlab.Response, error) { +func (m *MockEpicsServiceInterface) GetEpicLinks(gid any, epic int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.Epic, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic} for _, a := range options { @@ -208,13 +208,13 @@ func (c *MockEpicsServiceInterfaceGetEpicLinksCall) Return(arg0 []*gitlab.Epic, } // Do rewrite *gomock.Call.Do -func (c *MockEpicsServiceInterfaceGetEpicLinksCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceGetEpicLinksCall { +func (c *MockEpicsServiceInterfaceGetEpicLinksCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceGetEpicLinksCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEpicsServiceInterfaceGetEpicLinksCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceGetEpicLinksCall { +func (c *MockEpicsServiceInterfaceGetEpicLinksCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceGetEpicLinksCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -265,7 +265,7 @@ func (c *MockEpicsServiceInterfaceListGroupEpicsCall) DoAndReturn(f func(any, *g } // UpdateEpic mocks base method. -func (m *MockEpicsServiceInterface) UpdateEpic(gid any, epic int, opt *gitlab.UpdateEpicOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error) { +func (m *MockEpicsServiceInterface) UpdateEpic(gid any, epic int64, opt *gitlab.UpdateEpicOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, opt} for _, a := range options { @@ -298,13 +298,13 @@ func (c *MockEpicsServiceInterfaceUpdateEpicCall) Return(arg0 *gitlab.Epic, arg1 } // Do rewrite *gomock.Call.Do -func (c *MockEpicsServiceInterfaceUpdateEpicCall) Do(f func(any, int, *gitlab.UpdateEpicOptions, ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceUpdateEpicCall { +func (c *MockEpicsServiceInterfaceUpdateEpicCall) Do(f func(any, int64, *gitlab.UpdateEpicOptions, ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceUpdateEpicCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEpicsServiceInterfaceUpdateEpicCall) DoAndReturn(f func(any, int, *gitlab.UpdateEpicOptions, ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceUpdateEpicCall { +func (c *MockEpicsServiceInterfaceUpdateEpicCall) DoAndReturn(f func(any, int64, *gitlab.UpdateEpicOptions, ...gitlab.RequestOptionFunc) (*gitlab.Epic, *gitlab.Response, error)) *MockEpicsServiceInterfaceUpdateEpicCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/error_tracking_mock.go b/testing/error_tracking_mock.go index 6da1e63d..c33254a0 100644 --- a/testing/error_tracking_mock.go +++ b/testing/error_tracking_mock.go @@ -86,7 +86,7 @@ func (c *MockErrorTrackingServiceInterfaceCreateClientKeyCall) DoAndReturn(f fun } // DeleteClientKey mocks base method. -func (m *MockErrorTrackingServiceInterface) DeleteClientKey(pid any, keyID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockErrorTrackingServiceInterface) DeleteClientKey(pid any, keyID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, keyID} for _, a := range options { @@ -118,13 +118,13 @@ func (c *MockErrorTrackingServiceInterfaceDeleteClientKeyCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockErrorTrackingServiceInterfaceDeleteClientKeyCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockErrorTrackingServiceInterfaceDeleteClientKeyCall { +func (c *MockErrorTrackingServiceInterfaceDeleteClientKeyCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockErrorTrackingServiceInterfaceDeleteClientKeyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockErrorTrackingServiceInterfaceDeleteClientKeyCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockErrorTrackingServiceInterfaceDeleteClientKeyCall { +func (c *MockErrorTrackingServiceInterfaceDeleteClientKeyCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockErrorTrackingServiceInterfaceDeleteClientKeyCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/external_status_checks_mock.go b/testing/external_status_checks_mock.go index a0b1dbe9..61c87aa8 100644 --- a/testing/external_status_checks_mock.go +++ b/testing/external_status_checks_mock.go @@ -130,7 +130,7 @@ func (c *MockExternalStatusChecksServiceInterfaceCreateProjectExternalStatusChec } // DeleteExternalStatusCheck mocks base method. -func (m *MockExternalStatusChecksServiceInterface) DeleteExternalStatusCheck(pid any, check int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockExternalStatusChecksServiceInterface) DeleteExternalStatusCheck(pid any, check int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, check} for _, a := range options { @@ -162,19 +162,19 @@ func (c *MockExternalStatusChecksServiceInterfaceDeleteExternalStatusCheckCall) } // Do rewrite *gomock.Call.Do -func (c *MockExternalStatusChecksServiceInterfaceDeleteExternalStatusCheckCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceDeleteExternalStatusCheckCall { +func (c *MockExternalStatusChecksServiceInterfaceDeleteExternalStatusCheckCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceDeleteExternalStatusCheckCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockExternalStatusChecksServiceInterfaceDeleteExternalStatusCheckCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceDeleteExternalStatusCheckCall { +func (c *MockExternalStatusChecksServiceInterfaceDeleteExternalStatusCheckCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceDeleteExternalStatusCheckCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteProjectExternalStatusCheck mocks base method. -func (m *MockExternalStatusChecksServiceInterface) DeleteProjectExternalStatusCheck(pid any, check int, opt *gitlab.DeleteProjectExternalStatusCheckOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockExternalStatusChecksServiceInterface) DeleteProjectExternalStatusCheck(pid any, check int64, opt *gitlab.DeleteProjectExternalStatusCheckOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, check, opt} for _, a := range options { @@ -206,19 +206,19 @@ func (c *MockExternalStatusChecksServiceInterfaceDeleteProjectExternalStatusChec } // Do rewrite *gomock.Call.Do -func (c *MockExternalStatusChecksServiceInterfaceDeleteProjectExternalStatusCheckCall) Do(f func(any, int, *gitlab.DeleteProjectExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceDeleteProjectExternalStatusCheckCall { +func (c *MockExternalStatusChecksServiceInterfaceDeleteProjectExternalStatusCheckCall) Do(f func(any, int64, *gitlab.DeleteProjectExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceDeleteProjectExternalStatusCheckCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockExternalStatusChecksServiceInterfaceDeleteProjectExternalStatusCheckCall) DoAndReturn(f func(any, int, *gitlab.DeleteProjectExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceDeleteProjectExternalStatusCheckCall { +func (c *MockExternalStatusChecksServiceInterfaceDeleteProjectExternalStatusCheckCall) DoAndReturn(f func(any, int64, *gitlab.DeleteProjectExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceDeleteProjectExternalStatusCheckCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMergeStatusChecks mocks base method. -func (m *MockExternalStatusChecksServiceInterface) ListMergeStatusChecks(pid any, mr int, opt *gitlab.ListOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error) { +func (m *MockExternalStatusChecksServiceInterface) ListMergeStatusChecks(pid any, mr int64, opt *gitlab.ListOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mr, opt} for _, a := range options { @@ -251,13 +251,13 @@ func (c *MockExternalStatusChecksServiceInterfaceListMergeStatusChecksCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockExternalStatusChecksServiceInterfaceListMergeStatusChecksCall) Do(f func(any, int, *gitlab.ListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceListMergeStatusChecksCall { +func (c *MockExternalStatusChecksServiceInterfaceListMergeStatusChecksCall) Do(f func(any, int64, *gitlab.ListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceListMergeStatusChecksCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockExternalStatusChecksServiceInterfaceListMergeStatusChecksCall) DoAndReturn(f func(any, int, *gitlab.ListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceListMergeStatusChecksCall { +func (c *MockExternalStatusChecksServiceInterfaceListMergeStatusChecksCall) DoAndReturn(f func(any, int64, *gitlab.ListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceListMergeStatusChecksCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -308,7 +308,7 @@ func (c *MockExternalStatusChecksServiceInterfaceListProjectExternalStatusChecks } // ListProjectMergeRequestExternalStatusChecks mocks base method. -func (m *MockExternalStatusChecksServiceInterface) ListProjectMergeRequestExternalStatusChecks(pid any, mr int, opt *gitlab.ListProjectMergeRequestExternalStatusChecksOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error) { +func (m *MockExternalStatusChecksServiceInterface) ListProjectMergeRequestExternalStatusChecks(pid any, mr int64, opt *gitlab.ListProjectMergeRequestExternalStatusChecksOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mr, opt} for _, a := range options { @@ -341,13 +341,13 @@ func (c *MockExternalStatusChecksServiceInterfaceListProjectMergeRequestExternal } // Do rewrite *gomock.Call.Do -func (c *MockExternalStatusChecksServiceInterfaceListProjectMergeRequestExternalStatusChecksCall) Do(f func(any, int, *gitlab.ListProjectMergeRequestExternalStatusChecksOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceListProjectMergeRequestExternalStatusChecksCall { +func (c *MockExternalStatusChecksServiceInterfaceListProjectMergeRequestExternalStatusChecksCall) Do(f func(any, int64, *gitlab.ListProjectMergeRequestExternalStatusChecksOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceListProjectMergeRequestExternalStatusChecksCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockExternalStatusChecksServiceInterfaceListProjectMergeRequestExternalStatusChecksCall) DoAndReturn(f func(any, int, *gitlab.ListProjectMergeRequestExternalStatusChecksOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceListProjectMergeRequestExternalStatusChecksCall { +func (c *MockExternalStatusChecksServiceInterfaceListProjectMergeRequestExternalStatusChecksCall) DoAndReturn(f func(any, int64, *gitlab.ListProjectMergeRequestExternalStatusChecksOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceListProjectMergeRequestExternalStatusChecksCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -398,7 +398,7 @@ func (c *MockExternalStatusChecksServiceInterfaceListProjectStatusChecksCall) Do } // RetryFailedExternalStatusCheckForProjectMergeRequest mocks base method. -func (m *MockExternalStatusChecksServiceInterface) RetryFailedExternalStatusCheckForProjectMergeRequest(pid any, mergeRequest, externalStatusCheck int, opt *gitlab.RetryFailedExternalStatusCheckForProjectMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockExternalStatusChecksServiceInterface) RetryFailedExternalStatusCheckForProjectMergeRequest(pid any, mergeRequest, externalStatusCheck int64, opt *gitlab.RetryFailedExternalStatusCheckForProjectMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, externalStatusCheck, opt} for _, a := range options { @@ -430,19 +430,19 @@ func (c *MockExternalStatusChecksServiceInterfaceRetryFailedExternalStatusCheckF } // Do rewrite *gomock.Call.Do -func (c *MockExternalStatusChecksServiceInterfaceRetryFailedExternalStatusCheckForProjectMergeRequestCall) Do(f func(any, int, int, *gitlab.RetryFailedExternalStatusCheckForProjectMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceRetryFailedExternalStatusCheckForProjectMergeRequestCall { +func (c *MockExternalStatusChecksServiceInterfaceRetryFailedExternalStatusCheckForProjectMergeRequestCall) Do(f func(any, int64, int64, *gitlab.RetryFailedExternalStatusCheckForProjectMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceRetryFailedExternalStatusCheckForProjectMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockExternalStatusChecksServiceInterfaceRetryFailedExternalStatusCheckForProjectMergeRequestCall) DoAndReturn(f func(any, int, int, *gitlab.RetryFailedExternalStatusCheckForProjectMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceRetryFailedExternalStatusCheckForProjectMergeRequestCall { +func (c *MockExternalStatusChecksServiceInterfaceRetryFailedExternalStatusCheckForProjectMergeRequestCall) DoAndReturn(f func(any, int64, int64, *gitlab.RetryFailedExternalStatusCheckForProjectMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceRetryFailedExternalStatusCheckForProjectMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // RetryFailedStatusCheckForAMergeRequest mocks base method. -func (m *MockExternalStatusChecksServiceInterface) RetryFailedStatusCheckForAMergeRequest(pid any, mergeRequest, externalStatusCheck int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockExternalStatusChecksServiceInterface) RetryFailedStatusCheckForAMergeRequest(pid any, mergeRequest, externalStatusCheck int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, externalStatusCheck} for _, a := range options { @@ -474,19 +474,19 @@ func (c *MockExternalStatusChecksServiceInterfaceRetryFailedStatusCheckForAMerge } // Do rewrite *gomock.Call.Do -func (c *MockExternalStatusChecksServiceInterfaceRetryFailedStatusCheckForAMergeRequestCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceRetryFailedStatusCheckForAMergeRequestCall { +func (c *MockExternalStatusChecksServiceInterfaceRetryFailedStatusCheckForAMergeRequestCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceRetryFailedStatusCheckForAMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockExternalStatusChecksServiceInterfaceRetryFailedStatusCheckForAMergeRequestCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceRetryFailedStatusCheckForAMergeRequestCall { +func (c *MockExternalStatusChecksServiceInterfaceRetryFailedStatusCheckForAMergeRequestCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceRetryFailedStatusCheckForAMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // SetExternalStatusCheckStatus mocks base method. -func (m *MockExternalStatusChecksServiceInterface) SetExternalStatusCheckStatus(pid any, mergeRequest int, opt *gitlab.SetExternalStatusCheckStatusOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockExternalStatusChecksServiceInterface) SetExternalStatusCheckStatus(pid any, mergeRequest int64, opt *gitlab.SetExternalStatusCheckStatusOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -518,19 +518,19 @@ func (c *MockExternalStatusChecksServiceInterfaceSetExternalStatusCheckStatusCal } // Do rewrite *gomock.Call.Do -func (c *MockExternalStatusChecksServiceInterfaceSetExternalStatusCheckStatusCall) Do(f func(any, int, *gitlab.SetExternalStatusCheckStatusOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceSetExternalStatusCheckStatusCall { +func (c *MockExternalStatusChecksServiceInterfaceSetExternalStatusCheckStatusCall) Do(f func(any, int64, *gitlab.SetExternalStatusCheckStatusOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceSetExternalStatusCheckStatusCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockExternalStatusChecksServiceInterfaceSetExternalStatusCheckStatusCall) DoAndReturn(f func(any, int, *gitlab.SetExternalStatusCheckStatusOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceSetExternalStatusCheckStatusCall { +func (c *MockExternalStatusChecksServiceInterfaceSetExternalStatusCheckStatusCall) DoAndReturn(f func(any, int64, *gitlab.SetExternalStatusCheckStatusOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceSetExternalStatusCheckStatusCall { c.Call = c.Call.DoAndReturn(f) return c } // SetProjectMergeRequestExternalStatusCheckStatus mocks base method. -func (m *MockExternalStatusChecksServiceInterface) SetProjectMergeRequestExternalStatusCheckStatus(pid any, mergeRequest int, opt *gitlab.SetProjectMergeRequestExternalStatusCheckStatusOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockExternalStatusChecksServiceInterface) SetProjectMergeRequestExternalStatusCheckStatus(pid any, mergeRequest int64, opt *gitlab.SetProjectMergeRequestExternalStatusCheckStatusOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -562,19 +562,19 @@ func (c *MockExternalStatusChecksServiceInterfaceSetProjectMergeRequestExternalS } // Do rewrite *gomock.Call.Do -func (c *MockExternalStatusChecksServiceInterfaceSetProjectMergeRequestExternalStatusCheckStatusCall) Do(f func(any, int, *gitlab.SetProjectMergeRequestExternalStatusCheckStatusOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceSetProjectMergeRequestExternalStatusCheckStatusCall { +func (c *MockExternalStatusChecksServiceInterfaceSetProjectMergeRequestExternalStatusCheckStatusCall) Do(f func(any, int64, *gitlab.SetProjectMergeRequestExternalStatusCheckStatusOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceSetProjectMergeRequestExternalStatusCheckStatusCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockExternalStatusChecksServiceInterfaceSetProjectMergeRequestExternalStatusCheckStatusCall) DoAndReturn(f func(any, int, *gitlab.SetProjectMergeRequestExternalStatusCheckStatusOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceSetProjectMergeRequestExternalStatusCheckStatusCall { +func (c *MockExternalStatusChecksServiceInterfaceSetProjectMergeRequestExternalStatusCheckStatusCall) DoAndReturn(f func(any, int64, *gitlab.SetProjectMergeRequestExternalStatusCheckStatusOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceSetProjectMergeRequestExternalStatusCheckStatusCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateExternalStatusCheck mocks base method. -func (m *MockExternalStatusChecksServiceInterface) UpdateExternalStatusCheck(pid any, check int, opt *gitlab.UpdateExternalStatusCheckOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockExternalStatusChecksServiceInterface) UpdateExternalStatusCheck(pid any, check int64, opt *gitlab.UpdateExternalStatusCheckOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, check, opt} for _, a := range options { @@ -606,19 +606,19 @@ func (c *MockExternalStatusChecksServiceInterfaceUpdateExternalStatusCheckCall) } // Do rewrite *gomock.Call.Do -func (c *MockExternalStatusChecksServiceInterfaceUpdateExternalStatusCheckCall) Do(f func(any, int, *gitlab.UpdateExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceUpdateExternalStatusCheckCall { +func (c *MockExternalStatusChecksServiceInterfaceUpdateExternalStatusCheckCall) Do(f func(any, int64, *gitlab.UpdateExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceUpdateExternalStatusCheckCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockExternalStatusChecksServiceInterfaceUpdateExternalStatusCheckCall) DoAndReturn(f func(any, int, *gitlab.UpdateExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceUpdateExternalStatusCheckCall { +func (c *MockExternalStatusChecksServiceInterfaceUpdateExternalStatusCheckCall) DoAndReturn(f func(any, int64, *gitlab.UpdateExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceUpdateExternalStatusCheckCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateProjectExternalStatusCheck mocks base method. -func (m *MockExternalStatusChecksServiceInterface) UpdateProjectExternalStatusCheck(pid any, check int, opt *gitlab.UpdateProjectExternalStatusCheckOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectStatusCheck, *gitlab.Response, error) { +func (m *MockExternalStatusChecksServiceInterface) UpdateProjectExternalStatusCheck(pid any, check int64, opt *gitlab.UpdateProjectExternalStatusCheckOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectStatusCheck, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, check, opt} for _, a := range options { @@ -651,13 +651,13 @@ func (c *MockExternalStatusChecksServiceInterfaceUpdateProjectExternalStatusChec } // Do rewrite *gomock.Call.Do -func (c *MockExternalStatusChecksServiceInterfaceUpdateProjectExternalStatusCheckCall) Do(f func(any, int, *gitlab.UpdateProjectExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceUpdateProjectExternalStatusCheckCall { +func (c *MockExternalStatusChecksServiceInterfaceUpdateProjectExternalStatusCheckCall) Do(f func(any, int64, *gitlab.UpdateProjectExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceUpdateProjectExternalStatusCheckCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockExternalStatusChecksServiceInterfaceUpdateProjectExternalStatusCheckCall) DoAndReturn(f func(any, int, *gitlab.UpdateProjectExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceUpdateProjectExternalStatusCheckCall { +func (c *MockExternalStatusChecksServiceInterfaceUpdateProjectExternalStatusCheckCall) DoAndReturn(f func(any, int64, *gitlab.UpdateProjectExternalStatusCheckOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectStatusCheck, *gitlab.Response, error)) *MockExternalStatusChecksServiceInterfaceUpdateProjectExternalStatusCheckCall { c.Call = c.Call.DoAndReturn(f) return c } -- GitLab From e1c6fd0effcf6d429a45deab11405ee36b938f9c Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Thu, 9 Oct 2025 02:10:52 +0000 Subject: [PATCH 14/26] merge `main` into `release-client-1.0` --- .gitlab-ci.yml | 61 +- .gitlab/duo/mr-review-instructions.yaml | 33 ++ .gitlab/issue_templates/Bug Report.md | 49 ++ .../Request New API or Endpoint.md | 27 + .golangci.yml | 2 + .releaserc.json | 20 +- AGENTS.md | 384 ++++++++++++ CHANGELOG.md | 168 ++++++ CONTRIBUTING.md | 10 +- access_requests.go | 79 +-- access_requests_test.go | 2 + alert_management.go | 35 +- appearance.go | 23 +- application_statistics.go | 8 +- applications.go | 28 +- audit_events.go | 53 +- avatar.go | 8 +- award_emojis.go | 227 ++++---- award_emojis_test.go | 8 + boards.go | 84 +-- branches.go | 45 +- broadcast_messages.go | 44 +- bulk_imports.go | 3 - ci_yml_templates.go | 17 +- client_options_test.go | 186 ++++++ cluster_agents.go | 71 ++- cluster_agents_test.go | 12 + commits.go | 114 ++-- config/config_test.go | 136 +++++ config/extensions_test.go | 10 + container_registry.go | 72 +-- container_registry_protection_rules.go | 43 +- container_registry_protection_rules_test.go | 2 + container_registry_test.go | 2 + custom_attributes.go | 107 ++-- database_migrations.go | 12 +- dependencies.go | 12 +- dependency_list_export.go | 56 +- dependency_proxy.go | 10 +- deploy_keys.go | 86 +-- deploy_tokens.go | 80 +-- deployments.go | 53 +- deployments_merge_requests.go | 8 +- discussions.go | 292 +++++----- dockerfile_templates.go | 17 +- docs/guides/AddingAPISupport.md | 401 +++++++++++++ dora_metrics.go | 21 +- draft_notes.go | 65 ++- enterprise_users.go | 28 + enterprise_users_test.go | 18 + event_parsing_systemhook_test.go | 10 + gitlab.go | 98 +++- gitlab_service_map_generated_test.go | 4 + gitlab_test.go | 347 +++++++++++ gitlaboauth2/callback_server_test.go | 58 +- go.mod | 8 +- go.sum | 12 +- group_activity_analytics_test.go | 2 + group_hooks_test.go | 2 + group_members.go | 1 + group_members_test.go | 154 +++-- merge_requests.go | 28 +- merge_requests_test.go | 99 +++- model_registry.go | 61 ++ model_registry_test.go | 36 ++ namespaces_test.go | 2 + pagination_test.go | 20 + pipeline_triggers.go | 4 + pipeline_triggers_test.go | 99 +++- pipelines.go | 68 +++ pipelines_test.go | 110 +++- project_aliases.go | 121 ++++ project_aliases_test.go | 188 ++++++ project_members.go | 10 + project_members_test.go | 216 +++++-- project_statistics.go | 66 +++ project_statistics_test.go | 59 ++ projects.go | 48 ++ projects_test.go | 124 +++- protected_packages.go | 165 ++++++ protected_packages_test.go | 149 +++++ releaselinks_test.go | 2 + request_handler.go | 64 ++ request_handler_test.go | 328 +++++++++++ resource_milestone_events_test.go | 8 + scripts/commitlint/lint.js | 103 ---- scripts/commitlint/lint.sh | 34 -- scripts/commitlint/package-lock.json | 550 ------------------ scripts/commitlint/package.json | 15 - terraform_states_test.go | 16 + testdata/list_group_merge_requests.json | 138 +++++ testdata/list_users.json | 26 + testing/api_generated.go | 4 + testing/client_generated.go | 16 + testing/enterprise_users_mock.go | 44 ++ testing/model_registry_mock.go | 87 +++ testing/project_aliases_mock.go | 219 +++++++ testing/project_statistics_mock.go | 86 +++ testing/projects_mock.go | 45 ++ testing/protected_packages_mock.go | 220 +++++++ types.go | 7 +- types_test.go | 2 + validate_test.go | 6 + 103 files changed, 5984 insertions(+), 1737 deletions(-) create mode 100644 .gitlab/duo/mr-review-instructions.yaml create mode 100644 .gitlab/issue_templates/Bug Report.md create mode 100644 .gitlab/issue_templates/Request New API or Endpoint.md create mode 100644 AGENTS.md create mode 100644 client_options_test.go create mode 100644 docs/guides/AddingAPISupport.md create mode 100644 model_registry.go create mode 100644 model_registry_test.go create mode 100644 project_aliases.go create mode 100644 project_aliases_test.go create mode 100644 project_statistics.go create mode 100644 project_statistics_test.go create mode 100644 protected_packages.go create mode 100644 protected_packages_test.go create mode 100644 request_handler.go create mode 100644 request_handler_test.go delete mode 100644 scripts/commitlint/lint.js delete mode 100755 scripts/commitlint/lint.sh delete mode 100644 scripts/commitlint/package-lock.json delete mode 100644 scripts/commitlint/package.json create mode 100644 testdata/list_group_merge_requests.json create mode 100644 testdata/list_users.json create mode 100644 testing/model_registry_mock.go create mode 100644 testing/project_aliases_mock.go create mode 100644 testing/project_statistics_mock.go create mode 100644 testing/protected_packages_mock.go diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 470a7862..28dba870 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ workflow: include: - template: Jobs/SAST.gitlab-ci.yml + - 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 @@ -18,17 +19,26 @@ include: # groups. However, there is no easy way to conditionally set tags or even variables without # jeopardizing existing (complex) workflow:rules or job:rules. Thus, we resort to # this nasty conditionally include hack. - - local: '.gitlab/ci/gitlab-go-runner-tags.gitlab-ci.yml' + - local: ".gitlab/ci/gitlab-go-runner-tags.gitlab-ci.yml" rules: - if: $CI_PROJECT_ROOT_NAMESPACE == 'gitlab-org' || $CI_PROJECT_ROOT_NAMESPACE == 'gitlab-community' - - local: '.gitlab/ci/community-go-runner-tags.gitlab-ci.yml' + - local: ".gitlab/ci/community-go-runner-tags.gitlab-ci.yml" 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 + # 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.85.0 # renovate:managed - file: 'semantic-release.yml' + - project: "gitlab-com/gl-infra/common-ci-tasks" + ref: v2.93.0 + file: "semantic-release.yml" inputs: stage: deploy validate_stage: lint @@ -71,17 +81,17 @@ stages: - $GOLANGCI_LINT_CACHE/ - key: prefix: mise- - files: ['.tool-versions'] + files: [".tool-versions"] paths: - $MISE_DATA_DIR # We only need to run Go-related jobs when actual Go files changed # or when running either on the default branch or for a tag. rules: - - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH" - if: $CI_COMMIT_TAG - changes: - - '**/*.go' + - "**/*.go" - testdata/** - go.mod - go.sum @@ -97,8 +107,8 @@ golangci-lint: stage: lint needs: [] variables: - REPORT_FILENAME: 'gl-code-quality-report.json' - image: golangci/golangci-lint:v2.4.0 + REPORT_FILENAME: "gl-code-quality-report.json" + image: golangci/golangci-lint:v2.5.0 script: - golangci-lint run artifacts: @@ -134,20 +144,6 @@ verify-generated-code: exit 1; } -commitlint: - stage: lint - needs: [] - rules: - # lint.js script makes an API call without authentication, so the project or fork must be public - - if: '$CI_MERGE_REQUEST_IID && $CI_PROJECT_VISIBILITY == "public"' - when: always - image: ${GITLAB_DEPENDENCY_PROXY}node:22-slim - script: - - apt-get update && apt-get install -y git - - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME $CI_COMMIT_SHA - - cd scripts/commitlint && npm ci - - ./lint.sh - tests:unit: extends: - .go:versions @@ -189,12 +185,11 @@ semgrep-sast: rules: - when: always -# Patch common-ci semantic release jobs -semantic_release_check: - before_script: - - npm install -g semantic-release @semantic-release/gitlab @semantic-release/git @semantic-release/changelog - -semantic_release: - script: - - npm install -g semantic-release @semantic-release/gitlab @semantic-release/git @semantic-release/changelog - - semantic-release +# Update rules on dependency scanning so that it only runs when on the +# canonical project or the community fork. This ensures that when people +# use personal forks, it doesn't fail stating the forks are unlicensed. +dependency-scanning: + rules: + - if: $CI_PROJECT_ID == "65271576" # Canonical repository + - if: $CI_PROJECT_ID == "65275361" # Community Fork + - when: never diff --git a/.gitlab/duo/mr-review-instructions.yaml b/.gitlab/duo/mr-review-instructions.yaml new file mode 100644 index 00000000..51ddad92 --- /dev/null +++ b/.gitlab/duo/mr-review-instructions.yaml @@ -0,0 +1,33 @@ +instructions: + - name: Go Source Files + fileFilters: + - "*.go" + - "!*_test.go" + - "!*_mock.go" + - "!*_generated.go" + - "!testing/**/*" + instructions: | + 1. **Function Documentation**: Every public interface function, type, and method must have properly formatted comments starting with the function name (no "The" or "This function"), using present tense, keeping under 80 characters per line, and including GitLab API documentation link. + 2. **Interface Documentation**: Interface functions must have properly formatted comments. Functions that implement a public interface are not required to have a formatted comment, but may still have a comment. + 3. **API Alignment**: All code must align with GitLab's official API documentation. Every function must reference the corresponding GitLab API documentation URL. + 4. **Service Structure**: Follow the established service pattern with interface definition at the top, service struct below, and proper interface compliance check. + 5. **Request Options Pattern**: All API methods should accept `options ...RequestOptionFunc` and follow the standard error handling pattern returning `(*Type, *Response, error)` tuple. + 6. **Type Usage**: Use `any` instead of `interface{}` and `int64` instead of `int` for all numeric types including slices and maps. + 7. **Error Handling**: Always use `PathEscape()` for URL path parameters, `url.PathEscape()` for query parameters, and handle `parseID()` errors for project/group IDs. + 8. **Field Ordering**: Struct fields and methods should be ordered to match the GitLab API documentation order. + 9. **Pointer Usage**: Use pointers for structs that are used in Requests, and non-pointer for structs that are used in Responses. + 10. **Parameter Validation**: Use `any` type for project/group IDs to support both int64 and string, implement proper parameter parsing with `parseID()` function. + 11. **Variable Naming Standards**: Variables and function inputs should be named using lower camel casing to be consistent with the repository. "thisIsAVariable" is good, "this_is_a_variable" is bad. + + - name: Go Test Files + fileFilters: + - "*_test.go" + - "!*_generated_test.go" + instructions: | + 1. **Test Structure**: All tests must use `t.Parallel()`, use `testing` package with `testify/assert`, and follow the established test pattern with `setup(t)` function. + 2. **Test Coverage**: Each service method should have corresponding test coverage. When fixing bugs or creating new features, ensure new test scenarios are added to cover the new logic. + 3. **Gherkin Comments**: Write Gherkin comments in-line with tests using GIVEN/WHEN/THEN format to make tests easier to read. + 4. **Mock Usage**: Use mock HTTP handlers for API testing and store test data in `testdata/` directory. + 5. **Test Data**: Use `mustWriteHTTPResponse(t, w, "testdata/filename.json")` for test responses and `testMethod(t, r, http.MethodGet)` for HTTP method validation. + 6. **Assertions**: Use `assert.NoError(t, err)` and other testify assertions consistently. + diff --git a/.gitlab/issue_templates/Bug Report.md b/.gitlab/issue_templates/Bug Report.md new file mode 100644 index 00000000..d3e59740 --- /dev/null +++ b/.gitlab/issue_templates/Bug Report.md @@ -0,0 +1,49 @@ + + +/label ~"group::environments" ~"type::bug" ~"backend" + +## Bug Report + + + +## Relevant Code + + + +```golang + +``` + +## Relevant Log Output + + + +
+These are the logs of the error output: + +```plaintext + +``` + +
+ +## Additional Details + + + +- GitLab Client Go Version: `` +- GitLab Instance Version: `` +- Go Version: `` +- License Tier: `Free|Premium|Ultimate` diff --git a/.gitlab/issue_templates/Request New API or Endpoint.md b/.gitlab/issue_templates/Request New API or Endpoint.md new file mode 100644 index 00000000..48a349b0 --- /dev/null +++ b/.gitlab/issue_templates/Request New API or Endpoint.md @@ -0,0 +1,27 @@ + + + + +/label ~"group::environments" ~"type::feature" ~"feature::addition" + +## New API / Endpoint + + + + +API documentation: + +## Additional Details + + + +- [ ] I'd like to contribute it myself + +## Implementation Guide + +The code in `client-go` has a strong pattern that is repeatable when adding support for new APIs. + +- Read the instructions in [CONTRIBUTING.md](https://gitlab.com/gitlab-org/api/client-go/-/blob/main/CONTRIBUTING.md) to get your local development environment set up. +- Follow the instructions in [AddingAPISupport.md](https://gitlab.com/gitlab-org/api/client-go/-/blob/main/docs/guides/AddingAPISupport.md). + - This file includes instructions for adding all endpoints of an API. + - It also describes how to write functions for each type of endpoint, so can be used for adding new endpoint support as well. diff --git a/.golangci.yml b/.golangci.yml index 850d7dff..68c7fca4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -31,6 +31,8 @@ linters: - unconvert - usestdlibvars - whitespace + - tparallel + - paralleltest disable: - errcheck settings: diff --git a/.releaserc.json b/.releaserc.json index 0e617019..ab9aa899 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,24 +1,7 @@ { "branches": ["main"], "plugins": [ - [ - "@semantic-release/commit-analyzer", - { - "preset": "angular", - "releaseRules": [ - {"type": "breaking", "release": "major"}, - {"type": "feat", "release": "minor"}, - {"type": "fix", "release": "patch"}, - {"type": "refactor", "release": "patch"}, - {"type": "chore", "release": "patch"}, - {"type": "docs", "release": "patch"}, - {"type": "style", "release": false}, - {"type": "test", "release": false}, - {"scope": "no-release", "release": false}, - {"scope": "deps", "release": false} - ] - } - ], + "@gitlab/semantic-release-merge-request-analyzer", "@semantic-release/release-notes-generator", "@semantic-release/changelog", "@semantic-release/gitlab", @@ -31,4 +14,3 @@ ] ] } - diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..aa1a0623 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,384 @@ +# AI Agent Guidelines for GitLab client-go + +This document provides comprehensive guidelines for AI agents working with the GitLab client-go repository. It covers development practices, testing requirements, code formatting, API alignment, and code generation procedures. + +## Repository Overview + +The GitLab client-go is a Go client library for the GitLab API, enabling Go programs to interact with GitLab in a simple and uniform way. The repository follows strict Go best practices and maintains close alignment with GitLab's official API documentation. + +## Development Workflow + +### Prerequisites + +When asked to modify code, read CONTRIBUTING.md and README.md for examples and formatting instructions. Where the +instructions in CONTRIBUTING.md and README.md conflict with information in AGENTS.md, prefer the instructions in +CONTRIBUTING.md and README.md over the instructions in AGENTS.md + +When asked to perform analysis on the codebase instead of changing code, skipping the read of CONTRIBUTING.md and README.md +is allowed and preferred, since understanding contributing guidelines is not required to perform analysis. + +### Required Tools + +- **Go** - Use the version specified in go.mod +- **gofumpt** - Code formatter +- **golangci-lint** - Linting tool +- **buf** - Protocol buffer tools for code generation +- **gomock** - Mock generation + +### Running Tests + +```bash +# Run all tests with race detection +make test + +# Run the complete reviewable process (includes tests) +make reviewable +``` + +### Test Patterns + +- All tests use the `testing` package with `testify/assert` +- Tests are parallelized using `t.Parallel()` +- Mock HTTP handlers are used for API testing +- Test data is stored in `testdata/` directory +- Each service method should have corresponding test coverage + - **CRITICAL** - When fixing bugs or creating new features, ensure new test scenarios are added to cover the new logic. +- When writing a test, write Gherkin comments in-line with the test to make the tests easier to read. This means adding GIVEN/WHEN/THEN comments in tests. + + +### Test Structure Example + +```go +func TestGetUser(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + path := "/api/v4/users/1" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + mustWriteHTTPResponse(t, w, "testdata/get_user.json") + }) + + user, _, err := client.Users.GetUser(1, GetUsersOptions{}) + assert.NoError(t, err) + // ... assertions +} +``` + +## Code Formatting and Linting + +### Formatting + +The project uses `gofumpt` for code formatting: + +```bash +# Format all Go files +make fmt +``` + +**Formatting Rules:** +- Line width for comments: < 80 characters +- Line width for code: < 100 characters (where sensible) +- Use `gofumpt` for consistent formatting +- Follow Go best practices + +### Linting + +```bash +# Run all linters +make lint +``` + +**Linting Configuration:** +- Uses `golangci-lint` with custom configuration in `.golangci.yml` +- Enabled linters: asciicheck, dogsled, dupword, errorlint, goconst, misspell, + nakedret, nolintlint, revive, staticcheck, testifylint, unconvert, + usestdlibvars, whitespace +- Excludes generated files and examples directory + +## Mock generation + +This repository uses gomock to generate testing structs, which are in the `testing/` folder. These need to be kept up-to-date with function signatures to that the Service implementations match the interfaces that have generated mocks. + +### Available Generation Commands + +```bash +# Generate all code (protobuf, mocks, testing client) +make generate + +# Clean generated files +make clean +``` + +### Generation Scripts + +1. **`scripts/generate_testing_client.sh`** - Generates testing client with mocks +2. **`scripts/generate_mock_api.sh`** - Generates mock interfaces for all services +3. **`scripts/generate_service_interface_map.sh`** - Generates service interface mapping + +### When to Regenerate + +- After adding new service interfaces +- After modifying existing interfaces +- Before committing changes +- When mock generation fails + +## Function Comment Formatting + +### Required Comment Structure + +Every public function, type, and method must have properly formatted comments: + +```go +// FunctionName performs a specific action with the given parameters. +// +// GitLab API docs: https://docs.gitlab.com/api/endpoint/ +func (s *ServiceName) FunctionName(param Type, opt *Options, options ...RequestOptionFunc) (*ReturnType, *Response, error) { + // Implementation +} +``` + +### Comment Guidelines + +1. **Function Comments:** + - Start with function name (no "The" or "This function") + - Use present tense ("performs", "returns", "creates") + - Keep under 80 characters per line + - Include GitLab API documentation link + +2. **Type Comments:** + - Start with type name + - Describe the purpose and usage + - Include GitLab API documentation link + +3. **Struct Field Comments:** + - Use `json:"field_name"` tags + - Include `url:"field_name,omitempty"` for query parameters + - Document complex fields + +### GitLab API Documentation Alignment + +**CRITICAL: All code must align with GitLab's official API documentation.** + +#### API Documentation References + +Every function must reference the corresponding GitLab API documentation: + +```go +// GitLab API docs: https://docs.gitlab.com/api/users/ +// GitLab API docs: https://docs.gitlab.com/api/projects/#list-all-projects +// GitLab API docs: https://docs.gitlab.com/api/commits/#get-the-diff-of-a-commit +``` + +#### Field Ordering + +Struct fields and methods should be ordered to match the GitLab API documentation: + +```go +type CreateProjectOptions struct { + Name *string `url:"name,omitempty" json:"name,omitempty"` + Description *string `url:"description,omitempty" json:"description,omitempty"` + Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"` + // ... other fields in API documentation order +} +``` + +#### Parameter Validation + +- Use `any` type for project/group IDs to support both int64 and string. +- Implement proper parameter parsing with `parseID()` function +- Validate required parameters before making API calls + +## Code Structure and Patterns + +### Service Structure + +Each GitLab API service follows this pattern: + +```go +type ( + ServiceNameInterface interface { + MethodName(opt *MethodOptions, options ...RequestOptionFunc) (*ReturnType, *Response, error) + // ... other methods + } + + // ServiceName handles communication with the service related methods + // of the GitLab API. + // + // GitLab API docs: https://docs.gitlab.com/api/service/ + ServiceName struct { + client *Client + } +) + +var _ ServiceNameInterface = (*ServiceName)(nil) +``` + +### Request Options Pattern + +All API methods should accept `options ...RequestOptionFunc`: + +```go +func (s *ServiceName) MethodName(opt *MethodOptions, options ...RequestOptionFunc) (*ReturnType, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + + u := fmt.Sprintf("projects/%s/endpoint", PathEscape(project)) + + req, err := s.client.NewRequest(http.MethodGet, u, opt, options) + if err != nil { + return nil, nil, err + } + + var result *ReturnType + resp, err := s.client.Do(req, &result) + if err != nil { + return nil, resp, err + } + + return result, resp, nil +} +``` + +### Error Handling + +- Always return `(*Type, *Response, error)` tuple +- Use `PathEscape()` for URL path parameters +- Use `url.PathEscape()` for query parameters +- Handle `parseID()` errors for project/group IDs + +### Type Usage + +- Do not use `interface{}`, use the `any` alias instead! +- Do not use `int`, use `int64` instead! This applies to both slices and maps. + +## Pre-commit Checklist + +**CRITICAL: Tests MUST be run for every build or code modification.** +**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: + +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 + +## Code Generation Guidelines + +### When Adding New Services + +1. Create the service file (e.g., `new_service.go`) +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` + +### Mock Generation + +The repository uses `gomock` for generating mocks: + +```bash +# Generate mocks for all interfaces +make generate +``` + +Mocks are automatically generated in the `testing/` package and should not be manually edited. + +## File Organization + +### Service Files + +- One service per file (e.g., `users.go`, `projects.go`) +- Corresponding test file (e.g., `users_test.go`) +- Interface definition at the top of the file +- Service struct and implementation below + +### Generated Files + +- `testing/*_mock.go` - Generated mock files +- `testing/*_generated.go` - Generated testing client files +- `*_generated_test.go` - Generated test files + +**Never edit generated files manually.** + +## Common Patterns and Best Practices + +### Pointer Usage + +Use pointers for optional fields in structs: + +```go +type CreateUserOptions struct { + Name *string `url:"name,omitempty" json:"name,omitempty"` + Email *string `url:"email,omitempty" json:"email,omitempty"` + Username *string `url:"username,omitempty" json:"username,omitempty"` +} +``` + +### Time Handling + +Use `*time.Time` for time fields and `ISOTime` for custom time types that only support year-month-day formatting: + +```go +type User struct { + CreatedAt *time.Time `json:"created_at"` + LastActivityOn *ISOTime `json:"last_activity_on"` +} +``` + +### Response Handling + +Always return the full response for pagination and metadata: + +```go +users, resp, err := client.Users.ListUsers(&gitlab.ListUsersOptions{}) +if err != nil { + return err +} + +// Access pagination info +fmt.Printf("Total pages: %d\n", resp.TotalPages) +``` + +## Troubleshooting + +### Common Issues + +1. **Tests failing after changes:** + - Run `make generate` to update mocks + - Check for linting errors with `make lint` + - Ensure all imports are correct + +2. **Linting errors:** + - Run `make fmt` to fix formatting issues + - Check `.golangci.yml` for specific rule configurations + - Address any static analysis warnings + +3. **Generation failures:** + - Ensure all interfaces are properly defined + - Check that service files follow the correct pattern + - Verify that all required tools are installed + +### Getting Help + +- Check existing issues in the [issue tracker](https://gitlab.com/gitlab-org/api/client-go/-/issues) +- Review the [contributing guide](CONTRIBUTING.md) +- Examine similar implementations in the codebase +- Refer to [GitLab API documentation](https://docs.gitlab.com/ee/api/) + +## Summary + +When working with this repository: + +1. **Always run tests** - `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 +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 diff --git a/CHANGELOG.md b/CHANGELOG.md index ddfa7ae2..4d271790 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,171 @@ +## 0.154.0 + +### 🚀 Features + +- feat(protected_packages): Add api integration ([!2520](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2520)) by [Jose Gabriel Companioni Benitez](https://gitlab.com/elC0mpa) + + + +# [0.154.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.153.0...v0.154.0) (2025-10-08) + + +### Features + +* **protected_packages:** Add api integration ([2de15c7](https://gitlab.com/gitlab-org/api/client-go/commit/2de15c7875e232b0b0b1e5e5bb8e184cd11d0774)) + +## 0.153.0 + +### 🚀 Features + +- feat(project_Statistics): Added api integration ([!2512](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2512)) by [Jose Gabriel Companioni Benitez](https://gitlab.com/elC0mpa) + +### 🔄 Other Changes + +- refactor: moved comments to interface ([!2509](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2509)) by [ajey muthiah](https://gitlab.com/ajeymuthiah) +- chore(no-release): Helper Functions for Code Refactoring ([!2503](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2503)) by [Yashesvinee V](https://gitlab.com/yashes7516) +- Add t.Parallel() to all tests and enable linters ([!2513](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2513)) by [Timo Furrer](https://gitlab.com/timofurrer) +- ci: Remove the `commitlint` job. ([!2511](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2511)) by [Florian Forster](https://gitlab.com/fforster) +- refactor: moved comments to interface ([!2507](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2507)) by [ajey muthiah](https://gitlab.com/ajeymuthiah) + + + +# [0.153.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.152.0...v0.153.0) (2025-10-08) + + +### Features + +* **project_Statistics:** Added api integration ([75b5a03](https://gitlab.com/gitlab-org/api/client-go/commit/75b5a03010a39d5353c975a558fda0b6f00cb697)) + +## 0.152.0 + +### 🚀 Features + +- feat(api): add api support for listing users who starred a project ([!2486](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2486)) by [ajey muthiah](https://gitlab.com/ajeymuthiah) + +### 🔄 Other Changes + +- chore(no-release): Update Duo Review Instructions ([!2502](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2502)) by [Patrick Rice](https://gitlab.com/PatrickRice) +- feat(model_registry_api): Added api integration ([!2501](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2501)) by [Jose Gabriel Companioni Benitez](https://gitlab.com/elC0mpa) +- feat(no-release): Add AGENTS.md file ([!2479](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2479)) by [Patrick Rice](https://gitlab.com/PatrickRice) +- chore(no-release): Disable dependency scanning on personal forks ([!2500](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2500)) by [Patrick Rice](https://gitlab.com/PatrickRice) + + + +# [0.152.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.151.0...v0.152.0) (2025-10-06) + + +### Features + +* **api:** add api support for listing users who starred a project ([0cdb4ce](https://gitlab.com/gitlab-org/api/client-go/commit/0cdb4ce5399b43e47bf120a90b16d00c022e194c)) +* **model_registry_api:** Added api integration ([065dd63](https://gitlab.com/gitlab-org/api/client-go/commit/065dd639bc8bd0f44cab4d92dbe3ea7f134b913f)) +* **no-release:** Add AGENTS.md file ([b9febab](https://gitlab.com/gitlab-org/api/client-go/commit/b9febab3181c3f87edd1fd99b5e596f76bc8b7cc)) + +## 0.151.0 + +### 🚀 Features + +- feat(api): add api support for delete enterprise user ([!2492](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2492)) by [ajey muthiah](https://gitlab.com/ajeymuthiah) + +### 🔄 Other Changes + +- docs(no-release): Make it easier to find the docs on issues ([!2497](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2497)) by [Heidi Berry](https://gitlab.com/heidi.berry) + + + +# [0.151.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.150.0...v0.151.0) (2025-10-04) + + +### Features + +* **api:** add api support for delete enterprise user ([36ca8ab](https://gitlab.com/gitlab-org/api/client-go/commit/36ca8ab7672c352a073d59dacae3d763d4089abb)) + +## 0.150.0 + +### 🚀 Features + +- feat: add Project Aliases API support ([!2493](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2493)) by [Yashesvinee V](https://gitlab.com/yashes7516) + +### 🔄 Other Changes + +- chore(deps): update module buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go to v1.36.10-20250912141014-52f32327d4b0.1 ([!2495](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2495)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- chore(deps): update module github.com/danieljoos/wincred to v1.2.3 ([!2494](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2494)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) + + + +# [0.150.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.149.0...v0.150.0) (2025-10-03) + + +### Features + +* add Project Aliases API support ([4ece88e](https://gitlab.com/gitlab-org/api/client-go/commit/4ece88e6a8cfa0f53e68184b2905d4c2fb6e857a)) + +## 0.149.0 + +### 🚀 Features + +- feat(no-release): Add dependency scanning ([!2480](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2480)) by [Patrick Rice](https://gitlab.com/PatrickRice) + +### 🔄 Other Changes + +- ci(semantic-release): migrate to `@gitlab/semantic-release-merge-request-analyzer` ([!2490](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2490)) by [Florian Forster](https://gitlab.com/fforster) +- ci: add the `autolabels` job ([!2489](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2489)) by [Florian Forster](https://gitlab.com/fforster) +- chore(deps): update module google.golang.org/protobuf to v1.36.10 ([!2488](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2488)) by [GitLab Dependency Bot](https://gitlab.com/gitlab-dependency-update-bot) +- refactor(no-release): added tests for delete project hook method ([!2482](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2482)) by [Jose Gabriel Companioni Benitez](https://gitlab.com/elC0mpa) +- docs(no-release): Add guide for adding new APIs and issue templates ([!2478](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2478)) by [Heidi Berry](https://gitlab.com/heidi.berry) + + + +# [0.149.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.148.1...v0.149.0) (2025-10-02) + + +### Features + +* **no-release:** Add dependency scanning ([8b0ee10](https://gitlab.com/gitlab-org/api/client-go/commit/8b0ee10acb8adceb5d34be2165b7d587b1e42e49)) + +## [0.148.1](https://gitlab.com/gitlab-org/api/client-go/compare/v0.148.0...v0.148.1) (2025-09-26) + + +### Bug Fixes + +* label unmarshaling for `BasicMergeRequest` list operations ([e80c453](https://gitlab.com/gitlab-org/api/client-go/commit/e80c453aa6a5a265ec8748ae3f3f761a70f4470e)) + +# [0.148.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.147.1...v0.148.0) (2025-09-23) + + +### Features + +* **ResourceGroup:** add `newest_ready_first` to resource group `process_mode` ([fc8f743](https://gitlab.com/gitlab-org/api/client-go/commit/fc8f7431da4ca8594723105473687e8f1378df2b)) + +## [0.147.1](https://gitlab.com/gitlab-org/api/client-go/compare/v0.147.0...v0.147.1) (2025-09-22) + + +### Bug Fixes + +* **client:** use default retry policy from retryablehttp ([2a72511](https://gitlab.com/gitlab-org/api/client-go/commit/2a725113118608712f668b159ca2dab11f4e588e)) + +# [0.147.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.146.0...v0.147.0) (2025-09-22) + + +### Features + +* **Project:** add resource_group_default_process_mode ([7804faf](https://gitlab.com/gitlab-org/api/client-go/commit/7804fafa18cc15fec8a0886a081bf3311d72eb1f)) + +# [0.146.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.145.0...v0.146.0) (2025-09-18) + + +### Features + +* **pipelines:** Add compile-time type-safe pipeline inputs support ([4b30e60](https://gitlab.com/gitlab-org/api/client-go/commit/4b30e60260e4f06e7684352693aac49abd748579)), closes [gitlab-org/api/client-go#2154](https://gitlab.com/gitlab-org/api/client-go/issues/2154) +* **PipelinesService:** Add support for pipeline inputs with type validation ([ab3056f](https://gitlab.com/gitlab-org/api/client-go/commit/ab3056f403ec0268e14b312de3f5b51b115ad97a)), closes [gitlab-org/api/client-go#2154](https://gitlab.com/gitlab-org/api/client-go/issues/2154) +* **PipelineTriggersService:** Add support for pipeline inputs to trigger API ([9ad770e](https://gitlab.com/gitlab-org/api/client-go/commit/9ad770e49e59b2a41c665dfc4781f3b56650e813)), closes [gitlab-org/api/client-go#2154](https://gitlab.com/gitlab-org/api/client-go/issues/2154) + +# [0.145.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.144.1...v0.145.0) (2025-09-15) + + +### Features + +* Add missing created_by field to ProjectMembers and GroupMembers ([5348e01](https://gitlab.com/gitlab-org/api/client-go/commit/5348e01913c358c53bdd3da46b069713273d6802)) + ## [0.144.1](https://gitlab.com/gitlab-org/api/client-go/compare/v0.144.0...v0.144.1) (2025-09-13) # [0.144.0](https://gitlab.com/gitlab-org/api/client-go/compare/v0.143.3...v0.144.0) (2025-09-12) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fb7d5c27..25c74f5b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,16 +43,24 @@ New `struct` fields or methods should be placed (as much as possible) in the sam order as the ordering used in the public API docs. The idea is that this makes it easier to find things. -### Setting up your local development environment to contribute +## Setting up your local development environment to contribute 1. Install dependencies: + ```sh make setup ``` + 1. Make your changes on your feature branch in the community fork or your personal fork 1. Run the reviewable command, which tests, lints and formats the code: + ```sh make reviewable ``` + 1. Push your feature branch upstream 1. Open up your merge request + +## Development Guides + +For more detailed advice on adding new features, please see our dedicated [guide for adding new APIs or Endpoints](./docs/guides/AddingAPISupport.md). diff --git a/access_requests.go b/access_requests.go index 1e19d3d7..0b61698a 100644 --- a/access_requests.go +++ b/access_requests.go @@ -24,13 +24,56 @@ 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(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(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(pid any, options ...RequestOptionFunc) (*AccessRequest, *Response, error) + + // RequestGroupAccess 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 RequestGroupAccess(gid any, options ...RequestOptionFunc) (*AccessRequest, *Response, error) + + // ApproveProjectAccessRequest approves an access request for the given user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/access_requests/#approve-an-access-request 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 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 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 int64, options ...RequestOptionFunc) (*Response, error) } @@ -68,11 +111,6 @@ type ListAccessRequestsOptions struct { ListOptions } -// 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 func (s *AccessRequestsService) ListProjectAccessRequests(pid any, opt *ListAccessRequestsOptions, options ...RequestOptionFunc) ([]*AccessRequest, *Response, error) { project, err := parseID(pid) if err != nil { @@ -94,11 +132,6 @@ func (s *AccessRequestsService) ListProjectAccessRequests(pid any, opt *ListAcce return ars, resp, nil } -// 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 func (s *AccessRequestsService) ListGroupAccessRequests(gid any, opt *ListAccessRequestsOptions, options ...RequestOptionFunc) ([]*AccessRequest, *Response, error) { group, err := parseID(gid) if err != nil { @@ -120,11 +153,6 @@ func (s *AccessRequestsService) ListGroupAccessRequests(gid any, opt *ListAccess return ars, resp, nil } -// 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 func (s *AccessRequestsService) RequestProjectAccess(pid any, options ...RequestOptionFunc) (*AccessRequest, *Response, error) { project, err := parseID(pid) if err != nil { @@ -146,11 +174,6 @@ func (s *AccessRequestsService) RequestProjectAccess(pid any, options ...Request return ar, resp, nil } -// RequestGroupAccess 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 func (s *AccessRequestsService) RequestGroupAccess(gid any, options ...RequestOptionFunc) (*AccessRequest, *Response, error) { group, err := parseID(gid) if err != nil { @@ -181,10 +204,6 @@ type ApproveAccessRequestOptions struct { AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` } -// ApproveProjectAccessRequest approves an access request for the given user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/access_requests/#approve-an-access-request func (s *AccessRequestsService) ApproveProjectAccessRequest(pid any, user int64, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) { project, err := parseID(pid) if err != nil { @@ -206,10 +225,6 @@ func (s *AccessRequestsService) ApproveProjectAccessRequest(pid any, user int64, return ar, resp, nil } -// ApproveGroupAccessRequest approves an access request for the given user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/access_requests/#approve-an-access-request func (s *AccessRequestsService) ApproveGroupAccessRequest(gid any, user int64, opt *ApproveAccessRequestOptions, options ...RequestOptionFunc) (*AccessRequest, *Response, error) { group, err := parseID(gid) if err != nil { @@ -231,10 +246,6 @@ func (s *AccessRequestsService) ApproveGroupAccessRequest(gid any, user int64, o return ar, resp, nil } -// DenyProjectAccessRequest denies an access request for the given user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/access_requests/#deny-an-access-request func (s *AccessRequestsService) DenyProjectAccessRequest(pid any, user int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -250,10 +261,6 @@ func (s *AccessRequestsService) DenyProjectAccessRequest(pid any, user int64, op return s.client.Do(req, nil) } -// DenyGroupAccessRequest denies an access request for the given user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/access_requests/#deny-an-access-request func (s *AccessRequestsService) DenyGroupAccessRequest(gid any, user int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { diff --git a/access_requests_test.go b/access_requests_test.go index 26f038f1..bdb26538 100644 --- a/access_requests_test.go +++ b/access_requests_test.go @@ -104,6 +104,8 @@ func TestListProjectAccessRequests(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() + requests, resp, err := client.AccessRequests.ListProjectAccessRequests(tt.projectID, nil) if tt.expectedErr != nil { diff --git a/alert_management.go b/alert_management.go index 1b979c76..af53bf35 100644 --- a/alert_management.go +++ b/alert_management.go @@ -23,9 +23,28 @@ import ( type ( AlertManagementServiceInterface interface { + // UploadMetricImage uploads a metric image to a project alert. + // + // GitLab API docs: + // https://docs.gitlab.com/api/alert_management_alerts/#upload-metric-image 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 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 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 int64, id int64, options ...RequestOptionFunc) (*Response, error) } @@ -63,10 +82,6 @@ type UploadMetricImageOptions struct { URLText *string `url:"url_text,omitempty" json:"url_text,omitempty"` } -// UploadMetricImage uploads a metric image to a project alert. -// -// GitLab API docs: -// https://docs.gitlab.com/api/alert_management_alerts/#upload-metric-image 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 { @@ -96,10 +111,6 @@ type ListMetricImagesOptions struct { ListOptions } -// ListMetricImages lists all the metric images for a project alert. -// -// GitLab API docs: -// https://docs.gitlab.com/api/alert_management_alerts/#list-metric-images func (s *AlertManagementService) ListMetricImages(pid any, alertIID int64, opt *ListMetricImagesOptions, options ...RequestOptionFunc) ([]*MetricImage, *Response, error) { project, err := parseID(pid) if err != nil { @@ -130,10 +141,6 @@ type UpdateMetricImageOptions struct { URLText *string `url:"url_text,omitempty" json:"url_text,omitempty"` } -// UpdateMetricImage updates a metric image for a project alert. -// -// GitLab API docs: -// https://docs.gitlab.com/api/alert_management_alerts/#update-metric-image func (s *AlertManagementService) UpdateMetricImage(pid any, alertIID int64, id int64, opt *UpdateMetricImageOptions, options ...RequestOptionFunc) (*MetricImage, *Response, error) { project, err := parseID(pid) if err != nil { @@ -155,10 +162,6 @@ func (s *AlertManagementService) UpdateMetricImage(pid any, alertIID int64, id i return mi, resp, nil } -// DeleteMetricImage deletes a metric image for a project alert. -// -// GitLab API docs: -// https://docs.gitlab.com/api/alert_management_alerts/#delete-metric-image func (s *AlertManagementService) DeleteMetricImage(pid any, alertIID int64, id int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { diff --git a/appearance.go b/appearance.go index 6b4724e5..876a2eb6 100644 --- a/appearance.go +++ b/appearance.go @@ -20,13 +20,22 @@ import "net/http" type ( AppearanceServiceInterface interface { + // GetAppearance gets the current appearance configuration of the GitLab instance. + // + // GitLab API docs: + // https://docs.gitlab.com/api/appearance/#get-details-on-current-application-appearance GetAppearance(options ...RequestOptionFunc) (*Appearance, *Response, error) + + // ChangeAppearance changes the appearance configuration. + // + // GitLab API docs: + // https://docs.gitlab.com/api/appearance/#update-application-appearance ChangeAppearance(opt *ChangeAppearanceOptions, options ...RequestOptionFunc) (*Appearance, *Response, error) } - // AppearanceService handles communication with appearance of the Gitlab API. + // AppearanceService handles communication with appearance of the GitLab API. // - // Gitlab API docs: https://docs.gitlab.com/api/appearance/ + // GitLab API docs: https://docs.gitlab.com/api/appearance/ AppearanceService struct { client *Client } @@ -36,7 +45,7 @@ var _ AppearanceServiceInterface = (*AppearanceService)(nil) // Appearance represents a GitLab appearance. // -// Gitlab API docs: https://docs.gitlab.com/api/appearance/ +// GitLab API docs: https://docs.gitlab.com/api/appearance/ type Appearance struct { Title string `json:"title"` Description string `json:"description"` @@ -57,10 +66,6 @@ type Appearance struct { EmailHeaderAndFooterEnabled bool `json:"email_header_and_footer_enabled"` } -// GetAppearance gets the current appearance configuration of the GitLab instance. -// -// Gitlab API docs: -// https://docs.gitlab.com/api/appearance/#get-details-on-current-application-appearance func (s *AppearanceService) GetAppearance(options ...RequestOptionFunc) (*Appearance, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "application/appearance", nil, options) if err != nil { @@ -101,10 +106,6 @@ type ChangeAppearanceOptions struct { URL *string `url:"url,omitempty" json:"url,omitempty"` } -// ChangeAppearance changes the appearance configuration. -// -// Gitlab API docs: -// https://docs.gitlab.com/api/appearance/#update-application-appearance func (s *AppearanceService) ChangeAppearance(opt *ChangeAppearanceOptions, options ...RequestOptionFunc) (*Appearance, *Response, error) { req, err := s.client.NewRequest(http.MethodPut, "application/appearance", opt, options) if err != nil { diff --git a/application_statistics.go b/application_statistics.go index 5442852c..df3f9d61 100644 --- a/application_statistics.go +++ b/application_statistics.go @@ -18,6 +18,10 @@ import "net/http" type ( ApplicationStatisticsServiceInterface interface { + // GetApplicationStatistics gets details on the current application statistics. + // + // GitLab API docs: + // https://docs.gitlab.com/api/statistics/#get-details-on-current-application-statistics GetApplicationStatistics(options ...RequestOptionFunc) (*ApplicationStatistics, *Response, error) } @@ -49,10 +53,6 @@ type ApplicationStatistics struct { ActiveUsers int `url:"active_users" json:"active_users"` } -// GetApplicationStatistics gets details on the current application statistics. -// -// GitLab API docs: -// https://docs.gitlab.com/api/statistics/#get-details-on-current-application-statistics func (s *ApplicationStatisticsService) GetApplicationStatistics(options ...RequestOptionFunc) (*ApplicationStatistics, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "application/statistics", nil, options) if err != nil { diff --git a/applications.go b/applications.go index 919ce12e..f5987d8f 100644 --- a/applications.go +++ b/applications.go @@ -23,15 +23,29 @@ import ( type ( ApplicationsServiceInterface interface { + // CreateApplication creates a new application owned by the authenticated user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/applications/#create-an-application CreateApplication(opt *CreateApplicationOptions, options ...RequestOptionFunc) (*Application, *Response, error) + + // ListApplications get a list of administrables applications by the authenticated user + // + // GitLab API docs: + // https://docs.gitlab.com/api/applications/#list-all-applications ListApplications(opt *ListApplicationsOptions, options ...RequestOptionFunc) ([]*Application, *Response, error) + + // DeleteApplication removes a specific application. + // + // GitLab API docs: + // https://docs.gitlab.com/api/applications/#delete-an-application DeleteApplication(application int64, options ...RequestOptionFunc) (*Response, error) } // ApplicationsService handles communication with administrables applications - // of the Gitlab API. + // of the GitLab API. // - // Gitlab API docs: https://docs.gitlab.com/api/applications/ + // GitLab API docs: https://docs.gitlab.com/api/applications/ ApplicationsService struct { client *Client } @@ -60,9 +74,6 @@ type CreateApplicationOptions struct { Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"` } -// CreateApplication creates a new application owned by the authenticated user. -// -// Gitlab API docs: https://docs.gitlab.com/api/applications/#create-an-application func (s *ApplicationsService) CreateApplication(opt *CreateApplicationOptions, options ...RequestOptionFunc) (*Application, *Response, error) { req, err := s.client.NewRequest(http.MethodPost, "applications", opt, options) if err != nil { @@ -84,9 +95,6 @@ type ListApplicationsOptions struct { ListOptions } -// ListApplications get a list of administrables applications by the authenticated user -// -// Gitlab API docs : https://docs.gitlab.com/api/applications/#list-all-applications func (s *ApplicationsService) ListApplications(opt *ListApplicationsOptions, options ...RequestOptionFunc) ([]*Application, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "applications", opt, options) if err != nil { @@ -102,10 +110,6 @@ func (s *ApplicationsService) ListApplications(opt *ListApplicationsOptions, opt return as, resp, nil } -// DeleteApplication removes a specific application. -// -// GitLab API docs: -// https://docs.gitlab.com/api/applications/#delete-an-application func (s *ApplicationsService) DeleteApplication(application int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("applications/%d", application) diff --git a/audit_events.go b/audit_events.go index 30b607e3..57589720 100644 --- a/audit_events.go +++ b/audit_events.go @@ -8,11 +8,41 @@ 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(opt *ListAuditEventsOptions, options ...RequestOptionFunc) ([]*AuditEvent, *Response, error) + + // GetInstanceAuditEvent gets a specific instance audit event. + // Authentication as Administrator is required. + // + // GitLab API docs: + // https://docs.gitlab.com/api/audit_events/#retrieve-single-instance-audit-event GetInstanceAuditEvent(event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) + + // ListGroupAuditEvents gets a list of audit events for the specified group + // viewable by the authenticated user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/audit_events/#retrieve-all-group-audit-events ListGroupAuditEvents(gid any, opt *ListAuditEventsOptions, options ...RequestOptionFunc) ([]*AuditEvent, *Response, error) + + // 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 int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) + + // ListProjectAuditEvents gets a list of audit events for the specified project + // viewable by the authenticated user. + // + // GitLab API docs: https://docs.gitlab.com/api/audit_events/#retrieve-all-project-audit-events ListProjectAuditEvents(pid any, opt *ListAuditEventsOptions, options ...RequestOptionFunc) ([]*AuditEvent, *Response, error) + + // 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 int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) } @@ -77,10 +107,6 @@ type ListAuditEventsOptions struct { CreatedBefore *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"` } -// 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 func (s *AuditEventsService) ListInstanceAuditEvents(opt *ListAuditEventsOptions, options ...RequestOptionFunc) ([]*AuditEvent, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "audit_events", opt, options) if err != nil { @@ -96,10 +122,6 @@ func (s *AuditEventsService) ListInstanceAuditEvents(opt *ListAuditEventsOptions return aes, resp, nil } -// GetInstanceAuditEvent gets a specific instance audit event. -// Authentication as Administrator is required. -// -// GitLab API docs: https://docs.gitlab.com/api/audit_events/#retrieve-single-instance-audit-event func (s *AuditEventsService) GetInstanceAuditEvent(event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { u := fmt.Sprintf("audit_events/%d", event) @@ -117,10 +139,6 @@ func (s *AuditEventsService) GetInstanceAuditEvent(event int64, options ...Reque return ae, resp, nil } -// ListGroupAuditEvents gets a list of audit events for the specified group -// viewable by the authenticated user. -// -// GitLab API docs: https://docs.gitlab.com/api/audit_events/#retrieve-all-group-audit-events func (s *AuditEventsService) ListGroupAuditEvents(gid any, opt *ListAuditEventsOptions, options ...RequestOptionFunc) ([]*AuditEvent, *Response, error) { group, err := parseID(gid) if err != nil { @@ -142,9 +160,6 @@ func (s *AuditEventsService) ListGroupAuditEvents(gid any, opt *ListAuditEventsO return aes, resp, nil } -// GetGroupAuditEvent gets a specific group audit event. -// -// GitLab API docs: https://docs.gitlab.com/api/audit_events/#retrieve-a-specific-group-audit-event func (s *AuditEventsService) GetGroupAuditEvent(gid any, event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { group, err := parseID(gid) if err != nil { @@ -166,10 +181,6 @@ func (s *AuditEventsService) GetGroupAuditEvent(gid any, event int64, options .. return ae, resp, nil } -// ListProjectAuditEvents gets a list of audit events for the specified project -// viewable by the authenticated user. -// -// GitLab API docs: https://docs.gitlab.com/api/audit_events/#retrieve-all-project-audit-events func (s *AuditEventsService) ListProjectAuditEvents(pid any, opt *ListAuditEventsOptions, options ...RequestOptionFunc) ([]*AuditEvent, *Response, error) { project, err := parseID(pid) if err != nil { @@ -191,10 +202,6 @@ func (s *AuditEventsService) ListProjectAuditEvents(pid any, opt *ListAuditEvent return aes, resp, nil } -// GetProjectAuditEvent gets a specific project audit event. -// -// GitLab API docs: -// https://docs.gitlab.com/api/audit_events/#retrieve-a-specific-project-audit-event func (s *AuditEventsService) GetProjectAuditEvent(pid any, event int64, options ...RequestOptionFunc) (*AuditEvent, *Response, error) { project, err := parseID(pid) if err != nil { diff --git a/avatar.go b/avatar.go index e0bf2d6f..7536936f 100644 --- a/avatar.go +++ b/avatar.go @@ -22,6 +22,10 @@ import ( type ( AvatarRequestsServiceInterface interface { + // GetAvatar gets the avatar URL for a user with the given email address. + // + // GitLab API docs: + // https://docs.gitlab.com/api/avatar/#get-details-on-an-account-avatar GetAvatar(opt *GetAvatarOptions, options ...RequestOptionFunc) (*Avatar, *Response, error) } @@ -52,10 +56,6 @@ type GetAvatarOptions struct { Size *int `url:"size,omitempty" json:"size,omitempty"` } -// GetAvatar gets the avatar URL for a user with the given email address. -// -// GitLab API docs: -// https://docs.gitlab.com/api/avatar/#get-details-on-an-account-avatar func (s *AvatarRequestsService) GetAvatar(opt *GetAvatarOptions, options ...RequestOptionFunc) (*Avatar, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "avatar", opt, options) if err != nil { diff --git a/award_emojis.go b/award_emojis.go index e1905b3b..2f60f6cb 100644 --- a/award_emojis.go +++ b/award_emojis.go @@ -24,29 +24,154 @@ import ( type ( AwardEmojiServiceInterface interface { + // ListMergeRequestAwardEmoji gets a list of all award emoji on the merge request. + // + // GitLab API docs: + // https://docs.gitlab.com/api/emoji_reactions/#list-an-awardables-emoji-reactions 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 int64, options ...RequestOptionFunc) (*Response, error) } @@ -89,26 +214,14 @@ type ListAwardEmojiOptions struct { ListOptions } -// ListMergeRequestAwardEmoji gets a list of all award emoji on the merge request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/emoji_reactions/#list-an-awardables-emoji-reactions func (s *AwardEmojiService) ListMergeRequestAwardEmoji(pid any, mergeRequestIID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return s.listAwardEmoji(pid, awardMergeRequest, mergeRequestIID, opt, options...) } -// 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 func (s *AwardEmojiService) ListIssueAwardEmoji(pid any, issueIID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return s.listAwardEmoji(pid, awardIssue, issueIID, opt, options...) } -// 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 func (s *AwardEmojiService) ListSnippetAwardEmoji(pid any, snippetID int64, opt *ListAwardEmojiOptions, options ...RequestOptionFunc) ([]*AwardEmoji, *Response, error) { return s.listAwardEmoji(pid, awardSnippets, snippetID, opt, options...) } @@ -138,26 +251,14 @@ func (s *AwardEmojiService) listAwardEmoji(pid any, resource string, resourceID return as, resp, nil } -// GetMergeRequestAwardEmoji get an award emoji from merge request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/emoji_reactions/#get-single-emoji-reaction func (s *AwardEmojiService) GetMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getAwardEmoji(pid, awardMergeRequest, mergeRequestIID, awardID, options...) } -// GetIssueAwardEmoji get an award emoji from issue. -// -// GitLab API docs: -// https://docs.gitlab.com/api/emoji_reactions/#get-single-emoji-reaction func (s *AwardEmojiService) GetIssueAwardEmoji(pid any, issueIID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getAwardEmoji(pid, awardIssue, issueIID, awardID, options...) } -// GetSnippetAwardEmoji get an award emoji from snippet. -// -// GitLab API docs: -// https://docs.gitlab.com/api/emoji_reactions/#get-single-emoji-reaction func (s *AwardEmojiService) GetSnippetAwardEmoji(pid any, snippetID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getAwardEmoji(pid, awardSnippets, snippetID, awardID, options...) } @@ -197,26 +298,14 @@ type CreateAwardEmojiOptions struct { Name string `json:"name"` } -// CreateMergeRequestAwardEmoji get an award emoji from merge request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction func (s *AwardEmojiService) CreateMergeRequestAwardEmoji(pid any, mergeRequestIID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.createAwardEmoji(pid, awardMergeRequest, mergeRequestIID, opt, options...) } -// CreateIssueAwardEmoji get an award emoji from issue. -// -// GitLab API docs: -// https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction func (s *AwardEmojiService) CreateIssueAwardEmoji(pid any, issueIID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.createAwardEmoji(pid, awardIssue, issueIID, opt, options...) } -// CreateSnippetAwardEmoji get an award emoji from snippet. -// -// GitLab API docs: -// https://docs.gitlab.com/api/emoji_reactions/#add-a-new-emoji-reaction func (s *AwardEmojiService) CreateSnippetAwardEmoji(pid any, snippetID int64, opt *CreateAwardEmojiOptions, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.createAwardEmoji(pid, awardSnippets, snippetID, opt, options...) } @@ -246,26 +335,14 @@ func (s *AwardEmojiService) createAwardEmoji(pid any, resource string, resourceI return a, resp, nil } -// DeleteIssueAwardEmoji delete award emoji on an issue. -// -// GitLab API docs: -// https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction func (s *AwardEmojiService) DeleteIssueAwardEmoji(pid any, issueIID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmoji(pid, awardIssue, issueIID, awardID, options...) } -// DeleteMergeRequestAwardEmoji delete award emoji on a merge request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction func (s *AwardEmojiService) DeleteMergeRequestAwardEmoji(pid any, mergeRequestIID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmoji(pid, awardMergeRequest, mergeRequestIID, awardID, options...) } -// DeleteSnippetAwardEmoji delete award emoji on a snippet. -// -// GitLab API docs: -// https://docs.gitlab.com/api/emoji_reactions/#delete-an-emoji-reaction func (s *AwardEmojiService) DeleteSnippetAwardEmoji(pid any, snippetID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmoji(pid, awardSnippets, snippetID, awardID, options...) } @@ -289,29 +366,14 @@ func (s *AwardEmojiService) deleteAwardEmoji(pid any, resource string, resourceI return s.client.Do(req, nil) } -// 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 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...) } -// 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 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...) } -// 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 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...) } @@ -338,28 +400,15 @@ func (s *AwardEmojiService) listAwardEmojiOnNote(pid any, resources string, reso return as, resp, nil } -// 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 func (s *AwardEmojiService) GetIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getSingleNoteAwardEmoji(pid, awardIssue, issueID, noteID, awardID, options...) } -// 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 func (s *AwardEmojiService) GetMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getSingleNoteAwardEmoji(pid, awardMergeRequest, mergeRequestIID, noteID, awardID, options...) } -// 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 func (s *AwardEmojiService) GetSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int64, options ...RequestOptionFunc) (*AwardEmoji, *Response, error) { return s.getSingleNoteAwardEmoji(pid, awardSnippets, snippetIID, noteID, awardID, options...) } @@ -391,27 +440,14 @@ func (s *AwardEmojiService) getSingleNoteAwardEmoji(pid any, resource string, re return a, resp, nil } -// 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 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...) } -// 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 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...) } -// 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 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...) } @@ -446,28 +482,15 @@ func (s *AwardEmojiService) createAwardEmojiOnNote(pid any, resource string, res return a, resp, nil } -// 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 func (s *AwardEmojiService) DeleteIssuesAwardEmojiOnNote(pid any, issueID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmojiOnNote(pid, awardIssue, issueID, noteID, awardID, options...) } -// 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 func (s *AwardEmojiService) DeleteMergeRequestAwardEmojiOnNote(pid any, mergeRequestIID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmojiOnNote(pid, awardMergeRequest, mergeRequestIID, noteID, awardID, options...) } -// 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 func (s *AwardEmojiService) DeleteSnippetAwardEmojiOnNote(pid any, snippetIID, noteID, awardID int64, options ...RequestOptionFunc) (*Response, error) { return s.deleteAwardEmojiOnNote(pid, awardSnippets, snippetIID, noteID, awardID, options...) } diff --git a/award_emojis_test.go b/award_emojis_test.go index 2a6253d0..04730e7f 100644 --- a/award_emojis_test.go +++ b/award_emojis_test.go @@ -1484,6 +1484,8 @@ func TestAwardEmojiService_EdgeCases(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/1/merge_requests/80/award_emoji", tt.handler) aes, resp, err := client.AwardEmoji.ListMergeRequestAwardEmoji(1, 80, nil) @@ -1492,6 +1494,8 @@ func TestAwardEmojiService_EdgeCases(t *testing.T) { } t.Run("invalid project ID format", func(t *testing.T) { + t.Parallel() + _, client := setup(t) aes, resp, err := client.AwardEmoji.ListMergeRequestAwardEmoji("invalid-project-id", 80, nil) require.Error(t, err) @@ -1501,6 +1505,8 @@ func TestAwardEmojiService_EdgeCases(t *testing.T) { }) t.Run("negative merge request IID", func(t *testing.T) { + t.Parallel() + _, client := setup(t) aes, resp, err := client.AwardEmoji.ListMergeRequestAwardEmoji(1, -80, nil) require.Error(t, err) @@ -1510,6 +1516,8 @@ func TestAwardEmojiService_EdgeCases(t *testing.T) { }) t.Run("zero merge request IID", func(t *testing.T) { + t.Parallel() + _, client := setup(t) aes, resp, err := client.AwardEmoji.ListMergeRequestAwardEmoji(1, 0, nil) require.Error(t, err) diff --git a/boards.go b/boards.go index ed504fed..6f4000cb 100644 --- a/boards.go +++ b/boards.go @@ -23,15 +23,66 @@ import ( type ( IssueBoardsServiceInterface interface { + // CreateIssueBoard creates a new issue board. + // + // GitLab API docs: + // https://docs.gitlab.com/api/boards/#create-an-issue-board CreateIssueBoard(pid any, opt *CreateIssueBoardOptions, options ...RequestOptionFunc) (*IssueBoard, *Response, error) + + // UpdateIssueBoard update an issue board. + // + // GitLab API docs: + // https://docs.gitlab.com/api/boards/#update-an-issue-board 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 int64, options ...RequestOptionFunc) (*Response, error) + + // ListIssueBoards gets a list of all issue boards in a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/boards/#list-project-issue-boards ListIssueBoards(pid any, opt *ListIssueBoardsOptions, options ...RequestOptionFunc) ([]*IssueBoard, *Response, error) + + // GetIssueBoard gets a single issue board of a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/boards/#show-a-single-issue-board 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 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 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 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 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 int64, options ...RequestOptionFunc) (*Response, error) } @@ -102,9 +153,6 @@ type CreateIssueBoardOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` } -// CreateIssueBoard creates a new issue board. -// -// GitLab API docs: https://docs.gitlab.com/api/boards/#create-an-issue-board func (s *IssueBoardsService) CreateIssueBoard(pid any, opt *CreateIssueBoardOptions, options ...RequestOptionFunc) (*IssueBoard, *Response, error) { project, err := parseID(pid) if err != nil { @@ -137,9 +185,6 @@ type UpdateIssueBoardOptions struct { Weight *int64 `url:"weight,omitempty" json:"weight,omitempty"` } -// UpdateIssueBoard update an issue board. -// -// GitLab API docs: https://docs.gitlab.com/api/boards/#update-an-issue-board func (s *IssueBoardsService) UpdateIssueBoard(pid any, board int64, opt *UpdateIssueBoardOptions, options ...RequestOptionFunc) (*IssueBoard, *Response, error) { project, err := parseID(pid) if err != nil { @@ -161,9 +206,6 @@ func (s *IssueBoardsService) UpdateIssueBoard(pid any, board int64, opt *UpdateI return is, resp, nil } -// DeleteIssueBoard deletes an issue board. -// -// GitLab API docs: https://docs.gitlab.com/api/boards/#delete-an-issue-board func (s *IssueBoardsService) DeleteIssueBoard(pid any, board int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -186,9 +228,6 @@ type ListIssueBoardsOptions struct { ListOptions } -// ListIssueBoards gets a list of all issue boards in a project. -// -// GitLab API docs: https://docs.gitlab.com/api/boards/#list-project-issue-boards func (s *IssueBoardsService) ListIssueBoards(pid any, opt *ListIssueBoardsOptions, options ...RequestOptionFunc) ([]*IssueBoard, *Response, error) { project, err := parseID(pid) if err != nil { @@ -210,9 +249,6 @@ func (s *IssueBoardsService) ListIssueBoards(pid any, opt *ListIssueBoardsOption return is, resp, nil } -// GetIssueBoard gets a single issue board of a project. -// -// GitLab API docs: https://docs.gitlab.com/api/boards/#show-a-single-issue-board func (s *IssueBoardsService) GetIssueBoard(pid any, board int64, options ...RequestOptionFunc) (*IssueBoard, *Response, error) { project, err := parseID(pid) if err != nil { @@ -241,10 +277,6 @@ type GetIssueBoardListsOptions struct { ListOptions } -// 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 func (s *IssueBoardsService) GetIssueBoardLists(pid any, board int64, opt *GetIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { project, err := parseID(pid) if err != nil { @@ -266,9 +298,6 @@ func (s *IssueBoardsService) GetIssueBoardLists(pid any, board int64, opt *GetIs return bl, resp, nil } -// GetIssueBoardList gets a single issue board list. -// -// GitLab API docs: https://docs.gitlab.com/api/boards/#show-a-single-board-list func (s *IssueBoardsService) GetIssueBoardList(pid any, board, list int64, options ...RequestOptionFunc) (*BoardList, *Response, error) { project, err := parseID(pid) if err != nil { @@ -305,9 +334,6 @@ type CreateIssueBoardListOptions struct { IterationID *int64 `url:"iteration_id,omitempty" json:"iteration_id,omitempty"` } -// CreateIssueBoardList creates a new issue board list. -// -// GitLab API docs: https://docs.gitlab.com/api/boards/#create-a-board-list func (s *IssueBoardsService) CreateIssueBoardList(pid any, board int64, opt *CreateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) { project, err := parseID(pid) if err != nil { @@ -337,9 +363,6 @@ type UpdateIssueBoardListOptions struct { Position *int64 `url:"position" json:"position"` } -// 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 func (s *IssueBoardsService) UpdateIssueBoardList(pid any, board, list int64, opt *UpdateIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) { project, err := parseID(pid) if err != nil { @@ -365,11 +388,6 @@ func (s *IssueBoardsService) UpdateIssueBoardList(pid any, board, list int64, op return bl, resp, nil } -// 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 func (s *IssueBoardsService) DeleteIssueBoardList(pid any, board, list int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { diff --git a/branches.go b/branches.go index 1c753b17..340d267f 100644 --- a/branches.go +++ b/branches.go @@ -24,10 +24,34 @@ import ( type ( BranchesServiceInterface interface { + // ListBranches gets a list of repository branches from a project, sorted by name alphabetically. + // + // GitLab API docs: + // https://docs.gitlab.com/api/branches/#list-repository-branches ListBranches(pid any, opts *ListBranchesOptions, options ...RequestOptionFunc) ([]*Branch, *Response, error) + + // GetBranch gets a single project repository branch. + // + // GitLab API docs: + // https://docs.gitlab.com/api/branches/#get-single-repository-branch GetBranch(pid any, branch string, options ...RequestOptionFunc) (*Branch, *Response, error) + + // CreateBranch creates branch from commit SHA or existing branch. + // + // GitLab API docs: + // https://docs.gitlab.com/api/branches/#create-repository-branch CreateBranch(pid any, opt *CreateBranchOptions, options ...RequestOptionFunc) (*Branch, *Response, error) + + // DeleteBranch deletes an existing branch. + // + // GitLab API docs: + // https://docs.gitlab.com/api/branches/#delete-repository-branch DeleteBranch(pid any, branch string, options ...RequestOptionFunc) (*Response, error) + + // DeleteMergedBranches deletes all branches that are merged into the project's default branch. + // + // GitLab API docs: + // https://docs.gitlab.com/api/branches/#delete-merged-branches DeleteMergedBranches(pid any, options ...RequestOptionFunc) (*Response, error) } @@ -71,11 +95,6 @@ type ListBranchesOptions struct { Regex *string `url:"regex,omitempty" json:"regex,omitempty"` } -// ListBranches gets a list of repository branches from a project, sorted by -// name alphabetically. -// -// GitLab API docs: -// https://docs.gitlab.com/api/branches/#list-repository-branches func (s *BranchesService) ListBranches(pid any, opts *ListBranchesOptions, options ...RequestOptionFunc) ([]*Branch, *Response, error) { project, err := parseID(pid) if err != nil { @@ -97,10 +116,6 @@ func (s *BranchesService) ListBranches(pid any, opts *ListBranchesOptions, optio return b, resp, nil } -// GetBranch gets a single project repository branch. -// -// GitLab API docs: -// https://docs.gitlab.com/api/branches/#get-single-repository-branch func (s *BranchesService) GetBranch(pid any, branch string, options ...RequestOptionFunc) (*Branch, *Response, error) { project, err := parseID(pid) if err != nil { @@ -131,10 +146,6 @@ type CreateBranchOptions struct { Ref *string `url:"ref,omitempty" json:"ref,omitempty"` } -// CreateBranch creates branch from commit SHA or existing branch. -// -// GitLab API docs: -// https://docs.gitlab.com/api/branches/#create-repository-branch func (s *BranchesService) CreateBranch(pid any, opt *CreateBranchOptions, options ...RequestOptionFunc) (*Branch, *Response, error) { project, err := parseID(pid) if err != nil { @@ -156,10 +167,6 @@ func (s *BranchesService) CreateBranch(pid any, opt *CreateBranchOptions, option return b, resp, nil } -// DeleteBranch deletes an existing branch. -// -// GitLab API docs: -// https://docs.gitlab.com/api/branches/#delete-repository-branch func (s *BranchesService) DeleteBranch(pid any, branch string, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -175,10 +182,6 @@ func (s *BranchesService) DeleteBranch(pid any, branch string, options ...Reques return s.client.Do(req, nil) } -// DeleteMergedBranches deletes all branches that are merged into the project's default branch. -// -// GitLab API docs: -// https://docs.gitlab.com/api/branches/#delete-merged-branches func (s *BranchesService) DeleteMergedBranches(pid any, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { diff --git a/broadcast_messages.go b/broadcast_messages.go index 0f0e78aa..6d07be5a 100644 --- a/broadcast_messages.go +++ b/broadcast_messages.go @@ -24,10 +24,34 @@ import ( type ( BroadcastMessagesServiceInterface interface { + // ListBroadcastMessages gets a list of all broadcasted messages. + // + // GitLab API docs: + // https://docs.gitlab.com/api/broadcast_messages/#get-all-broadcast-messages ListBroadcastMessages(opt *ListBroadcastMessagesOptions, options ...RequestOptionFunc) ([]*BroadcastMessage, *Response, error) + + // GetBroadcastMessage gets a single broadcast message. + // + // GitLab API docs: + // https://docs.gitlab.com/api/broadcast_messages/#get-a-specific-broadcast-message GetBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) + + // CreateBroadcastMessage creates a message to broadcast. + // + // GitLab API docs: + // https://docs.gitlab.com/api/broadcast_messages/#create-a-broadcast-message CreateBroadcastMessage(opt *CreateBroadcastMessageOptions, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) + + // UpdateBroadcastMessage updates a broadcasted message. + // + // GitLab API docs: + // https://docs.gitlab.com/api/broadcast_messages/#update-a-broadcast-message 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 int64, options ...RequestOptionFunc) (*Response, error) } @@ -69,10 +93,6 @@ type ListBroadcastMessagesOptions struct { ListOptions } -// ListBroadcastMessages gets a list of all broadcasted messages. -// -// GitLab API docs: -// https://docs.gitlab.com/api/broadcast_messages/#get-all-broadcast-messages func (s *BroadcastMessagesService) ListBroadcastMessages(opt *ListBroadcastMessagesOptions, options ...RequestOptionFunc) ([]*BroadcastMessage, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "broadcast_messages", opt, options) if err != nil { @@ -88,10 +108,6 @@ func (s *BroadcastMessagesService) ListBroadcastMessages(opt *ListBroadcastMessa return bs, resp, nil } -// GetBroadcastMessage gets a single broadcast message. -// -// GitLab API docs: -// https://docs.gitlab.com/api/broadcast_messages/#get-a-specific-broadcast-message func (s *BroadcastMessagesService) GetBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) { u := fmt.Sprintf("broadcast_messages/%d", broadcast) @@ -126,10 +142,6 @@ type CreateBroadcastMessageOptions struct { Theme *string `url:"theme,omitempty" json:"theme,omitempty"` } -// CreateBroadcastMessage creates a message to broadcast. -// -// GitLab API docs: -// https://docs.gitlab.com/api/broadcast_messages/#create-a-broadcast-message func (s *BroadcastMessagesService) CreateBroadcastMessage(opt *CreateBroadcastMessageOptions, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) { req, err := s.client.NewRequest(http.MethodPost, "broadcast_messages", opt, options) if err != nil { @@ -162,10 +174,6 @@ type UpdateBroadcastMessageOptions struct { Theme *string `url:"theme,omitempty" json:"theme,omitempty"` } -// UpdateBroadcastMessage update a broadcasted message. -// -// GitLab API docs: -// https://docs.gitlab.com/api/broadcast_messages/#update-a-broadcast-message func (s *BroadcastMessagesService) UpdateBroadcastMessage(broadcast int64, opt *UpdateBroadcastMessageOptions, options ...RequestOptionFunc) (*BroadcastMessage, *Response, error) { u := fmt.Sprintf("broadcast_messages/%d", broadcast) @@ -183,10 +191,6 @@ func (s *BroadcastMessagesService) UpdateBroadcastMessage(broadcast int64, opt * return b, resp, nil } -// DeleteBroadcastMessage deletes a broadcasted message. -// -// GitLab API docs: -// https://docs.gitlab.com/api/broadcast_messages/#delete-a-broadcast-message func (s *BroadcastMessagesService) DeleteBroadcastMessage(broadcast int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("broadcast_messages/%d", broadcast) diff --git a/bulk_imports.go b/bulk_imports.go index 70464498..73ac2434 100644 --- a/bulk_imports.go +++ b/bulk_imports.go @@ -61,9 +61,6 @@ type BulkImportStartMigrationResponse struct { HasFailures bool `json:"has_failures"` } -// StartMigration starts a migration. -// -// GitLab API docs: https://docs.gitlab.com/api/bulk_imports/#start-a-new-group-or-project-migration func (b *BulkImportsService) StartMigration(startMigrationOptions *BulkImportStartMigrationOptions, options ...RequestOptionFunc) (*BulkImportStartMigrationResponse, *Response, error) { request, err := b.client.NewRequest(http.MethodPost, "bulk_imports", startMigrationOptions, options) if err != nil { diff --git a/ci_yml_templates.go b/ci_yml_templates.go index 430646ba..aa0cb2f9 100644 --- a/ci_yml_templates.go +++ b/ci_yml_templates.go @@ -23,7 +23,16 @@ import ( type ( CIYMLTemplatesServiceInterface interface { + // ListAllTemplates get all GitLab CI YML templates. + // + // GitLab API docs: + // https://docs.gitlab.com/api/templates/gitlab_ci_ymls/#list-gitlab-ci-yaml-templates ListAllTemplates(opt *ListCIYMLTemplatesOptions, options ...RequestOptionFunc) ([]*CIYMLTemplateListItem, *Response, error) + + // GetTemplate get a single GitLab CI YML template. + // + // GitLab API docs: + // https://docs.gitlab.com/api/templates/gitlab_ci_ymls/#single-gitlab-ci-yaml-template GetTemplate(key string, options ...RequestOptionFunc) (*CIYMLTemplate, *Response, error) } @@ -65,10 +74,6 @@ type ListCIYMLTemplatesOptions struct { ListOptions } -// ListAllTemplates get all GitLab CI YML templates. -// -// GitLab API docs: -// https://docs.gitlab.com/api/templates/gitlab_ci_ymls/#list-gitlab-ci-yaml-templates func (s *CIYMLTemplatesService) ListAllTemplates(opt *ListCIYMLTemplatesOptions, options ...RequestOptionFunc) ([]*CIYMLTemplateListItem, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "templates/gitlab_ci_ymls", opt, options) if err != nil { @@ -84,10 +89,6 @@ func (s *CIYMLTemplatesService) ListAllTemplates(opt *ListCIYMLTemplatesOptions, return cts, resp, nil } -// GetTemplate get a single GitLab CI YML template. -// -// GitLab API docs: -// https://docs.gitlab.com/api/templates/gitlab_ci_ymls/#single-gitlab-ci-yaml-template func (s *CIYMLTemplatesService) GetTemplate(key string, options ...RequestOptionFunc) (*CIYMLTemplate, *Response, error) { u := fmt.Sprintf("templates/gitlab_ci_ymls/%s", PathEscape(key)) diff --git a/client_options_test.go b/client_options_test.go new file mode 100644 index 00000000..d57bc141 --- /dev/null +++ b/client_options_test.go @@ -0,0 +1,186 @@ +package gitlab + +import ( + "net/http" + "testing" + "time" + + "github.com/hashicorp/go-retryablehttp" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestWithBaseURL(t *testing.T) { + t.Parallel() + + // GIVEN a new GitLab client + client, err := NewClient("") + require.NoError(t, err) + customURL := "https://example.com/api/v4/" + + // WHEN the WithBaseURL option is applied + opt := WithBaseURL(customURL) + err = opt(client) + require.NoError(t, err) + + // THEN the client's base URL is updated + assert.Equal(t, customURL, client.BaseURL().String()) +} + +func TestWithHTTPClient(t *testing.T) { + t.Parallel() + + // GIVEN a new GitLab client + client, err := NewClient("") + require.NoError(t, err) + customClient := &http.Client{ + Timeout: 30 * time.Second, + } + + // WHEN the WithHTTPClient option is applied + opt := WithHTTPClient(customClient) + err = opt(client) + require.NoError(t, err) + + // THEN the client's internal HTTP client is replaced + assert.Same(t, customClient, client.client.HTTPClient) +} + +func TestWithUserAgent(t *testing.T) { + t.Parallel() + + // GIVEN a new GitLab client + client, err := NewClient("") + require.NoError(t, err) + customUA := "my-custom-agent/1.0" + + // WHEN the WithUserAgent option is applied + opt := WithUserAgent(customUA) + err = opt(client) + require.NoError(t, err) + + // THEN the client's UserAgent string is updated + assert.Equal(t, customUA, client.UserAgent) +} + +func TestWithoutRetries(t *testing.T) { + t.Parallel() + + // GIVEN a new GitLab client with retries enabled by default + client, err := NewClient("") + require.NoError(t, err) + assert.False(t, client.disableRetries, "Retries should be enabled by default") + + // WHEN the WithoutRetries option is applied + opt := WithoutRetries() + err = opt(client) + require.NoError(t, err) + + // THEN the client's retry mechanism is disabled + assert.True(t, client.disableRetries) +} + +func TestWithCustomRetryMax(t *testing.T) { + t.Parallel() + + // GIVEN a new GitLab client + client, err := NewClient("") + require.NoError(t, err) + + // WHEN the WithCustomRetryMax option is applied + opt := WithCustomRetryMax(10) + err = opt(client) + require.NoError(t, err) + + // THEN the client's maximum retry count is updated + assert.Equal(t, 10, client.client.RetryMax) +} + +func TestWithCustomRetryWaitMinMax(t *testing.T) { + t.Parallel() + + // GIVEN a new GitLab client + client, err := NewClient("") + require.NoError(t, err) + minWait := 1 * time.Second + maxWait := 30 * time.Second + + // WHEN the WithCustomRetryWaitMinMax option is applied + opt := WithCustomRetryWaitMinMax(minWait, maxWait) + err = opt(client) + require.NoError(t, err) + + // THEN the client's retry wait times are updated + assert.Equal(t, minWait, client.client.RetryWaitMin) + assert.Equal(t, maxWait, client.client.RetryWaitMax) +} + +func TestWithRequestOptions(t *testing.T) { + t.Parallel() + + // GIVEN a new GitLab client and a default request option + mux, client := setup(t) + var testHeader string + ro := func(req *retryablehttp.Request) error { + testHeader = "was-set" + return nil + } + + // WHEN the WithRequestOptions option is applied and a request is made + opt := WithRequestOptions(ro) + err := opt(client) + require.NoError(t, err) + require.Len(t, client.defaultRequestOptions, 1) + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + }) + + req, err := client.NewRequest(http.MethodGet, "/", nil, nil) + require.NoError(t, err) + _, err = client.Do(req, nil) + require.NoError(t, err) + + // THEN the default request option is executed + assert.Equal(t, "was-set", testHeader) +} + +func TestClientWithInterceptor(t *testing.T) { + t.Parallel() + + t.Run("should add valid interceptor", func(t *testing.T) { + t.Parallel() + + // GIVEN a new GitLab client and a valid interceptor + client, err := NewClient("") + require.NoError(t, err) + ic := func(req http.RoundTripper) http.RoundTripper { + return nil + } + + // WHEN the WithInterceptor option is applied + opt := WithInterceptor(ic) + err = opt(client) + require.NoError(t, err) + + // THEN the interceptor is added to the client + assert.Len(t, client.interceptors, 1) + }) + + t.Run("should return error for nil interceptor", func(t *testing.T) { + t.Parallel() + + // GIVEN a new GitLab client + client, err := NewClient("") + require.NoError(t, err) + + // WHEN the WithInterceptor option is applied with a nil value + optNil := WithInterceptor(nil) + err = optNil(client) + + // THEN an error is returned and no interceptor is added + require.Error(t, err) + assert.Equal(t, "interceptor cannot be nil", err.Error()) + assert.Empty(t, client.interceptors, "Nil interceptor should not be added") + }) +} diff --git a/cluster_agents.go b/cluster_agents.go index 6eaeac49..0d6abc20 100644 --- a/cluster_agents.go +++ b/cluster_agents.go @@ -24,13 +24,52 @@ 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(pid any, opt *ListAgentsOptions, options ...RequestOptionFunc) ([]*Agent, *Response, error) + + // GetAgent gets a single agent details. + // + // GitLab API docs: + // https://docs.gitlab.com/api/cluster_agents/#get-details-about-an-agent GetAgent(pid any, id int64, options ...RequestOptionFunc) (*Agent, *Response, error) + + // RegisterAgent registers an agent to the project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/cluster_agents/#register-an-agent-with-a-project RegisterAgent(pid any, opt *RegisterAgentOptions, options ...RequestOptionFunc) (*Agent, *Response, error) + + // DeleteAgent deletes an existing agent registration. + // + // GitLab API docs: + // https://docs.gitlab.com/api/cluster_agents/#delete-a-registered-agent 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 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 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 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 int64, id int64, options ...RequestOptionFunc) (*Response, error) } @@ -98,10 +137,6 @@ type ListAgentsOptions struct { ListOptions } -// 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 func (s *ClusterAgentsService) ListAgents(pid any, opt *ListAgentsOptions, options ...RequestOptionFunc) ([]*Agent, *Response, error) { project, err := parseID(pid) if err != nil { @@ -123,10 +158,6 @@ func (s *ClusterAgentsService) ListAgents(pid any, opt *ListAgentsOptions, optio return as, resp, nil } -// GetAgent gets a single agent details. -// -// GitLab API docs: -// https://docs.gitlab.com/api/cluster_agents/#get-details-about-an-agent func (s *ClusterAgentsService) GetAgent(pid any, id int64, options ...RequestOptionFunc) (*Agent, *Response, error) { project, err := parseID(pid) if err != nil { @@ -157,10 +188,6 @@ type RegisterAgentOptions struct { Name *string `url:"name,omitempty" json:"name,omitempty"` } -// RegisterAgent registers an agent to the project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/cluster_agents/#register-an-agent-with-a-project func (s *ClusterAgentsService) RegisterAgent(pid any, opt *RegisterAgentOptions, options ...RequestOptionFunc) (*Agent, *Response, error) { project, err := parseID(pid) if err != nil { @@ -182,10 +209,6 @@ func (s *ClusterAgentsService) RegisterAgent(pid any, opt *RegisterAgentOptions, return a, resp, nil } -// DeleteAgent deletes an existing agent registration. -// -// GitLab API docs: -// https://docs.gitlab.com/api/cluster_agents/#delete-a-registered-agent func (s *ClusterAgentsService) DeleteAgent(pid any, id int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -209,10 +232,6 @@ type ListAgentTokensOptions struct { ListOptions } -// ListAgentTokens returns a list of tokens for an agent. -// -// GitLab API docs: -// https://docs.gitlab.com/api/cluster_agents/#list-tokens-for-an-agent func (s *ClusterAgentsService) ListAgentTokens(pid any, aid int64, opt *ListAgentTokensOptions, options ...RequestOptionFunc) ([]*AgentToken, *Response, error) { project, err := parseID(pid) if err != nil { @@ -234,10 +253,6 @@ func (s *ClusterAgentsService) ListAgentTokens(pid any, aid int64, opt *ListAgen return ats, resp, nil } -// GetAgentToken gets a single agent token. -// -// GitLab API docs: -// https://docs.gitlab.com/api/cluster_agents/#get-a-single-agent-token func (s *ClusterAgentsService) GetAgentToken(pid any, aid int64, id int64, options ...RequestOptionFunc) (*AgentToken, *Response, error) { project, err := parseID(pid) if err != nil { @@ -268,10 +283,6 @@ type CreateAgentTokenOptions struct { Description *string `url:"description,omitempty" json:"description,omitempty"` } -// CreateAgentToken creates a new token for an agent. -// -// GitLab API docs: -// https://docs.gitlab.com/api/cluster_agents/#create-an-agent-token func (s *ClusterAgentsService) CreateAgentToken(pid any, aid int64, opt *CreateAgentTokenOptions, options ...RequestOptionFunc) (*AgentToken, *Response, error) { project, err := parseID(pid) if err != nil { @@ -293,10 +304,6 @@ func (s *ClusterAgentsService) CreateAgentToken(pid any, aid int64, opt *CreateA return at, resp, nil } -// RevokeAgentToken revokes an agent token. -// -// GitLab API docs: -// https://docs.gitlab.com/api/cluster_agents/#revoke-an-agent-token func (s *ClusterAgentsService) RevokeAgentToken(pid any, aid int64, id int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { diff --git a/cluster_agents_test.go b/cluster_agents_test.go index 3151d09c..749b0f3c 100644 --- a/cluster_agents_test.go +++ b/cluster_agents_test.go @@ -25,6 +25,8 @@ import ( ) func TestListClusterAgents(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/cluster_agents", func(w http.ResponseWriter, r *http.Request) { @@ -110,6 +112,8 @@ func TestListClusterAgents(t *testing.T) { } func TestGetClusterAgent(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/cluster_agents/1", func(w http.ResponseWriter, r *http.Request) { @@ -159,6 +163,8 @@ func TestGetClusterAgent(t *testing.T) { } func TestRegisterClusterAgent(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/cluster_agents", func(w http.ResponseWriter, r *http.Request) { @@ -209,6 +215,8 @@ func TestRegisterClusterAgent(t *testing.T) { } func TestListAgentTokens(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/cluster_agents/5/tokens", func(w http.ResponseWriter, r *http.Request) { @@ -270,6 +278,8 @@ func TestListAgentTokens(t *testing.T) { } func TestGetAgentToken(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/cluster_agents/5/tokens/1", func(w http.ResponseWriter, r *http.Request) { @@ -309,6 +319,8 @@ func TestGetAgentToken(t *testing.T) { } func TestRegisterAgentToken(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/cluster_agents/5/tokens", func(w http.ResponseWriter, r *http.Request) { diff --git a/commits.go b/commits.go index 5a158619..6e1251c5 100644 --- a/commits.go +++ b/commits.go @@ -29,18 +29,85 @@ import ( // GitLab API docs: https://docs.gitlab.com/api/commits/ type ( CommitsServiceInterface interface { + // ListCommits gets a list of repository commits in a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#list-repository-commits ListCommits(pid any, opt *ListCommitsOptions, options ...RequestOptionFunc) ([]*Commit, *Response, error) + + // GetCommitRefs gets all references (from branches or tags) a commit is pushed to. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#get-references-a-commit-is-pushed-to GetCommitRefs(pid any, sha string, opt *GetCommitRefsOptions, options ...RequestOptionFunc) ([]*CommitRef, *Response, error) + + // GetCommit gets a specific commit identified by the commit hash or name of a + // branch or tag. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#get-a-single-commit GetCommit(pid any, sha string, opt *GetCommitOptions, options ...RequestOptionFunc) (*Commit, *Response, error) + + // CreateCommit creates a commit with multiple files and actions. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#create-a-commit-with-multiple-files-and-actions CreateCommit(pid any, opt *CreateCommitOptions, options ...RequestOptionFunc) (*Commit, *Response, error) + + // GetCommitDiff gets the diff of a commit in a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#get-the-diff-of-a-commit GetCommitDiff(pid any, sha string, opt *GetCommitDiffOptions, options ...RequestOptionFunc) ([]*Diff, *Response, error) + + // GetCommitComments gets the comments of a commit in a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#get-the-comments-of-a-commit GetCommitComments(pid any, sha string, opt *GetCommitCommentsOptions, options ...RequestOptionFunc) ([]*CommitComment, *Response, error) + + // PostCommitComment adds a comment to a commit. Optionally you can post + // comments on a specific line of a commit. Therefore both path, line_new and + // line_old are required. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#post-comment-to-commit PostCommitComment(pid any, sha string, opt *PostCommitCommentOptions, options ...RequestOptionFunc) (*CommitComment, *Response, error) + + // GetCommitStatuses gets the statuses of a commit in a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#list-the-statuses-of-a-commit GetCommitStatuses(pid any, sha string, opt *GetCommitStatusesOptions, options ...RequestOptionFunc) ([]*CommitStatus, *Response, error) + + // SetCommitStatus sets the status of a commit in a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#set-the-pipeline-status-of-a-commit SetCommitStatus(pid any, sha string, opt *SetCommitStatusOptions, options ...RequestOptionFunc) (*CommitStatus, *Response, error) + + // ListMergeRequestsByCommit gets merge request associated with a commit. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#list-merge-requests-associated-with-a-commit ListMergeRequestsByCommit(pid any, sha string, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) + + // CherryPickCommit cherry picks a commit to a given branch. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#cherry-pick-a-commit CherryPickCommit(pid any, sha string, opt *CherryPickCommitOptions, options ...RequestOptionFunc) (*Commit, *Response, error) + + // RevertCommit reverts a commit in a given branch. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#revert-a-commit RevertCommit(pid any, sha string, opt *RevertCommitOptions, options ...RequestOptionFunc) (*Commit, *Response, error) + + // GetGPGSignature gets a GPG signature of a commit. + // + // GitLab API docs: + // https://docs.gitlab.com/api/commits/#get-signature-of-a-commit GetGPGSignature(pid any, sha string, options ...RequestOptionFunc) (*GPGSignature, *Response, error) } @@ -109,9 +176,6 @@ type ListCommitsOptions struct { Trailers *bool `url:"trailers,omitempty" json:"trailers,omitempty"` } -// ListCommits gets a list of repository commits in a project. -// -// GitLab API docs: https://docs.gitlab.com/api/commits/#list-repository-commits func (s *CommitsService) ListCommits(pid any, opt *ListCommitsOptions, options ...RequestOptionFunc) ([]*Commit, *Response, error) { project, err := parseID(pid) if err != nil { @@ -151,10 +215,6 @@ type GetCommitRefsOptions struct { Type *string `url:"type,omitempty" json:"type,omitempty"` } -// GetCommitRefs gets all references (from branches or tags) a commit is pushed to -// -// GitLab API docs: -// https://docs.gitlab.com/api/commits/#get-references-a-commit-is-pushed-to func (s *CommitsService) GetCommitRefs(pid any, sha string, opt *GetCommitRefsOptions, options ...RequestOptionFunc) ([]*CommitRef, *Response, error) { project, err := parseID(pid) if err != nil { @@ -184,10 +244,6 @@ type GetCommitOptions struct { Stats *bool `url:"stats,omitempty" json:"stats,omitempty"` } -// GetCommit gets a specific commit identified by the commit hash or name of a -// branch or tag. -// -// GitLab API docs: https://docs.gitlab.com/api/commits/#get-a-single-commit func (s *CommitsService) GetCommit(pid any, sha string, opt *GetCommitOptions, options ...RequestOptionFunc) (*Commit, *Response, error) { project, err := parseID(pid) if err != nil { @@ -242,9 +298,6 @@ type CommitActionOptions struct { ExecuteFilemode *bool `url:"execute_filemode,omitempty" json:"execute_filemode,omitempty"` } -// CreateCommit creates a commit with multiple files and actions. -// -// GitLab API docs: https://docs.gitlab.com/api/commits/#create-a-commit-with-multiple-files-and-actions func (s *CommitsService) CreateCommit(pid any, opt *CreateCommitOptions, options ...RequestOptionFunc) (*Commit, *Response, error) { project, err := parseID(pid) if err != nil { @@ -293,10 +346,6 @@ type GetCommitDiffOptions struct { Unidiff *bool `url:"unidiff,omitempty" json:"unidiff,omitempty"` } -// GetCommitDiff gets the diff of a commit in a project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/commits/#get-the-diff-of-a-commit func (s *CommitsService) GetCommitDiff(pid any, sha string, opt *GetCommitDiffOptions, options ...RequestOptionFunc) ([]*Diff, *Response, error) { project, err := parseID(pid) if err != nil { @@ -352,10 +401,6 @@ type GetCommitCommentsOptions struct { ListOptions } -// GetCommitComments gets the comments of a commit in a project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/commits/#get-the-comments-of-a-commit func (s *CommitsService) GetCommitComments(pid any, sha string, opt *GetCommitCommentsOptions, options ...RequestOptionFunc) ([]*CommitComment, *Response, error) { project, err := parseID(pid) if err != nil { @@ -389,12 +434,6 @@ type PostCommitCommentOptions struct { LineType *string `url:"line_type" json:"line_type"` } -// PostCommitComment adds a comment to a commit. Optionally you can post -// comments on a specific line of a commit. Therefor both path, line_new and -// line_old are required. -// -// GitLab API docs: -// https://docs.gitlab.com/api/commits/#post-comment-to-commit func (s *CommitsService) PostCommitComment(pid any, sha string, opt *PostCommitCommentOptions, options ...RequestOptionFunc) (*CommitComment, *Response, error) { project, err := parseID(pid) if err != nil { @@ -448,9 +487,6 @@ type CommitStatus struct { TargetURL string `json:"target_url"` } -// GetCommitStatuses gets the statuses of a commit in a project. -// -// GitLab API docs: https://docs.gitlab.com/api/commits/#list-the-statuses-of-a-commit func (s *CommitsService) GetCommitStatuses(pid any, sha string, opt *GetCommitStatusesOptions, options ...RequestOptionFunc) ([]*CommitStatus, *Response, error) { project, err := parseID(pid) if err != nil { @@ -486,9 +522,6 @@ type SetCommitStatusOptions struct { PipelineID *int `url:"pipeline_id,omitempty" json:"pipeline_id,omitempty"` } -// SetCommitStatus sets the status of a commit in a project. -// -// GitLab API docs: https://docs.gitlab.com/api/commits/#set-the-pipeline-status-of-a-commit func (s *CommitsService) SetCommitStatus(pid any, sha string, opt *SetCommitStatusOptions, options ...RequestOptionFunc) (*CommitStatus, *Response, error) { project, err := parseID(pid) if err != nil { @@ -510,10 +543,6 @@ func (s *CommitsService) SetCommitStatus(pid any, sha string, opt *SetCommitStat return cs, resp, nil } -// ListMergeRequestsByCommit gets merge request associated with a commit. -// -// GitLab API docs: -// https://docs.gitlab.com/api/commits/#list-merge-requests-associated-with-a-commit func (s *CommitsService) ListMergeRequestsByCommit(pid any, sha string, options ...RequestOptionFunc) ([]*BasicMergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { @@ -544,9 +573,6 @@ type CherryPickCommitOptions struct { Message *string `url:"message,omitempty" json:"message,omitempty"` } -// CherryPickCommit cherry picks a commit to a given branch. -// -// GitLab API docs: https://docs.gitlab.com/api/commits/#cherry-pick-a-commit func (s *CommitsService) CherryPickCommit(pid any, sha string, opt *CherryPickCommitOptions, options ...RequestOptionFunc) (*Commit, *Response, error) { project, err := parseID(pid) if err != nil { @@ -575,9 +601,6 @@ type RevertCommitOptions struct { Branch *string `url:"branch,omitempty" json:"branch,omitempty"` } -// RevertCommit reverts a commit in a given branch. -// -// GitLab API docs: https://docs.gitlab.com/api/commits/#revert-a-commit func (s *CommitsService) RevertCommit(pid any, sha string, opt *RevertCommitOptions, options ...RequestOptionFunc) (*Commit, *Response, error) { project, err := parseID(pid) if err != nil { @@ -612,9 +635,6 @@ type GPGSignature struct { KeySubkeyID int `json:"gpg_key_subkey_id"` } -// GetGPGSignature gets a GPG signature of a commit. -// -// GitLab API docs: https://docs.gitlab.com/api/commits/#get-signature-of-a-commit func (s *CommitsService) GetGPGSignature(pid any, sha string, options ...RequestOptionFunc) (*GPGSignature, *Response, error) { project, err := parseID(pid) if err != nil { diff --git a/config/config_test.go b/config/config_test.go index 50e164e5..ff8440c3 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -11,6 +11,8 @@ import ( ) func TestConfig_EmptyConfig(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(``) @@ -20,6 +22,8 @@ func TestConfig_EmptyConfig(t *testing.T) { } func TestConfig_SingleInstance_Valid(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -38,6 +42,8 @@ func TestConfig_SingleInstance_Valid(t *testing.T) { } func TestConfig_SingleInstance_Invalid_Name(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -51,6 +57,8 @@ func TestConfig_SingleInstance_Invalid_Name(t *testing.T) { } func TestConfig_MultipleInstances_Valid(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -73,6 +81,8 @@ func TestConfig_MultipleInstances_Valid(t *testing.T) { } func TestConfig_MultipleInstances_Invalid_NotUniqueNames(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -88,6 +98,8 @@ func TestConfig_MultipleInstances_Invalid_NotUniqueNames(t *testing.T) { } func TestConfig_Contexts_Valid(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -120,6 +132,8 @@ func TestConfig_Contexts_Valid(t *testing.T) { } func TestConfig_Auths_Valid(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -148,6 +162,8 @@ func TestConfig_Auths_Valid(t *testing.T) { } func TestConfig_Auths_Invalid_Name(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -163,6 +179,8 @@ func TestConfig_Auths_Invalid_Name(t *testing.T) { } func TestConfig_Auths_Invalid_NotUniqueNames(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -182,6 +200,8 @@ func TestConfig_Auths_Invalid_NotUniqueNames(t *testing.T) { } func TestConfig_Contexts_Invalid_Name(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -206,6 +226,8 @@ func TestConfig_Contexts_Invalid_Name(t *testing.T) { } func TestConfig_Contexts_Invalid_NotUniqueNames(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -233,6 +255,8 @@ func TestConfig_Contexts_Invalid_NotUniqueNames(t *testing.T) { } func TestConfig_Contexts_Invalid_UnknownInstance(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -257,6 +281,8 @@ func TestConfig_Contexts_Invalid_UnknownInstance(t *testing.T) { } func TestConfig_Contexts_Invalid_UnknownAuth(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -281,6 +307,8 @@ func TestConfig_Contexts_Invalid_UnknownAuth(t *testing.T) { } func TestConfig_CurrentContext_Invalid_Unknown(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -307,6 +335,8 @@ func TestConfig_CurrentContext_Invalid_Unknown(t *testing.T) { } func TestConfig_Instance_Valid(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -332,6 +362,8 @@ func TestConfig_Instance_Valid(t *testing.T) { } func TestConfig_Instance_NotFound(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -348,6 +380,8 @@ func TestConfig_Instance_NotFound(t *testing.T) { } func TestConfig_Auth_Valid(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -375,6 +409,8 @@ func TestConfig_Auth_Valid(t *testing.T) { } func TestConfig_Auth_NotFound(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -393,6 +429,8 @@ func TestConfig_Auth_NotFound(t *testing.T) { } func TestConfig_CurrentContext_Valid(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -425,6 +463,8 @@ func TestConfig_CurrentContext_Valid(t *testing.T) { } func TestConfig_CurrentContext_NotSet(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -452,6 +492,8 @@ func TestConfig_CurrentContext_NotSet(t *testing.T) { } func TestConfig_Empty_ReturnsEmptyConfig(t *testing.T) { + t.Parallel() + // WHEN c := Empty() @@ -464,6 +506,8 @@ func TestConfig_Empty_ReturnsEmptyConfig(t *testing.T) { } func TestConfig_PersonalAccessToken_TokenSource_EnvVar(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -486,6 +530,8 @@ func TestConfig_PersonalAccessToken_TokenSource_EnvVar(t *testing.T) { } func TestConfig_JobToken_TokenSource_EnvVar(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -508,6 +554,8 @@ func TestConfig_JobToken_TokenSource_EnvVar(t *testing.T) { } func TestConfig_BasicAuth_Valid(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -530,6 +578,8 @@ func TestConfig_BasicAuth_Valid(t *testing.T) { } func TestConfig_BasicAuth_WithSources(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -556,6 +606,8 @@ func TestConfig_BasicAuth_WithSources(t *testing.T) { } func TestConfig_OAuth2_Valid(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -580,6 +632,8 @@ func TestConfig_OAuth2_Valid(t *testing.T) { } func TestConfig_Instance_WithRateLimit(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -602,6 +656,8 @@ func TestConfig_Instance_WithRateLimit(t *testing.T) { } func TestConfig_Instance_WithTLSConfig(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -631,6 +687,8 @@ func TestConfig_Instance_WithTLSConfig(t *testing.T) { } func TestConfig_Instance_WithAPIVersion(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -650,6 +708,8 @@ func TestConfig_Instance_WithAPIVersion(t *testing.T) { } func TestConfig_Preferences_Valid(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` preferences: @@ -672,6 +732,8 @@ func TestConfig_Preferences_Valid(t *testing.T) { // Additional tests for increased coverage func TestConfig_New_WithOptions(t *testing.T) { + t.Parallel() + // WHEN c := New(WithPath("/test/path")) @@ -681,6 +743,8 @@ func TestConfig_New_WithOptions(t *testing.T) { } func TestConfig_NewFromPath_WithOptions(t *testing.T) { + t.Parallel() + // WHEN c := NewFromPath("/custom/path", WithPath("/override/path")) @@ -690,6 +754,8 @@ func TestConfig_NewFromPath_WithOptions(t *testing.T) { } func TestConfig_NewFromString_WithOptions(t *testing.T) { + t.Parallel() + // GIVEN testValidator := func(c *v1beta1.Config) error { return nil @@ -705,6 +771,8 @@ func TestConfig_NewFromString_WithOptions(t *testing.T) { } func TestConfig_Load_FileNotFound(t *testing.T) { + t.Parallel() + // GIVEN c := NewFromPath("/non/existent/path") @@ -717,6 +785,8 @@ func TestConfig_Load_FileNotFound(t *testing.T) { } func TestConfig_Load_EmptyPath(t *testing.T) { + t.Parallel() + // GIVEN c := NewFromPath("") @@ -729,6 +799,8 @@ func TestConfig_Load_EmptyPath(t *testing.T) { } func TestConfig_Save_EmptyPath(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(``) require.NoError(t, err) @@ -742,6 +814,8 @@ func TestConfig_Save_EmptyPath(t *testing.T) { } func TestConfig_Save_NilConfig(t *testing.T) { + t.Parallel() + // GIVEN c := NewFromPath("/test/path") @@ -754,6 +828,8 @@ func TestConfig_Save_NilConfig(t *testing.T) { } func TestConfig_Instance_WithCertificateAuthorityFile(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -773,6 +849,8 @@ func TestConfig_Instance_WithCertificateAuthorityFile(t *testing.T) { } func TestConfig_Instance_WithClientCertificates(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -795,6 +873,8 @@ func TestConfig_Instance_WithClientCertificates(t *testing.T) { } func TestConfig_PersonalAccessToken_TokenSource_File(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -817,6 +897,8 @@ func TestConfig_PersonalAccessToken_TokenSource_File(t *testing.T) { } func TestConfig_PersonalAccessToken_TokenSource_Keyring(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -843,6 +925,8 @@ func TestConfig_PersonalAccessToken_TokenSource_Keyring(t *testing.T) { } func TestConfig_PersonalAccessToken_TokenSource_Exec(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -869,6 +953,8 @@ func TestConfig_PersonalAccessToken_TokenSource_Exec(t *testing.T) { } func TestConfig_PersonalAccessToken_TokenSource_Value(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -891,6 +977,8 @@ func TestConfig_PersonalAccessToken_TokenSource_Value(t *testing.T) { } func TestConfig_OAuth2_WithTokenSources(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -923,6 +1011,8 @@ func TestConfig_OAuth2_WithTokenSources(t *testing.T) { } func TestConfig_Contexts_Valid_Multiple(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -971,6 +1061,8 @@ func TestConfig_Contexts_Valid_Multiple(t *testing.T) { } func TestConfig_Instance_Invalid_ServerURL(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -984,6 +1076,8 @@ func TestConfig_Instance_Invalid_ServerURL(t *testing.T) { } func TestConfig_Auths_Invalid_EmptyAuthInfo(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` auths: @@ -997,6 +1091,8 @@ func TestConfig_Auths_Invalid_EmptyAuthInfo(t *testing.T) { } func TestConfig_DefaultConfigPath_ReturnsPath(t *testing.T) { + t.Parallel() + // WHEN path := DefaultConfigPath() @@ -1006,6 +1102,8 @@ func TestConfig_DefaultConfigPath_ReturnsPath(t *testing.T) { } func TestConfig_Constants(t *testing.T) { + t.Parallel() + // THEN assert.Equal(t, "gitlab.com", SaaSHostname) assert.Equal(t, "config.yaml", DefaultConfigFileName) @@ -1016,6 +1114,8 @@ func TestConfig_Constants(t *testing.T) { } func TestConfig_Instance_WithAllFields(t *testing.T) { + t.Parallel() + // WHEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1072,6 +1172,8 @@ func TestConfig_Instance_WithAllFields(t *testing.T) { } func TestConfig_NilConfig_Methods(t *testing.T) { + t.Parallel() + // GIVEN c := &Config{} // nil config @@ -1085,6 +1187,8 @@ func TestConfig_NilConfig_Methods(t *testing.T) { } func TestConfig_NewClientForContext_Success_PersonalAccessToken(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1113,6 +1217,8 @@ func TestConfig_NewClientForContext_Success_PersonalAccessToken(t *testing.T) { } func TestConfig_NewClientForContext_Success_JobToken(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1141,6 +1247,8 @@ func TestConfig_NewClientForContext_Success_JobToken(t *testing.T) { } func TestConfig_NewClientForContext_Success_BasicAuth(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1170,6 +1278,8 @@ func TestConfig_NewClientForContext_Success_BasicAuth(t *testing.T) { } func TestConfig_NewClientForContext_Error_ContextNotFound(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1199,6 +1309,8 @@ func TestConfig_NewClientForContext_Error_ContextNotFound(t *testing.T) { } func TestConfig_NewClientForContext_Error_AuthNotFound(t *testing.T) { + t.Parallel() + // GIVEN - This test should use a valid config first, then test runtime error c, err := NewFromString(heredoc.Doc(` instances: @@ -1231,6 +1343,8 @@ func TestConfig_NewClientForContext_Error_AuthNotFound(t *testing.T) { } func TestConfig_NewClientForContext_Success_WithRateLimit(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1262,6 +1376,8 @@ func TestConfig_NewClientForContext_Success_WithRateLimit(t *testing.T) { } func TestConfig_NewClientForContext_Success_WithRetryConfig(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` preferences: @@ -1295,6 +1411,8 @@ func TestConfig_NewClientForContext_Success_WithRetryConfig(t *testing.T) { } func TestConfig_NewClientForContext_Success_WithAPIVersion(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1325,6 +1443,8 @@ func TestConfig_NewClientForContext_Success_WithAPIVersion(t *testing.T) { } func TestConfig_NewClientForContext_Success_WithTLSConfig(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1462,6 +1582,8 @@ func TestConfig_NewClientForContext_Success_BasicAuthFromEnv(t *testing.T) { } func TestConfig_NewClientForContext_Success_GitLabSaaS(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1490,6 +1612,8 @@ func TestConfig_NewClientForContext_Success_GitLabSaaS(t *testing.T) { } func TestConfig_NewClientForContext_Success_WithClientCertificates(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1566,6 +1690,8 @@ func TestConfig_NewClientForContext_Success_WithClientCertificates(t *testing.T) } func TestConfig_NewClientForContext_Error_MissingEnvVar(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1596,6 +1722,8 @@ func TestConfig_NewClientForContext_Error_MissingEnvVar(t *testing.T) { } func TestConfig_NewClientForContext_Success_WithCustomAPIPath(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1624,6 +1752,8 @@ func TestConfig_NewClientForContext_Success_WithCustomAPIPath(t *testing.T) { } func TestConfig_NewClientForContext_Success_WithTokenFromValue(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1653,6 +1783,8 @@ func TestConfig_NewClientForContext_Success_WithTokenFromValue(t *testing.T) { } func TestConfig_NewClientForContext_Error_InvalidCertificateData(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1684,6 +1816,8 @@ func TestConfig_NewClientForContext_Error_InvalidCertificateData(t *testing.T) { } func TestConfig_NewClientForContext_Error_MismatchedCertificateAndKey(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: @@ -1762,6 +1896,8 @@ func TestConfig_NewClientForContext_Error_MismatchedCertificateAndKey(t *testing } func TestConfig_NewClientForContext_Success_CustomHeaderLiteral(t *testing.T) { + t.Parallel() + // GIVEN c, err := NewFromString(heredoc.Doc(` instances: diff --git a/config/extensions_test.go b/config/extensions_test.go index 84df965f..a96bbbf0 100644 --- a/config/extensions_test.go +++ b/config/extensions_test.go @@ -14,6 +14,8 @@ type testExtension struct { } func TestExtensions_Unmarshal(t *testing.T) { + t.Parallel() + // GIVEN cfg, err := NewFromString(heredoc.Doc(` version: gitlab.com/config/v1beta1 @@ -55,6 +57,8 @@ func TestExtensions_Unmarshal(t *testing.T) { } func TestExtensions_Marshal(t *testing.T) { + t.Parallel() + // GIVEN cfg, err := NewFromString(heredoc.Doc(` version: gitlab.com/config/v1beta1 @@ -99,6 +103,8 @@ func TestExtensions_Marshal(t *testing.T) { } func TestExtensions_Marshal_NewExtension(t *testing.T) { + t.Parallel() + // GIVEN cfg, err := NewFromString(heredoc.Doc(` version: gitlab.com/config/v1beta1 @@ -138,6 +144,8 @@ func TestExtensions_Marshal_NewExtension(t *testing.T) { } func TestExtensions_Unmarshal_ForContext(t *testing.T) { + t.Parallel() + // GIVEN cfg, err := NewFromString(heredoc.Doc(` version: gitlab.com/config/v1beta1 @@ -177,6 +185,8 @@ func TestExtensions_Unmarshal_ForContext(t *testing.T) { } func TestExtensions_Marshal_ForContext(t *testing.T) { + t.Parallel() + // GIVEN cfg, err := NewFromString(heredoc.Doc(` version: gitlab.com/config/v1beta1 diff --git a/container_registry.go b/container_registry.go index 06a33e7d..d539d975 100644 --- a/container_registry.go +++ b/container_registry.go @@ -24,13 +24,52 @@ import ( type ( ContainerRegistryServiceInterface interface { + // ListProjectRegistryRepositories gets a list of registry repositories in a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/container_registry/#within-a-project 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 *ListGroupRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) + + // GetSingleRegistryRepository gets the details of single registry repository. + // + // GitLab API docs: + // https://docs.gitlab.com/api/container_registry/#get-details-of-a-single-repository GetSingleRegistryRepository(pid any, opt *GetSingleRegistryRepositoryOptions, options ...RequestOptionFunc) (*RegistryRepository, *Response, error) + + // DeleteRegistryRepository deletes a repository in a registry. + // + // GitLab API docs: + // https://docs.gitlab.com/api/container_registry/#delete-registry-repository 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 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 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 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 int64, opt *DeleteRegistryRepositoryTagsOptions, options ...RequestOptionFunc) (*Response, error) } @@ -104,10 +143,6 @@ type ListGroupRegistryRepositoriesOptions struct { ListOptions } -// ListProjectRegistryRepositories gets a list of registry repositories in a project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/container_registry/#within-a-project func (s *ContainerRegistryService) ListProjectRegistryRepositories(pid any, opt *ListProjectRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) { project, err := parseID(pid) if err != nil { @@ -129,10 +164,6 @@ func (s *ContainerRegistryService) ListProjectRegistryRepositories(pid any, opt return repos, resp, nil } -// ListGroupRegistryRepositories gets a list of registry repositories in a group. -// -// GitLab API docs: -// https://docs.gitlab.com/api/container_registry/#within-a-group func (s *ContainerRegistryService) ListGroupRegistryRepositories(gid any, opt *ListGroupRegistryRepositoriesOptions, options ...RequestOptionFunc) ([]*RegistryRepository, *Response, error) { group, err := parseID(gid) if err != nil { @@ -164,10 +195,6 @@ type GetSingleRegistryRepositoryOptions struct { TagsCount *bool `url:"tags_count,omitempty" json:"tags_count,omitempty"` } -// GetSingleRegistryRepository gets the details of single registry repository. -// -// GitLab API docs: -// https://docs.gitlab.com/api/container_registry/#get-details-of-a-single-repository func (s *ContainerRegistryService) GetSingleRegistryRepository(pid any, opt *GetSingleRegistryRepositoryOptions, options ...RequestOptionFunc) (*RegistryRepository, *Response, error) { project, err := parseID(pid) if err != nil { @@ -189,10 +216,6 @@ func (s *ContainerRegistryService) GetSingleRegistryRepository(pid any, opt *Get return repo, resp, nil } -// DeleteRegistryRepository deletes a repository in a registry. -// -// GitLab API docs: -// https://docs.gitlab.com/api/container_registry/#delete-registry-repository func (s *ContainerRegistryService) DeleteRegistryRepository(pid any, repository int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -217,10 +240,6 @@ type ListRegistryRepositoryTagsOptions struct { ListOptions } -// ListRegistryRepositoryTags gets a list of tags for given registry repository. -// -// GitLab API docs: -// https://docs.gitlab.com/api/container_registry/#list-registry-repository-tags func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid any, repository int64, opt *ListRegistryRepositoryTagsOptions, options ...RequestOptionFunc) ([]*RegistryRepositoryTag, *Response, error) { project, err := parseID(pid) if err != nil { @@ -245,10 +264,6 @@ func (s *ContainerRegistryService) ListRegistryRepositoryTags(pid any, repositor return tags, resp, nil } -// 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 func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid any, repository int64, tagName string, options ...RequestOptionFunc) (*RegistryRepositoryTag, *Response, error) { project, err := parseID(pid) if err != nil { @@ -274,10 +289,6 @@ func (s *ContainerRegistryService) GetRegistryRepositoryTagDetail(pid any, repos return tag, resp, nil } -// DeleteRegistryRepositoryTag deletes a registry repository tag. -// -// GitLab API docs: -// https://docs.gitlab.com/api/container_registry/#delete-a-registry-repository-tag func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid any, repository int64, tagName string, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -312,11 +323,6 @@ type DeleteRegistryRepositoryTagsOptions struct { NameRegexp *string `url:"name_regex,omitempty" json:"name_regex,omitempty"` } -// 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 func (s *ContainerRegistryService) DeleteRegistryRepositoryTags(pid any, repository int64, opt *DeleteRegistryRepositoryTagsOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { diff --git a/container_registry_protection_rules.go b/container_registry_protection_rules.go index ba91616e..131247a2 100644 --- a/container_registry_protection_rules.go +++ b/container_registry_protection_rules.go @@ -21,9 +21,32 @@ 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(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(pid any, opt *CreateContainerRegistryProtectionRuleOptions, options ...RequestOptionFunc) (*ContainerRegistryProtectionRule, *Response, error) + + // UpdateContainerRegistryProtectionRule updates a container repository protection + // rule for a project’s container registry. + // + // GitLab API docs: + // https://docs.gitlab.com/api/container_repository_protection_rules/#update-a-container-repository-protection-rule 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 int64, options ...RequestOptionFunc) (*Response, error) } @@ -57,11 +80,6 @@ func (s ContainerRegistryProtectionRule) String() string { return Stringify(s) } -// 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 func (s *ContainerRegistryProtectionRulesService) ListContainerRegistryProtectionRules(pid any, options ...RequestOptionFunc) ([]*ContainerRegistryProtectionRule, *Response, error) { project, err := parseID(pid) if err != nil { @@ -94,11 +112,6 @@ type CreateContainerRegistryProtectionRuleOptions struct { MinimumAccessLevelForDelete *ProtectionRuleAccessLevel `url:"minimum_access_level_for_delete,omitempty" json:"minimum_access_level_for_delete,omitempty"` } -// 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 func (s *ContainerRegistryProtectionRulesService) CreateContainerRegistryProtectionRule(pid any, opt *CreateContainerRegistryProtectionRuleOptions, options ...RequestOptionFunc) (*ContainerRegistryProtectionRule, *Response, error) { project, err := parseID(pid) if err != nil { @@ -131,11 +144,6 @@ type UpdateContainerRegistryProtectionRuleOptions struct { MinimumAccessLevelForDelete *ProtectionRuleAccessLevel `url:"minimum_access_level_for_delete,omitempty" json:"minimum_access_level_for_delete,omitempty"` } -// UpdateContainerRegistryProtectionRule updates a container repository protection -// rule for a project’s container registry. -// -// GitLab API docs: -// https://docs.gitlab.com/api/container_repository_protection_rules/#update-a-container-repository-protection-rule func (s *ContainerRegistryProtectionRulesService) UpdateContainerRegistryProtectionRule(pid any, ruleID int64, opt *UpdateContainerRegistryProtectionRuleOptions, options ...RequestOptionFunc) (*ContainerRegistryProtectionRule, *Response, error) { project, err := parseID(pid) if err != nil { @@ -157,11 +165,6 @@ func (s *ContainerRegistryProtectionRulesService) UpdateContainerRegistryProtect return rule, resp, nil } -// 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 func (s *ContainerRegistryProtectionRulesService) DeleteContainerRegistryProtectionRule(pid any, ruleID int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { diff --git a/container_registry_protection_rules_test.go b/container_registry_protection_rules_test.go index 8a60e3a8..2a174bd9 100644 --- a/container_registry_protection_rules_test.go +++ b/container_registry_protection_rules_test.go @@ -91,6 +91,8 @@ func TestCreateContainerRegistryProtectionRule(t *testing.T) { } func TestUpdateContainerRegistryProtectionRule(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/7/registry/protection/repository/rules/1", func(w http.ResponseWriter, r *http.Request) { diff --git a/container_registry_test.go b/container_registry_test.go index 1c82ad6d..0c13221d 100644 --- a/container_registry_test.go +++ b/container_registry_test.go @@ -330,6 +330,8 @@ func TestDeleteRegistryRepositoryTags(t *testing.T) { } for _, tc := range tests { t.Run(tc.event, func(t *testing.T) { + t.Parallel() + opt := &DeleteRegistryRepositoryTagsOptions{ NameRegexpDelete: &tc.nameRegexDelete, NameRegexpKeep: &tc.nameRegexKeep, diff --git a/custom_attributes.go b/custom_attributes.go index 0591864f..81af551c 100644 --- a/custom_attributes.go +++ b/custom_attributes.go @@ -23,17 +23,76 @@ import ( type ( CustomAttributesServiceInterface interface { + // ListCustomUserAttributes lists the custom attributes of the specified user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/custom_attributes/#list-custom-attributes 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 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 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 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 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 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 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 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 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 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 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 int64, key string, options ...RequestOptionFunc) (*Response, error) } @@ -56,26 +115,14 @@ type CustomAttribute struct { Value string `json:"value"` } -// ListCustomUserAttributes lists the custom attributes of the specified user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#list-custom-attributes func (s *CustomAttributesService) ListCustomUserAttributes(user int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { return s.listCustomAttributes("users", user, options...) } -// ListCustomGroupAttributes lists the custom attributes of the specified group. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#list-custom-attributes func (s *CustomAttributesService) ListCustomGroupAttributes(group int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { return s.listCustomAttributes("groups", group, options...) } -// ListCustomProjectAttributes lists the custom attributes of the specified project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#list-custom-attributes func (s *CustomAttributesService) ListCustomProjectAttributes(project int64, options ...RequestOptionFunc) ([]*CustomAttribute, *Response, error) { return s.listCustomAttributes("projects", project, options...) } @@ -95,26 +142,14 @@ func (s *CustomAttributesService) listCustomAttributes(resource string, id int64 return cas, resp, nil } -// GetCustomUserAttribute returns the user attribute with a specific key. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#single-custom-attribute func (s *CustomAttributesService) GetCustomUserAttribute(user int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.getCustomAttribute("users", user, key, options...) } -// GetCustomGroupAttribute returns the group attribute with a specific key. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#single-custom-attribute func (s *CustomAttributesService) GetCustomGroupAttribute(group int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.getCustomAttribute("groups", group, key, options...) } -// GetCustomProjectAttribute returns the project attribute with a specific key. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#single-custom-attribute func (s *CustomAttributesService) GetCustomProjectAttribute(project int64, key string, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.getCustomAttribute("projects", project, key, options...) } @@ -134,26 +169,14 @@ func (s *CustomAttributesService) getCustomAttribute(resource string, id int64, return ca, resp, nil } -// SetCustomUserAttribute sets the custom attributes of the specified user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#set-custom-attribute func (s *CustomAttributesService) SetCustomUserAttribute(user int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.setCustomAttribute("users", user, c, options...) } -// SetCustomGroupAttribute sets the custom attributes of the specified group. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#set-custom-attribute func (s *CustomAttributesService) SetCustomGroupAttribute(group int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.setCustomAttribute("groups", group, c, options...) } -// SetCustomProjectAttribute sets the custom attributes of the specified project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#set-custom-attribute func (s *CustomAttributesService) SetCustomProjectAttribute(project int64, c CustomAttribute, options ...RequestOptionFunc) (*CustomAttribute, *Response, error) { return s.setCustomAttribute("projects", project, c, options...) } @@ -173,26 +196,14 @@ func (s *CustomAttributesService) setCustomAttribute(resource string, id int64, return ca, resp, nil } -// DeleteCustomUserAttribute removes the custom attribute of the specified user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#delete-custom-attribute func (s *CustomAttributesService) DeleteCustomUserAttribute(user int64, key string, options ...RequestOptionFunc) (*Response, error) { return s.deleteCustomAttribute("users", user, key, options...) } -// DeleteCustomGroupAttribute removes the custom attribute of the specified group. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#delete-custom-attribute func (s *CustomAttributesService) DeleteCustomGroupAttribute(group int64, key string, options ...RequestOptionFunc) (*Response, error) { return s.deleteCustomAttribute("groups", group, key, options...) } -// DeleteCustomProjectAttribute removes the custom attribute of the specified project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/custom_attributes/#delete-custom-attribute func (s *CustomAttributesService) DeleteCustomProjectAttribute(project int64, key string, options ...RequestOptionFunc) (*Response, error) { return s.deleteCustomAttribute("projects", project, key, options...) } diff --git a/database_migrations.go b/database_migrations.go index 223a0d95..b9607533 100644 --- a/database_migrations.go +++ b/database_migrations.go @@ -21,6 +21,12 @@ import ( type ( DatabaseMigrationsServiceInterface interface { + // MarkMigrationAsSuccessful marks pending migrations as successfully executed + // to prevent them from being executed by the db:migrate tasks. Use this API to + // skip failing migrations after they are determined to be safe to skip. + // + // GitLab API docs: + // https://docs.gitlab.com/api/database_migrations/#mark-a-migration-as-successful MarkMigrationAsSuccessful(version int64, opt *MarkMigrationAsSuccessfulOptions, options ...RequestOptionFunc) (*Response, error) } @@ -44,12 +50,6 @@ type MarkMigrationAsSuccessfulOptions struct { Database string `url:"database,omitempty" json:"database,omitempty"` } -// MarkMigrationAsSuccessful marks pending migrations as successfully executed -// to prevent them from being executed by the db:migrate tasks. Use this API to -// skip failing migrations after they are determined to be safe to skip. -// -// GitLab API docs: -// https://docs.gitlab.com/api/database_migrations/#mark-a-migration-as-successful func (s *DatabaseMigrationsService) MarkMigrationAsSuccessful(version int64, opt *MarkMigrationAsSuccessfulOptions, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("admin/migrations/%d/mark", version) diff --git a/dependencies.go b/dependencies.go index e4b85381..36dacc96 100644 --- a/dependencies.go +++ b/dependencies.go @@ -21,6 +21,12 @@ import ( type ( DependenciesServiceInterface interface { + // ListProjectDependencies Get a list of project dependencies. This API partially + // mirroring Dependency List feature. This list can be generated only for languages + // and package managers supported by Gemnasium. + // + // GitLab API docs: + // https://docs.gitlab.com/api/dependencies/#list-project-dependencies ListProjectDependencies(pid any, opt *ListProjectDependenciesOptions, options ...RequestOptionFunc) ([]*Dependency, *Response, error) } @@ -75,12 +81,6 @@ type ListProjectDependenciesOptions struct { PackageManager []*DependencyPackageManagerValue `url:"package_manager,omitempty" json:"package_manager,omitempty"` } -// ListProjectDependencies Get a list of project dependencies. This API partially -// mirroring Dependency List feature. This list can be generated only for languages -// and package managers supported by Gemnasium. -// -// GitLab API docs: -// https://docs.gitlab.com/api/dependencies/#list-project-dependencies func (s *DependenciesService) ListProjectDependencies(pid any, opt *ListProjectDependenciesOptions, options ...RequestOptionFunc) ([]*Dependency, *Response, error) { project, err := parseID(pid) if err != nil { diff --git a/dependency_list_export.go b/dependency_list_export.go index cd4508c5..e6c21d9e 100644 --- a/dependency_list_export.go +++ b/dependency_list_export.go @@ -9,8 +9,37 @@ import ( type ( DependencyListExportServiceInterface interface { + // CreateDependencyListExport creates a new CycloneDX JSON export for all the project dependencies + // detected in a pipeline. + // + // If an authenticated user does not have permission to read_dependency, this request returns a 403 + // Forbidden status code. + // + // SBOM exports can be only accessed by the export’s author. + // + // GitLab docs: + // https://docs.gitlab.com/api/dependency_list_export/#create-a-dependency-list-export 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 int64, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) + + // DownloadDependencyListExport downloads a single dependency list export. + // + // The github.com/CycloneDX/cyclonedx-go package can be used to parse the data from the returned io.Reader. + // + // sbom := new(cdx.BOM) + // decoder := cdx.NewBOMDecoder(reader, cdx.BOMFileFormatJSON) + // + // if err = decoder.Decode(sbom); err != nil { + // panic(err) + // } + // + // GitLab docs: + // https://docs.gitlab.com/api/dependency_list_export/#download-dependency-list-export DownloadDependencyListExport(id int64, options ...RequestOptionFunc) (io.Reader, *Response, error) } @@ -47,16 +76,6 @@ type DependencyListExport struct { const defaultExportType = "sbom" -// CreateDependencyListExport creates a new CycloneDX JSON export for all the project dependencies -// detected in a pipeline. -// -// If an authenticated user does not have permission to read_dependency, this request returns a 403 -// Forbidden status code. -// -// SBOM exports can be only accessed by the export’s author. -// -// GitLab docs: -// https://docs.gitlab.com/api/dependency_list_export/#create-a-dependency-list-export 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) @@ -82,10 +101,6 @@ func (s *DependencyListExportService) CreateDependencyListExport(pipelineID int6 return export, resp, nil } -// GetDependencyListExport gets metadata about a single dependency list export. -// -// GitLab docs: -// https://docs.gitlab.com/api/dependency_list_export/#get-single-dependency-list-export func (s *DependencyListExportService) GetDependencyListExport(id int64, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) { // GET /dependency_list_exports/:id getExportPath := fmt.Sprintf("dependency_list_exports/%d", id) @@ -104,19 +119,6 @@ func (s *DependencyListExportService) GetDependencyListExport(id int64, options return export, resp, nil } -// DownloadDependencyListExport downloads a single dependency list export. -// -// The github.com/CycloneDX/cyclonedx-go package can be used to parse the data from the returned io.Reader. -// -// sbom := new(cdx.BOM) -// decoder := cdx.NewBOMDecoder(reader, cdx.BOMFileFormatJSON) -// -// if err = decoder.Decode(sbom); err != nil { -// panic(err) -// } -// -// GitLab docs: -// https://docs.gitlab.com/api/dependency_list_export/#download-dependency-list-export 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/dependency_proxy.go b/dependency_proxy.go index a475cb5f..c210e8e9 100644 --- a/dependency_proxy.go +++ b/dependency_proxy.go @@ -21,6 +21,11 @@ import ( type ( DependencyProxyServiceInterface interface { + // PurgeGroupDependencyProxy schedules for deletion the cached manifests and blobs + // for a group. This endpoint requires the Owner role for the group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/dependency_proxy/#purge-the-dependency-proxy-for-a-group PurgeGroupDependencyProxy(gid any, options ...RequestOptionFunc) (*Response, error) } @@ -35,11 +40,6 @@ type ( var _ DependencyProxyServiceInterface = (*DependencyProxyService)(nil) -// PurgeGroupDependencyProxy schedules for deletion the cached manifests and blobs -// for a group. This endpoint requires the Owner role for the group. -// -// GitLab API docs: -// https://docs.gitlab.com/api/dependency_proxy/#purge-the-dependency-proxy-for-a-group func (s *DependencyProxyService) PurgeGroupDependencyProxy(gid any, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { diff --git a/deploy_keys.go b/deploy_keys.go index ea2ef40f..d167fa32 100644 --- a/deploy_keys.go +++ b/deploy_keys.go @@ -24,14 +24,61 @@ 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(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(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(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(uid any, opt *ListUserProjectDeployKeysOptions, options ...RequestOptionFunc) ([]*ProjectDeployKey, *Response, error) + + // GetDeployKey gets a single deploy key. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_keys/#get-a-single-deploy-key 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 + // the original one is accessible by the same user. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_keys/#add-deploy-key-for-a-project AddDeployKey(pid any, opt *AddDeployKeyOptions, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) + + // DeleteDeployKey deletes a deploy key from a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_keys/#delete-deploy-key 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 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 int64, opt *UpdateDeployKeyOptions, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) } @@ -105,10 +152,6 @@ type ListInstanceDeployKeysOptions struct { Public *bool `url:"public,omitempty" json:"public,omitempty"` } -// ListAllDeployKeys gets a list of all deploy keys -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_keys/#list-all-deploy-keys func (s *DeployKeysService) ListAllDeployKeys(opt *ListInstanceDeployKeysOptions, options ...RequestOptionFunc) ([]*InstanceDeployKey, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "deploy_keys", opt, options) if err != nil { @@ -135,11 +178,6 @@ type AddInstanceDeployKeyOptions struct { ExpiresAt *time.Time `url:"expires_at,omitempty" json:"expires_at,omitempty"` } -// 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 func (s *DeployKeysService) AddInstanceDeployKey(opt *AddInstanceDeployKeyOptions, options ...RequestOptionFunc) (*InstanceDeployKey, *Response, error) { req, err := s.client.NewRequest(http.MethodPost, "deploy_keys", opt, options) if err != nil { @@ -164,10 +202,6 @@ type ListProjectDeployKeysOptions struct { ListOptions } -// 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 func (s *DeployKeysService) ListProjectDeployKeys(pid any, opt *ListProjectDeployKeysOptions, options ...RequestOptionFunc) ([]*ProjectDeployKey, *Response, error) { project, err := parseID(pid) if err != nil { @@ -198,10 +232,6 @@ type ListUserProjectDeployKeysOptions struct { ListOptions } -// 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 func (s *DeployKeysService) ListUserProjectDeployKeys(uid any, opt *ListUserProjectDeployKeysOptions, options ...RequestOptionFunc) ([]*ProjectDeployKey, *Response, error) { user, err := parseID(uid) if err != nil { @@ -223,10 +253,6 @@ func (s *DeployKeysService) ListUserProjectDeployKeys(uid any, opt *ListUserProj return ks, resp, nil } -// GetDeployKey gets a single deploy key. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_keys/#get-a-single-deploy-key func (s *DeployKeysService) GetDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) { project, err := parseID(pid) if err != nil { @@ -259,12 +285,6 @@ type AddDeployKeyOptions struct { ExpiresAt *time.Time `url:"expires_at,omitempty" json:"expires_at,omitempty"` } -// AddDeployKey creates a new deploy key for a project. If deploy key already -// exists in another project - it will be joined to project but only if -// original one is accessible by the same user. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_keys/#add-deploy-key-for-a-project func (s *DeployKeysService) AddDeployKey(pid any, opt *AddDeployKeyOptions, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) { project, err := parseID(pid) if err != nil { @@ -286,10 +306,6 @@ func (s *DeployKeysService) AddDeployKey(pid any, opt *AddDeployKeyOptions, opti return k, resp, nil } -// DeleteDeployKey deletes a deploy key from a project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_keys/#delete-deploy-key func (s *DeployKeysService) DeleteDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -305,10 +321,6 @@ func (s *DeployKeysService) DeleteDeployKey(pid any, deployKey int64, options .. return s.client.Do(req, nil) } -// EnableDeployKey enables a deploy key. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_keys/#enable-a-deploy-key func (s *DeployKeysService) EnableDeployKey(pid any, deployKey int64, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) { project, err := parseID(pid) if err != nil { @@ -339,10 +351,6 @@ type UpdateDeployKeyOptions struct { CanPush *bool `url:"can_push,omitempty" json:"can_push,omitempty"` } -// UpdateDeployKey updates a deploy key for a project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_keys/#update-deploy-key func (s *DeployKeysService) UpdateDeployKey(pid any, deployKey int64, opt *UpdateDeployKeyOptions, options ...RequestOptionFunc) (*ProjectDeployKey, *Response, error) { project, err := parseID(pid) if err != nil { diff --git a/deploy_tokens.go b/deploy_tokens.go index 8d88ec21..fd998039 100644 --- a/deploy_tokens.go +++ b/deploy_tokens.go @@ -24,14 +24,58 @@ 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(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(pid any, opt *ListProjectDeployTokensOptions, options ...RequestOptionFunc) ([]*DeployToken, *Response, error) + + // GetProjectDeployToken gets a single deploy token. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_tokens/#get-a-project-deploy-token GetProjectDeployToken(pid any, deployToken int64, options ...RequestOptionFunc) (*DeployToken, *Response, error) + + // CreateProjectDeployToken creates a new deploy token for a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_tokens/#create-a-project-deploy-token CreateProjectDeployToken(pid any, opt *CreateProjectDeployTokenOptions, options ...RequestOptionFunc) (*DeployToken, *Response, error) + + // DeleteProjectDeployToken removes a deploy token from the project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_tokens/#delete-a-project-deploy-token DeleteProjectDeployToken(pid any, deployToken int64, options ...RequestOptionFunc) (*Response, error) + + // ListGroupDeployTokens gets a list of a group’s deploy tokens. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_tokens/#list-group-deploy-tokens ListGroupDeployTokens(gid any, opt *ListGroupDeployTokensOptions, options ...RequestOptionFunc) ([]*DeployToken, *Response, error) + + // GetGroupDeployToken gets a single deploy token. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_tokens/#get-a-group-deploy-token GetGroupDeployToken(gid any, deployToken int64, options ...RequestOptionFunc) (*DeployToken, *Response, error) + + // CreateGroupDeployToken creates a new deploy token for a group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_tokens/#create-a-group-deploy-token CreateGroupDeployToken(gid any, opt *CreateGroupDeployTokenOptions, options ...RequestOptionFunc) (*DeployToken, *Response, error) + + // DeleteGroupDeployToken removes a deploy token from the group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deploy_tokens/#delete-a-group-deploy-token DeleteGroupDeployToken(gid any, deployToken int64, options ...RequestOptionFunc) (*Response, error) } @@ -60,10 +104,6 @@ func (k DeployToken) String() string { return Stringify(k) } -// ListAllDeployTokens gets a list of all deploy tokens. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_tokens/#list-all-deploy-tokens func (s *DeployTokensService) ListAllDeployTokens(options ...RequestOptionFunc) ([]*DeployToken, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "deploy_tokens", nil, options) if err != nil { @@ -88,10 +128,6 @@ type ListProjectDeployTokensOptions struct { ListOptions } -// ListProjectDeployTokens gets a list of a project's deploy tokens. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_tokens/#list-project-deploy-tokens func (s *DeployTokensService) ListProjectDeployTokens(pid any, opt *ListProjectDeployTokensOptions, options ...RequestOptionFunc) ([]*DeployToken, *Response, error) { project, err := parseID(pid) if err != nil { @@ -113,10 +149,6 @@ func (s *DeployTokensService) ListProjectDeployTokens(pid any, opt *ListProjectD return ts, resp, nil } -// GetProjectDeployToken gets a single deploy token. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_tokens/#get-a-project-deploy-token func (s *DeployTokensService) GetProjectDeployToken(pid any, deployToken int64, options ...RequestOptionFunc) (*DeployToken, *Response, error) { project, err := parseID(pid) if err != nil { @@ -149,10 +181,6 @@ type CreateProjectDeployTokenOptions struct { Scopes *[]string `url:"scopes,omitempty" json:"scopes,omitempty"` } -// CreateProjectDeployToken creates a new deploy token for a project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_tokens/#create-a-project-deploy-token func (s *DeployTokensService) CreateProjectDeployToken(pid any, opt *CreateProjectDeployTokenOptions, options ...RequestOptionFunc) (*DeployToken, *Response, error) { project, err := parseID(pid) if err != nil { @@ -174,10 +202,6 @@ func (s *DeployTokensService) CreateProjectDeployToken(pid any, opt *CreateProje return t, resp, nil } -// DeleteProjectDeployToken removes a deploy token from the project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_tokens/#delete-a-project-deploy-token func (s *DeployTokensService) DeleteProjectDeployToken(pid any, deployToken int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -202,10 +226,6 @@ type ListGroupDeployTokensOptions struct { ListOptions } -// ListGroupDeployTokens gets a list of a group’s deploy tokens. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_tokens/#list-group-deploy-tokens func (s *DeployTokensService) ListGroupDeployTokens(gid any, opt *ListGroupDeployTokensOptions, options ...RequestOptionFunc) ([]*DeployToken, *Response, error) { group, err := parseID(gid) if err != nil { @@ -227,10 +247,6 @@ func (s *DeployTokensService) ListGroupDeployTokens(gid any, opt *ListGroupDeplo return ts, resp, nil } -// GetGroupDeployToken gets a single deploy token. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_tokens/#get-a-group-deploy-token func (s *DeployTokensService) GetGroupDeployToken(gid any, deployToken int64, options ...RequestOptionFunc) (*DeployToken, *Response, error) { group, err := parseID(gid) if err != nil { @@ -263,10 +279,6 @@ type CreateGroupDeployTokenOptions struct { Scopes *[]string `url:"scopes,omitempty" json:"scopes,omitempty"` } -// CreateGroupDeployToken creates a new deploy token for a group. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_tokens/#create-a-group-deploy-token func (s *DeployTokensService) CreateGroupDeployToken(gid any, opt *CreateGroupDeployTokenOptions, options ...RequestOptionFunc) (*DeployToken, *Response, error) { group, err := parseID(gid) if err != nil { @@ -288,10 +300,6 @@ func (s *DeployTokensService) CreateGroupDeployToken(gid any, opt *CreateGroupDe return t, resp, nil } -// DeleteGroupDeployToken removes a deploy token from the group. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deploy_tokens/#delete-a-group-deploy-token func (s *DeployTokensService) DeleteGroupDeployToken(gid any, deployToken int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { diff --git a/deployments.go b/deployments.go index 7f3bd4b1..3e6b52a1 100644 --- a/deployments.go +++ b/deployments.go @@ -24,11 +24,40 @@ 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(pid any, opts *ListProjectDeploymentsOptions, options ...RequestOptionFunc) ([]*Deployment, *Response, error) + + // GetProjectDeployment gets a specific deployment for a project. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deployments/#get-a-specific-deployment GetProjectDeployment(pid any, deployment int64, options ...RequestOptionFunc) (*Deployment, *Response, error) + + // CreateProjectDeployment creates a project deployment. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deployments/#create-a-deployment CreateProjectDeployment(pid any, opt *CreateProjectDeploymentOptions, options ...RequestOptionFunc) (*Deployment, *Response, error) + + // UpdateProjectDeployment updates a project deployment. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deployments/#update-a-deployment 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 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 int64, options ...RequestOptionFunc) (*Response, error) } @@ -106,10 +135,6 @@ type ListProjectDeploymentsOptions struct { FinishedBefore *time.Time `url:"finished_before,omitempty" json:"finished_before,omitempty"` } -// ListProjectDeployments gets a list of deployments in a project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deployments/#list-project-deployments func (s *DeploymentsService) ListProjectDeployments(pid any, opts *ListProjectDeploymentsOptions, options ...RequestOptionFunc) ([]*Deployment, *Response, error) { project, err := parseID(pid) if err != nil { @@ -131,10 +156,6 @@ func (s *DeploymentsService) ListProjectDeployments(pid any, opts *ListProjectDe return ds, resp, nil } -// GetProjectDeployment get a deployment for a project. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deployments/#get-a-specific-deployment func (s *DeploymentsService) GetProjectDeployment(pid any, deployment int64, options ...RequestOptionFunc) (*Deployment, *Response, error) { project, err := parseID(pid) if err != nil { @@ -169,10 +190,6 @@ type CreateProjectDeploymentOptions struct { Status *DeploymentStatusValue `url:"status,omitempty" json:"status,omitempty"` } -// CreateProjectDeployment creates a project deployment. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deployments/#create-a-deployment func (s *DeploymentsService) CreateProjectDeployment(pid any, opt *CreateProjectDeploymentOptions, options ...RequestOptionFunc) (*Deployment, *Response, error) { project, err := parseID(pid) if err != nil { @@ -203,10 +220,6 @@ type UpdateProjectDeploymentOptions struct { Status *DeploymentStatusValue `url:"status,omitempty" json:"status,omitempty"` } -// UpdateProjectDeployment updates a project deployment. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deployments/#update-a-deployment func (s *DeploymentsService) UpdateProjectDeployment(pid any, deployment int64, opt *UpdateProjectDeploymentOptions, options ...RequestOptionFunc) (*Deployment, *Response, error) { project, err := parseID(pid) if err != nil { @@ -239,10 +252,6 @@ type ApproveOrRejectProjectDeploymentOptions struct { RepresentedAs *string `url:"represented_as,omitempty" json:"represented_as,omitempty"` } -// ApproveOrRejectProjectDeployment approve or reject a blocked deployment. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deployments/#approve-or-reject-a-blocked-deployment func (s *DeploymentsService) ApproveOrRejectProjectDeployment(pid any, deployment int64, opt *ApproveOrRejectProjectDeploymentOptions, options ...RequestOptionFunc, ) (*Response, error) { @@ -260,10 +269,6 @@ func (s *DeploymentsService) ApproveOrRejectProjectDeployment(pid any, deploymen return s.client.Do(req, nil) } -// DeleteProjectDeployment delete a project deployment. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deployments/#delete-a-specific-deployment func (s *DeploymentsService) DeleteProjectDeployment(pid any, deployment int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { diff --git a/deployments_merge_requests.go b/deployments_merge_requests.go index db64db30..b3900fcf 100644 --- a/deployments_merge_requests.go +++ b/deployments_merge_requests.go @@ -21,6 +21,10 @@ import ( type ( // DeploymentMergeRequestsServiceInterface defines all the API methods for the DeploymentMergeRequestsService DeploymentMergeRequestsServiceInterface interface { + // ListDeploymentMergeRequests get the merge requests associated with deployment. + // + // GitLab API docs: + // https://docs.gitlab.com/api/deployments/#list-of-merge-requests-associated-with-a-deployment ListDeploymentMergeRequests(pid any, deployment int64, opts *ListMergeRequestsOptions, options ...RequestOptionFunc) ([]*MergeRequest, *Response, error) } @@ -36,10 +40,6 @@ type ( var _ DeploymentMergeRequestsServiceInterface = (*DeploymentMergeRequestsService)(nil) -// ListDeploymentMergeRequests get the merge requests associated with deployment. -// -// GitLab API docs: -// https://docs.gitlab.com/api/deployments/#list-of-merge-requests-associated-with-a-deployment func (s *DeploymentMergeRequestsService) ListDeploymentMergeRequests(pid any, deployment int64, opts *ListMergeRequestsOptions, options ...RequestOptionFunc) ([]*MergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { diff --git a/discussions.go b/discussions.go index d4a92b04..5f319863 100644 --- a/discussions.go +++ b/discussions.go @@ -25,36 +25,189 @@ import ( type ( // DiscussionsServiceInterface defines all the API methods for the DiscussionsService DiscussionsServiceInterface interface { + // ListIssueDiscussions gets a list of all discussions for a single issue. + // + // GitLab API docs: + // https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) + + // ListCommitDiscussions gets all discussions for a commit. + // + // GitLab API docs: + // 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(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(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(pid any, commit string, discussion string, opt *AddCommitDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) + + // UpdateCommitDiscussionNote modifies an existing note in a commit discussion. + // + // GitLab API docs: + // https://docs.gitlab.com/api/discussions/#modify-an-existing-commit-thread-note 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 int64, options ...RequestOptionFunc) (*Response, error) } @@ -91,11 +244,6 @@ type ListIssueDiscussionsOptions struct { ListOptions } -// ListIssueDiscussions gets a list of all discussions for a single -// issue. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#list-project-issue-discussion-items func (s *DiscussionsService) ListIssueDiscussions(pid any, issue int64, opt *ListIssueDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -117,10 +265,6 @@ func (s *DiscussionsService) ListIssueDiscussions(pid any, issue int64, opt *Lis return ds, resp, nil } -// GetIssueDiscussion returns a single discussion for a specific project issue. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#get-single-issue-discussion-item func (s *DiscussionsService) GetIssueDiscussion(pid any, issue int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -156,10 +300,6 @@ type CreateIssueDiscussionOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// CreateIssueDiscussion creates a new discussion to a single project issue. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#create-new-issue-thread func (s *DiscussionsService) CreateIssueDiscussion(pid any, issue int64, opt *CreateIssueDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -191,10 +331,6 @@ type AddIssueDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// AddIssueDiscussionNote creates a new discussion to a single project issue. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#add-note-to-existing-issue-thread func (s *DiscussionsService) AddIssueDiscussionNote(pid any, issue int64, discussion string, opt *AddIssueDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { @@ -230,10 +366,6 @@ type UpdateIssueDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// UpdateIssueDiscussionNote modifies existing discussion of an issue. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#modify-existing-issue-thread-note 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 { @@ -260,10 +392,6 @@ func (s *DiscussionsService) UpdateIssueDiscussionNote(pid any, issue int64, dis return n, resp, nil } -// DeleteIssueDiscussionNote deletes an existing discussion of an issue. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#delete-an-issue-thread-note func (s *DiscussionsService) DeleteIssueDiscussionNote(pid any, issue int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -293,11 +421,6 @@ type ListSnippetDiscussionsOptions struct { ListOptions } -// ListSnippetDiscussions gets a list of all discussions for a single -// snippet. Snippet discussions are comments users can post to a snippet. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#list-project-snippet-discussion-items func (s *DiscussionsService) ListSnippetDiscussions(pid any, snippet int64, opt *ListSnippetDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -319,10 +442,6 @@ func (s *DiscussionsService) ListSnippetDiscussions(pid any, snippet int64, opt return ds, resp, nil } -// GetSnippetDiscussion returns a single discussion for a given snippet. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#get-single-snippet-discussion-item func (s *DiscussionsService) GetSnippetDiscussion(pid any, snippet int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -358,11 +477,6 @@ type CreateSnippetDiscussionOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// CreateSnippetDiscussion creates a new discussion for a single snippet. -// Snippet discussions are comments users can post to a snippet. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#create-new-snippet-thread func (s *DiscussionsService) CreateSnippetDiscussion(pid any, snippet int64, opt *CreateSnippetDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -394,11 +508,6 @@ type AddSnippetDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// AddSnippetDiscussionNote creates a new discussion to a single project -// snippet. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#add-note-to-existing-snippet-thread func (s *DiscussionsService) AddSnippetDiscussionNote(pid any, snippet int64, discussion string, opt *AddSnippetDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { @@ -434,10 +543,6 @@ type UpdateSnippetDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// UpdateSnippetDiscussionNote modifies existing discussion of a snippet. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#modify-existing-snippet-thread-note 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 { @@ -464,10 +569,6 @@ func (s *DiscussionsService) UpdateSnippetDiscussionNote(pid any, snippet int64, return n, resp, nil } -// DeleteSnippetDiscussionNote deletes an existing discussion of a snippet. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#delete-a-snippet-thread-note func (s *DiscussionsService) DeleteSnippetDiscussionNote(pid any, snippet int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -497,11 +598,6 @@ type ListGroupEpicDiscussionsOptions struct { ListOptions } -// ListGroupEpicDiscussions gets a list of all discussions for a single -// epic. Epic discussions are comments users can post to a epic. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#list-group-epic-discussion-items func (s *DiscussionsService) ListGroupEpicDiscussions(gid any, epic int64, opt *ListGroupEpicDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { group, err := parseID(gid) if err != nil { @@ -526,10 +622,6 @@ func (s *DiscussionsService) ListGroupEpicDiscussions(gid any, epic int64, opt * return ds, resp, nil } -// GetEpicDiscussion returns a single discussion for a given epic. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#get-single-epic-discussion-item func (s *DiscussionsService) GetEpicDiscussion(gid any, epic int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { group, err := parseID(gid) if err != nil { @@ -565,11 +657,6 @@ type CreateEpicDiscussionOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// CreateEpicDiscussion creates a new discussion for a single epic. Epic -// discussions are comments users can post to a epic. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#create-new-epic-thread func (s *DiscussionsService) CreateEpicDiscussion(gid any, epic int64, opt *CreateEpicDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { group, err := parseID(gid) if err != nil { @@ -604,10 +691,6 @@ type AddEpicDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// AddEpicDiscussionNote creates a new discussion to a single project epic. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#add-note-to-existing-epic-thread func (s *DiscussionsService) AddEpicDiscussionNote(gid any, epic int64, discussion string, opt *AddEpicDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { group, err := parseID(gid) if err != nil { @@ -643,10 +726,6 @@ type UpdateEpicDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// UpdateEpicDiscussionNote modifies existing discussion of an epic. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#modify-existing-epic-thread-note 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 { @@ -673,10 +752,6 @@ func (s *DiscussionsService) UpdateEpicDiscussionNote(gid any, epic int64, discu return n, resp, nil } -// DeleteEpicDiscussionNote deletes an existing discussion of a epic. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#delete-an-epic-thread-note func (s *DiscussionsService) DeleteEpicDiscussionNote(gid any, epic int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { @@ -706,11 +781,6 @@ type ListMergeRequestDiscussionsOptions struct { ListOptions } -// ListMergeRequestDiscussions gets a list of all discussions for a single -// merge request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#list-project-merge-request-discussion-items func (s *DiscussionsService) ListMergeRequestDiscussions(pid any, mergeRequest int64, opt *ListMergeRequestDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -735,11 +805,6 @@ func (s *DiscussionsService) ListMergeRequestDiscussions(pid any, mergeRequest i return ds, resp, nil } -// GetMergeRequestDiscussion returns a single discussion for a given merge -// request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#get-single-merge-request-discussion-item func (s *DiscussionsService) GetMergeRequestDiscussion(pid any, mergeRequest int64, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -808,11 +873,6 @@ type LinePositionOptions struct { NewLine *int64 `url:"new_line,omitempty" json:"new_line,omitempty"` } -// CreateMergeRequestDiscussion creates a new discussion for a single merge -// request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#create-new-merge-request-thread func (s *DiscussionsService) CreateMergeRequestDiscussion(pid any, mergeRequest int64, opt *CreateMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -846,11 +906,6 @@ type ResolveMergeRequestDiscussionOptions struct { Resolved *bool `url:"resolved,omitempty" json:"resolved,omitempty"` } -// ResolveMergeRequestDiscussion resolves/unresolves whole discussion of a merge -// request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#resolve-a-merge-request-thread func (s *DiscussionsService) ResolveMergeRequestDiscussion(pid any, mergeRequest int64, discussion string, opt *ResolveMergeRequestDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -886,11 +941,6 @@ type AddMergeRequestDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// AddMergeRequestDiscussionNote creates a new discussion to a single project -// merge request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#add-note-to-existing-merge-request-thread func (s *DiscussionsService) AddMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, opt *AddMergeRequestDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { @@ -927,11 +977,6 @@ type UpdateMergeRequestDiscussionNoteOptions struct { Resolved *bool `url:"resolved,omitempty" json:"resolved,omitempty"` } -// UpdateMergeRequestDiscussionNote modifies existing discussion of a merge -// request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#modify-an-existing-merge-request-thread-note 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 { @@ -958,11 +1003,6 @@ func (s *DiscussionsService) UpdateMergeRequestDiscussionNote(pid any, mergeRequ return n, resp, nil } -// DeleteMergeRequestDiscussionNote deletes an existing discussion of a merge -// request. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#delete-a-merge-request-thread-note func (s *DiscussionsService) DeleteMergeRequestDiscussionNote(pid any, mergeRequest int64, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -992,11 +1032,6 @@ type ListCommitDiscussionsOptions struct { ListOptions } -// ListCommitDiscussions gets a list of all discussions for a single -// commit. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#list-project-commit-discussion-items func (s *DiscussionsService) ListCommitDiscussions(pid any, commit string, opt *ListCommitDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -1021,11 +1056,6 @@ func (s *DiscussionsService) ListCommitDiscussions(pid any, commit string, opt * return ds, resp, nil } -// GetCommitDiscussion returns a single discussion for a specific project -// commit. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#get-single-commit-discussion-item func (s *DiscussionsService) GetCommitDiscussion(pid any, commit string, discussion string, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -1062,10 +1092,6 @@ type CreateCommitDiscussionOptions struct { Position *NotePosition `url:"position,omitempty" json:"position,omitempty"` } -// CreateCommitDiscussion creates a new discussion to a single project commit. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#create-new-commit-thread func (s *DiscussionsService) CreateCommitDiscussion(pid any, commit string, opt *CreateCommitDiscussionOptions, options ...RequestOptionFunc) (*Discussion, *Response, error) { project, err := parseID(pid) if err != nil { @@ -1100,10 +1126,6 @@ type AddCommitDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// AddCommitDiscussionNote creates a new discussion to a single project commit. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#add-note-to-existing-commit-thread func (s *DiscussionsService) AddCommitDiscussionNote(pid any, commit string, discussion string, opt *AddCommitDiscussionNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) { project, err := parseID(pid) if err != nil { @@ -1139,10 +1161,6 @@ type UpdateCommitDiscussionNoteOptions struct { CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` } -// UpdateCommitDiscussionNote modifies existing discussion of a commit. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#modify-an-existing-commit-thread-note 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 { @@ -1169,10 +1187,6 @@ func (s *DiscussionsService) UpdateCommitDiscussionNote(pid any, commit string, return n, resp, nil } -// DeleteCommitDiscussionNote deletes an existing discussion of an commit. -// -// GitLab API docs: -// https://docs.gitlab.com/api/discussions/#delete-a-commit-thread-note func (s *DiscussionsService) DeleteCommitDiscussionNote(pid any, commit string, discussion string, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { diff --git a/dockerfile_templates.go b/dockerfile_templates.go index 32446913..ba71346f 100644 --- a/dockerfile_templates.go +++ b/dockerfile_templates.go @@ -25,7 +25,16 @@ import ( type ( // DockerfileTemplatesServiceInterface defines all the API methods for the DockerfileTemplatesService DockerfileTemplatesServiceInterface interface { + // ListTemplates get a list of available Dockerfile templates. + // + // GitLab API docs: + // https://docs.gitlab.com/api/templates/dockerfiles/#list-dockerfile-templates ListTemplates(opt *ListDockerfileTemplatesOptions, options ...RequestOptionFunc) ([]*DockerfileTemplateListItem, *Response, error) + + // GetTemplate get a single Dockerfile template. + // + // GitLab API docs: + // https://docs.gitlab.com/api/templates/dockerfiles/#single-dockerfile-template GetTemplate(key string, options ...RequestOptionFunc) (*DockerfileTemplate, *Response, error) } @@ -64,10 +73,6 @@ type ListDockerfileTemplatesOptions struct { ListOptions } -// ListTemplates get a list of available Dockerfile templates. -// -// GitLab API docs: -// https://docs.gitlab.com/api/templates/dockerfiles/#list-dockerfile-templates func (s *DockerfileTemplatesService) ListTemplates(opt *ListDockerfileTemplatesOptions, options ...RequestOptionFunc) ([]*DockerfileTemplateListItem, *Response, error) { req, err := s.client.NewRequest(http.MethodGet, "templates/dockerfiles", opt, options) if err != nil { @@ -83,10 +88,6 @@ func (s *DockerfileTemplatesService) ListTemplates(opt *ListDockerfileTemplatesO return gs, resp, nil } -// GetTemplate get a single Dockerfile template. -// -// GitLab API docs: -// https://docs.gitlab.com/api/templates/dockerfiles/#single-dockerfile-template func (s *DockerfileTemplatesService) GetTemplate(key string, options ...RequestOptionFunc) (*DockerfileTemplate, *Response, error) { u := fmt.Sprintf("templates/dockerfiles/%s", url.PathEscape(key)) diff --git a/docs/guides/AddingAPISupport.md b/docs/guides/AddingAPISupport.md new file mode 100644 index 00000000..cb4ee736 --- /dev/null +++ b/docs/guides/AddingAPISupport.md @@ -0,0 +1,401 @@ +--- +page_title: "Adding support for a new API" +--- + +# Adding support for a new API to `client-go` + +This tutorial is to help new contributors out when adding support for a new API or endpoint. +It will walk through a step-by-step guide of adding support for a new API or endpoint. +This guide will assume that a development environment has already been set up by following the `Setting up your local development environment to contribute` section of the CONTRIBUTING.md documentation. + +## Step 1: Understand the API from GitLab + +For this guide, we use the [`branches API`](./branches.go) API as a step-by-step example. +This code aligns to the [Branches API](https://docs.gitlab.com/api/branches/) exposed by GitLab. + +The documentation describes the URL, input parameters and JSON response for each endpoint. + +Note, the documentation is not currently generated from the API code. +It may not match the real input parameters and response objects. + +## Step 2: Create the API file + +All APIs have a `.go` file in the top level directory of this repository. +The names match the API names. +In our case, the file is `branches.go`. + +Add the package declaration: + +```golang +package gitlab +``` + +## Step 3: Create the Endpoint functions + +### Step 3a: Get endpoints + +Usually, `Get` endpoints only need function parameters and no custom input structs. +They use IDs get a single entry from the API endpoint. +Project and group endpoints usually accept either a numeric ID or the namespace path. +These functions take an `any` type parameter like `pid` or `gid`. +They use the helper function `parseID` to convert it into a string for use in the endpoint URL. + +Most of the time they need a custom struct for the decoded JSON response. +The fields in these structs can usually be plain fields (for example, `string`). +Use pointers only if you need to differentiate between "unset" and "empty string". +For example, `GetBranch` returns the custom `Branch` struct: + +```golang +// Branch represents a GitLab branch. +// +// GitLab API docs: https://docs.gitlab.com/api/branches/ +type Branch struct { + Commit *Commit `json:"commit"` + Name string `json:"name"` + Protected bool `json:"protected"` + Merged bool `json:"merged"` + Default bool `json:"default"` + CanPush bool `json:"can_push"` + DevelopersCanPush bool `json:"developers_can_push"` + DevelopersCanMerge bool `json:"developers_can_merge"` + WebURL string `json:"web_url"` +} +``` + +Pass the URL path parameters and generic `RequestOptionFunc` optional parameter to the endpoint function. +For example, for `GetBranch`: + +```golang +// GetBranch gets a single project repository branch. +// +// GitLab API docs: +// https://docs.gitlab.com/api/branches/#get-single-repository-branch +func (s *BranchesService) GetBranch(pid any, branch string, options ...RequestOptionFunc) (*Branch, *Response, error) { + // Ensure whatever format `pid` is, it is converted into a string + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + // Create the endpoint URL, ensuring the project string is URL encoded with `PathEscape` + u := fmt.Sprintf("projects/%s/repository/branches/%s", PathEscape(project), url.PathEscape(branch)) + + // Create a request object with the HTTP method, endpoint URL and any custom options + req, err := s.client.NewRequest(http.MethodGet, u, nil, options) + if err != nil { + return nil, nil, err + } + + // Call the endpoint and store the JSON decoded response in the custom struct + b := new(Branch) + resp, err := s.client.Do(req, b) + if err != nil { + return nil, resp, err + } + + // Return the result + return b, resp, nil +} + +``` + +### Step 3b: `List` endpoints + +`List` endpoints need a custom options struct. +This is for pagination fields and custom search options. +There is a reusable struct called `ListOptions` that encapsulates the pagination fields. +Many `List` endpoints then add custom search parameters in this struct. +All fields should be pointers, to distinguish between "unset" and "set to empty/zero/false". + +> [!important] +> Always add an options struct for `List` functions, even if it does not add any fields bar `ListOptions`. +> This makes the API consistent and allows forward compatibility. + +For example, for `ListBranches`: + +```golang +// ListBranchesOptions represents the available ListBranches() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/branches/#list-repository-branches +type ListBranchesOptions struct { + // Nest the default pagination options + ListOptions + + // Add any custom search parameters for the endpoint + Search *string `url:"search,omitempty" json:"search,omitempty"` + Regex *string `url:"regex,omitempty" json:"regex,omitempty"` +} +``` + +Pass the custom options struct into the function after any URL path parameters. +Make sure to include the generic `RequestOptionFunc` optional parameter. +Usually, `List` endpoints return a slice of the custom struct created for the `Get` endpoint. +For example, for `ListBranches`: + +```golang +// ListBranches gets a list of repository branches from a project, sorted by +// name alphabetically. +// +// GitLab API docs: +// https://docs.gitlab.com/api/branches/#list-repository-branches +func (s *BranchesService) ListBranches(pid any, opts *ListBranchesOptions, options ...RequestOptionFunc) ([]*Branch, *Response, error) { + // Ensure whatever format `pid` is, it is converted into a string + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + // Create the endpoint URL, ensuring the project string is URL encoded with `PathEscape` + u := fmt.Sprintf("projects/%s/repository/branches", PathEscape(project)) + + // Create a request object with the HTTP method, endpoint URL and any custom options + req, err := s.client.NewRequest(http.MethodGet, u, opts, options) + if err != nil { + return nil, nil, err + } + + // Call the endpoint and store the JSON decoded response in the custom struct slice + var b []*Branch + resp, err := s.client.Do(req, &b) + if err != nil { + return nil, resp, err + } + + // Return the result + return b, resp, nil +} + +``` + +### Step 3c: `Create`/`Update` endpoints + +As with `List` endpoints, `Create` and `Update` endpoints need custom options structs. +These are for query parameters or JSON request body fields. +All fields should be pointers, to distinguish between "unset" and "set to empty/zero/false". +For example, for `CreateBranch`: + +```golang +// CreateBranchOptions represents the available CreateBranch() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/branches/#create-repository-branch +type CreateBranchOptions struct { + Branch *string `url:"branch,omitempty" json:"branch,omitempty"` + Ref *string `url:"ref,omitempty" json:"ref,omitempty"` +} +``` + +Pass the custom options struct into the function after any URL path parameters. +Make sure to include the generic `RequestOptionFunc` optional parameter. +`Create`/`Update` endpoints return the created/updated object. +This is usually the same custom struct created for the `Get` endpoint. +For example, for `CreateBranch`: + +```golang +// CreateBranch creates branch from commit SHA or existing branch. +// +// GitLab API docs: +// https://docs.gitlab.com/api/branches/#create-repository-branch +func (s *BranchesService) CreateBranch(pid any, opt *CreateBranchOptions, options ...RequestOptionFunc) (*Branch, *Response, error) { + // Ensure whatever format `pid` is, it is converted into a string + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + // Create the endpoint URL, ensuring the project string is URL encoded with `PathEscape` + u := fmt.Sprintf("projects/%s/repository/branches", PathEscape(project)) + + // Create a request object with the HTTP method, endpoint URL and any custom options + req, err := s.client.NewRequest(http.MethodPost, u, opt, options) + if err != nil { + return nil, nil, err + } + + // Call the endpoint and store the JSON decoded response in the custom struct + b := new(Branch) + resp, err := s.client.Do(req, b) + if err != nil { + return nil, resp, err + } + + // Return the result + return b, resp, nil +} +``` + +### Step 3d: `Delete` endpoints + +`Delete` endpoints usually do not need custom structs. +They use IDs to delete a single entry from the API endpoint. + +Pass the URL path parameters and generic `RequestOptionFunc` optional parameter to the endpoint function. +For example, for `DeleteBranch`: + +```golang +// DeleteBranch deletes an existing branch. +// +// GitLab API docs: +// https://docs.gitlab.com/api/branches/#delete-repository-branch +func (s *BranchesService) DeleteBranch(pid any, branch string, options ...RequestOptionFunc) (*Response, error) { + // Ensure whatever format `pid` is, it is converted into a string + project, err := parseID(pid) + if err != nil { + return nil, err + } + // Create the endpoint URL, ensuring any inputs are URL encoded + u := fmt.Sprintf("projects/%s/repository/branches/%s", PathEscape(project), url.PathEscape(branch)) + + // Create a request object with the HTTP method, endpoint URL and any custom options + req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) + if err != nil { + return nil, err + } + + // Call the endpoint and return the result directly + return s.client.Do(req, nil) +} + +``` + +## Step 4: Add the API Service Interface and Service struct + +To make it easier for unit testing and mocking, each API has a service interface. +This declares all the functions in the API file. +It includes all the input parameters and response objects. + +Place this at the top of the file. +Include the function definitions of any endpoint functions you have created. +For example, for the Branches API: + +```golang +type ( + BranchesServiceInterface interface { + ListBranches(pid any, opts *ListBranchesOptions, options ...RequestOptionFunc) ([]*Branch, *Response, error) + GetBranch(pid any, branch string, options ...RequestOptionFunc) (*Branch, *Response, error) + CreateBranch(pid any, opt *CreateBranchOptions, options ...RequestOptionFunc) (*Branch, *Response, error) + DeleteBranch(pid any, branch string, options ...RequestOptionFunc) (*Response, error) + DeleteMergedBranches(pid any, options ...RequestOptionFunc) (*Response, error) + } + + // BranchesService handles communication with the branch related methods + // of the GitLab API. + // + // GitLab API docs: https://docs.gitlab.com/api/branches/ + BranchesService struct { + client *Client + } +) +``` + +To ensure the new service matches the interface, include the following line: + +```golang +var _ BranchesServiceInterface = (*BranchesService)(nil) +``` + +## Step 5: Wire the new service into the gitlab package + +All services need adding to `gitlab.go` in two places. + +Add it as an attribute of the `Client` struct. +There is a long list of services included here. +Add any new services to the list in alphabetical order. +For example, for the Branches API: + +```golang +type Client struct { + ... + Branches BranchesServiceInterface + ... +} +``` + +Populate it on the `Client` struct instance in `NewAuthSourceClient`. +Again, there is a long list of services included here. +Add any new services to the list in alphabetical order. +For example, for the Branches API: + +```golang +func NewAuthSourceClient(as AuthSource, options ...ClientOptionFunc) (*Client, error) { + ... + c.Branches = &BranchesService{client: c} + ... +} +``` + +## Step 6: Create tests + +Every endpoint function should have tests associated with it. +Tests are in a separate `go` file, using a standard naming convention, appending `_test` to the end of your API's file name. +For example, the `branches.go` endpoints have tests in `branches_test.go`. + +We are working on running the tests against a working GitLab instance. +Currently they use `mux` to mock out the HTTP responses. +Tests apply the following pattern, for example with the test for `GetBranch`: + +```golang +func TestGetBranch(t *testing.T) { + // Always ensure the test runs in parallel + t.Parallel() + // Standard setup function gives you the mux server and a test client + mux, client := setup(t) + + // Mock out the API request and response + mux.HandleFunc("/api/v4/projects/1/repository/branches/master", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + // Creating test data JSON files is optional, you can also include the JSON inline. + mustWriteHTTPResponse(t, w, "testdata/get_branch.json") + }) + + // Call the function being tested + branch, resp, err := client.Branches.GetBranch(1, "master") + + // Assert the response is as expected + assert.NoError(t, err) + assert.NotNil(t, resp) + + authoredDate := time.Date(2012, time.June, 27, 5, 51, 39, 0, time.UTC) + committedDate := time.Date(2012, time.June, 28, 3, 44, 20, 0, time.UTC) + want := &Branch{ + Name: DefaultBranch, + Merged: false, + Protected: true, + Default: true, + DevelopersCanPush: false, + DevelopersCanMerge: false, + CanPush: true, + Commit: &Commit{ + AuthorEmail: "john@example.com", + AuthorName: exampleEventUserName, + AuthoredDate: &authoredDate, + CommittedDate: &committedDate, + CommitterEmail: "john@example.com", + CommitterName: exampleEventUserName, + ID: "7b5c3cc8be40ee161ae89a06bba6229da1032a0c", + ShortID: "7b5c3cc", + Title: "add projects API", + Message: "add projects API", + ParentIDs: []string{"4ad91d3c1144c406e50c7b33bae684bd6837faf8"}, + }, + } + + assert.Equal(t, want, branch) +} +``` + +## Step 7: Validate code and generate mocks + +There are various targets in the `Makefile` for validating your code changes as you go along. +You can run `make` (without arguments) to get a list of valid make targets. + +Before you create a merge request, ensure you have run the `make reviewable` command. +This generates a mock version of the service. +Then it formats the code and tests it using a linter and by running the unit tests. +You can run each command yourself by using the other targets in the `Makefile`. + +## Step 8: Create your merge request + +We use semantic commits in this project. +Please make sure any commits you do have semantic commit prefixes. + +Create your merge request and when you are happy, request a review from one of the maintainers! +Thank you for following this tutorial and helping contribute to this project. diff --git a/dora_metrics.go b/dora_metrics.go index fd04b352..8f838241 100644 --- a/dora_metrics.go +++ b/dora_metrics.go @@ -24,14 +24,23 @@ import ( type ( // DORAMetricsServiceInterface defines all the API methods for the DORAMetricsService DORAMetricsServiceInterface interface { + // GetProjectDORAMetrics gets the DORA metrics for a project. + // + // GitLab API Docs: + // https://docs.gitlab.com/api/dora/metrics/#get-project-level-dora-metrics GetProjectDORAMetrics(pid any, opt GetDORAMetricsOptions, options ...RequestOptionFunc) ([]DORAMetric, *Response, error) + + // GetGroupDORAMetrics gets the DORA metrics for a group. + // + // GitLab API Docs: + // https://docs.gitlab.com/api/dora/metrics/#get-group-level-dora-metrics GetGroupDORAMetrics(gid any, opt GetDORAMetricsOptions, options ...RequestOptionFunc) ([]DORAMetric, *Response, error) } // DORAMetricsService handles communication with the DORA metrics related methods // of the GitLab API. // - // Gitlab API docs: https://docs.gitlab.com/api/dora/metrics/ + // GitLab API docs: https://docs.gitlab.com/api/dora/metrics/ DORAMetricsService struct { client *Client } @@ -41,7 +50,7 @@ var _ DORAMetricsServiceInterface = (*DORAMetricsService)(nil) // DORAMetric represents a single DORA metric data point. // -// Gitlab API docs: https://docs.gitlab.com/api/dora/metrics/ +// GitLab API docs: https://docs.gitlab.com/api/dora/metrics/ type DORAMetric struct { Date string `json:"date"` Value float64 `json:"value"` @@ -66,10 +75,6 @@ type GetDORAMetricsOptions struct { StartDate *ISOTime `url:"start_date,omitempty" json:"start_date,omitempty"` } -// GetProjectDORAMetrics gets the DORA metrics for a project. -// -// GitLab API Docs: -// https://docs.gitlab.com/api/dora/metrics/#get-project-level-dora-metrics func (s *DORAMetricsService) GetProjectDORAMetrics(pid any, opt GetDORAMetricsOptions, options ...RequestOptionFunc) ([]DORAMetric, *Response, error) { project, err := parseID(pid) if err != nil { @@ -91,10 +96,6 @@ func (s *DORAMetricsService) GetProjectDORAMetrics(pid any, opt GetDORAMetricsOp return metrics, resp, err } -// GetGroupDORAMetrics gets the DORA metrics for a group. -// -// GitLab API Docs: -// https://docs.gitlab.com/api/dora/metrics/#get-group-level-dora-metrics func (s *DORAMetricsService) GetGroupDORAMetrics(gid any, opt GetDORAMetricsOptions, options ...RequestOptionFunc) ([]DORAMetric, *Response, error) { group, err := parseID(gid) if err != nil { diff --git a/draft_notes.go b/draft_notes.go index 178e4207..321498dc 100644 --- a/draft_notes.go +++ b/draft_notes.go @@ -24,12 +24,46 @@ import ( type ( // DraftNotesServiceInterface defines all the API methods for the DraftNotesService DraftNotesServiceInterface interface { + // ListDraftNotes gets a list of all draft notes for a merge request. + // + // GitLab API docs: + // https://docs.gitlab.com/api/draft_notes/#list-all-merge-request-draft-notes 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 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 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 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 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 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 int64, options ...RequestOptionFunc) (*Response, error) } @@ -68,10 +102,6 @@ type ListDraftNotesOptions struct { Sort *string `url:"sort,omitempty" json:"sort,omitempty"` } -// ListDraftNotes gets a list of all draft notes for a merge request. -// -// Gitlab API docs: -// https://docs.gitlab.com/api/draft_notes/#list-all-merge-request-draft-notes func (s *DraftNotesService) ListDraftNotes(pid any, mergeRequest int64, opt *ListDraftNotesOptions, options ...RequestOptionFunc) ([]*DraftNote, *Response, error) { project, err := parseID(pid) if err != nil { @@ -93,10 +123,6 @@ func (s *DraftNotesService) ListDraftNotes(pid any, mergeRequest int64, opt *Lis return n, resp, nil } -// 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 func (s *DraftNotesService) GetDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*DraftNote, *Response, error) { project, err := parseID(pid) if err != nil { @@ -121,7 +147,7 @@ func (s *DraftNotesService) GetDraftNote(pid any, mergeRequest int64, note int64 // CreateDraftNoteOptions represents the available CreateDraftNote() // 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"` @@ -131,10 +157,6 @@ type CreateDraftNoteOptions struct { Position *PositionOptions `url:"position,omitempty" json:"position,omitempty"` } -// CreateDraftNote creates a draft note for a merge request. -// -// Gitlab API docs: -// https://docs.gitlab.com/api/draft_notes/#create-a-draft-note func (s *DraftNotesService) CreateDraftNote(pid any, mergeRequest int64, opt *CreateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) { project, err := parseID(pid) if err != nil { @@ -159,16 +181,13 @@ func (s *DraftNotesService) CreateDraftNote(pid any, mergeRequest int64, opt *Cr // UpdateDraftNoteOptions represents the available UpdateDraftNote() // 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"` } -// UpdateDraftNote updates a draft note for a merge request. -// -// Gitlab API docs: https://docs.gitlab.com/api/draft_notes/#create-a-draft-note func (s *DraftNotesService) UpdateDraftNote(pid any, mergeRequest int64, note int64, opt *UpdateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) { project, err := parseID(pid) if err != nil { @@ -190,10 +209,6 @@ func (s *DraftNotesService) UpdateDraftNote(pid any, mergeRequest int64, note in return n, resp, nil } -// DeleteDraftNote deletes a single draft note for a merge request. -// -// Gitlab API docs: -// https://docs.gitlab.com/api/draft_notes/#delete-a-draft-note func (s *DraftNotesService) DeleteDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -209,10 +224,6 @@ func (s *DraftNotesService) DeleteDraftNote(pid any, mergeRequest int64, note in return s.client.Do(req, nil) } -// PublishDraftNote publishes a single draft note for a merge request. -// -// Gitlab API docs: -// https://docs.gitlab.com/api/draft_notes/#publish-a-draft-note func (s *DraftNotesService) PublishDraftNote(pid any, mergeRequest int64, note int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { @@ -228,10 +239,6 @@ func (s *DraftNotesService) PublishDraftNote(pid any, mergeRequest int64, note i return s.client.Do(req, nil) } -// 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 func (s *DraftNotesService) PublishAllDraftNotes(pid any, mergeRequest int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { diff --git a/enterprise_users.go b/enterprise_users.go index 098758c0..0aa547b2 100644 --- a/enterprise_users.go +++ b/enterprise_users.go @@ -25,6 +25,7 @@ type ( ListEnterpriseUsers(gid any, opt *ListEnterpriseUsersOptions, options ...RequestOptionFunc) ([]*User, *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 int, deleteOptions *DeleteEnterpriseUserOptions, options ...RequestOptionFunc) (*Response, error) } // EnterpriseUsersService handles communication with the enterprise users @@ -123,3 +124,30 @@ func (s *EnterpriseUsersService) Disable2FAForEnterpriseUser(gid any, uid int64, return s.client.Do(req, nil) } + +// DeleteEnterpriseUserOptions represents the available DeleteEnterpriseUser options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/group_enterprise_users/#delete-an-enterprise-user +type DeleteEnterpriseUserOptions struct { + HardDelete *bool `url:"hard_delete,omitempty" json:"hard_delete,omitempty"` +} + +// 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 int, opt *DeleteEnterpriseUserOptions, options ...RequestOptionFunc) (*Response, error) { + group, err := parseID(gid) + if err != nil { + return nil, err + } + u := fmt.Sprintf("groups/%s/enterprise_users/%d", PathEscape(group), uid) + + req, err := s.client.NewRequest(http.MethodDelete, u, opt, options) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} diff --git a/enterprise_users_test.go b/enterprise_users_test.go index 6cbc0e3c..773d3aae 100644 --- a/enterprise_users_test.go +++ b/enterprise_users_test.go @@ -163,3 +163,21 @@ func TestEnterpriseUsers_Disable2FAForEnterpriseUser(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, resp) } + +func TestEnterpriseUsers_DeleteEnterpriseUser(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/groups/1/enterprise_users/66", func(w http.ResponseWriter, r *http.Request) { + testURL(t, r, "/api/v4/groups/1/enterprise_users/66?hard_delete=true") + testMethod(t, r, http.MethodDelete) + w.WriteHeader(http.StatusNoContent) + }) + + hard := true + resp, err := client.EnterpriseUsers.DeleteEnterpriseUser(1, 66, &DeleteEnterpriseUserOptions{HardDelete: &hard}) + + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.Equal(t, http.StatusNoContent, resp.StatusCode) +} diff --git a/event_parsing_systemhook_test.go b/event_parsing_systemhook_test.go index 0ca8a484..38f43698 100644 --- a/event_parsing_systemhook_test.go +++ b/event_parsing_systemhook_test.go @@ -100,6 +100,8 @@ func TestParseSystemhookProject(t *testing.T) { } for _, tc := range tests { t.Run(tc.event, func(t *testing.T) { + t.Parallel() + parsedEvent, err := ParseSystemhook(tc.payload) if err != nil { t.Errorf("Error parsing build hook: %s", err) @@ -125,6 +127,8 @@ func TestParseSystemhookGroup(t *testing.T) { } for _, tc := range tests { t.Run(tc.event, func(t *testing.T) { + t.Parallel() + parsedEvent, err := ParseSystemhook(tc.payload) if err != nil { t.Errorf("Error parsing build hook: %s", err) @@ -151,6 +155,8 @@ func TestParseSystemhookUser(t *testing.T) { } for _, tc := range tests { t.Run(tc.event, func(t *testing.T) { + t.Parallel() + parsedEvent, err := ParseSystemhook(tc.payload) if err != nil { t.Errorf("Error parsing build hook: %s", err) @@ -176,6 +182,8 @@ func TestParseSystemhookUserGroup(t *testing.T) { } for _, tc := range tests { t.Run(tc.event, func(t *testing.T) { + t.Parallel() + parsedEvent, err := ParseSystemhook(tc.payload) if err != nil { t.Errorf("Error parsing build hook: %s", err) @@ -201,6 +209,8 @@ func TestParseSystemhookUserTeam(t *testing.T) { } for _, tc := range tests { t.Run(tc.event, func(t *testing.T) { + t.Parallel() + parsedEvent, err := ParseSystemhook(tc.payload) if err != nil { t.Errorf("Error parsing build hook: %s", err) diff --git a/gitlab.go b/gitlab.go index 0f86dd3e..ceafc6d4 100644 --- a/gitlab.go +++ b/gitlab.go @@ -28,6 +28,7 @@ import ( "math" "math/rand" "mime/multipart" + "net" "net/http" "net/url" "sort" @@ -204,6 +205,7 @@ type Client struct { MergeTrains MergeTrainsServiceInterface Metadata MetadataServiceInterface Milestones MilestonesServiceInterface + ModelRegistry ModelRegistryServiceInterface Namespaces NamespacesServiceInterface Notes NotesServiceInterface NotificationSettings NotificationSettingsServiceInterface @@ -216,6 +218,7 @@ type Client struct { Pipelines PipelinesServiceInterface PlanLimits PlanLimitsServiceInterface ProjectAccessTokens ProjectAccessTokensServiceInterface + ProjectAliases ProjectAliasesServiceInterface ProjectBadges ProjectBadgesServiceInterface ProjectCluster ProjectClustersServiceInterface ProjectFeatureFlags ProjectFeatureFlagServiceInterface @@ -227,12 +230,14 @@ type Client struct { ProjectRepositoryStorageMove ProjectRepositoryStorageMoveServiceInterface ProjectSecuritySettings ProjectSecuritySettingsServiceInterface ProjectSnippets ProjectSnippetsServiceInterface + ProjectStatistics ProjectStatisticsServiceInterface ProjectTemplates ProjectTemplatesServiceInterface ProjectVariables ProjectVariablesServiceInterface ProjectVulnerabilities ProjectVulnerabilitiesServiceInterface Projects ProjectsServiceInterface ProtectedBranches ProtectedBranchesServiceInterface ProtectedEnvironments ProtectedEnvironmentsServiceInterface + ProtectedPackages ProtectedPackagesServiceInterface ProtectedTags ProtectedTagsServiceInterface ReleaseLinks ReleaseLinksServiceInterface Releases ReleasesServiceInterface @@ -511,6 +516,7 @@ func NewAuthSourceClient(as AuthSource, options ...ClientOptionFunc) (*Client, e c.MergeTrains = &MergeTrainsService{client: c} c.Metadata = &MetadataService{client: c} c.Milestones = &MilestonesService{client: c} + c.ModelRegistry = &ModelRegistryService{client: c} c.Namespaces = &NamespacesService{client: c} c.Notes = &NotesService{client: c} c.NotificationSettings = &NotificationSettingsService{client: c} @@ -523,6 +529,7 @@ func NewAuthSourceClient(as AuthSource, options ...ClientOptionFunc) (*Client, e c.Pipelines = &PipelinesService{client: c} c.PlanLimits = &PlanLimitsService{client: c} c.ProjectAccessTokens = &ProjectAccessTokensService{client: c} + c.ProjectAliases = &ProjectAliasesService{client: c} c.ProjectBadges = &ProjectBadgesService{client: c} c.ProjectCluster = &ProjectClustersService{client: c} c.ProjectFeatureFlags = &ProjectFeatureFlagService{client: c} @@ -534,12 +541,14 @@ func NewAuthSourceClient(as AuthSource, options ...ClientOptionFunc) (*Client, e c.ProjectRepositoryStorageMove = &ProjectRepositoryStorageMoveService{client: c} c.ProjectSecuritySettings = &ProjectSecuritySettingsService{client: c} c.ProjectSnippets = &ProjectSnippetsService{client: c} + c.ProjectStatistics = &ProjectStatisticsService{client: c} c.ProjectTemplates = &ProjectTemplatesService{client: c} c.ProjectVariables = &ProjectVariablesService{client: c} c.ProjectVulnerabilities = &ProjectVulnerabilitiesService{client: c} c.Projects = &ProjectsService{client: c} c.ProtectedBranches = &ProtectedBranchesService{client: c} c.ProtectedEnvironments = &ProtectedEnvironmentsService{client: c} + c.ProtectedPackages = &ProtectedPackagesService{client: c} c.ProtectedTags = &ProtectedTagsService{client: c} c.ReleaseLinks = &ReleaseLinksService{client: c} c.Releases = &ReleasesService{client: c} @@ -593,17 +602,100 @@ func (c *Client) HTTPClient() *http.Client { } // retryHTTPCheck provides a callback for Client.CheckRetry which -// will retry both rate limit (429) and server (>= 500) errors. +// respects default retries and retries what is safe to retry. func (c *Client) retryHTTPCheck(ctx context.Context, resp *http.Response, err error) (bool, error) { + // do not retry if retries are disabled completely + if c.disableRetries { + return false, nil + } + + // do not retry on context.Canceled or context.DeadlineExceeded if ctx.Err() != nil { return false, ctx.Err() } + if err != nil { - return false, err + // We should be able to retry requests with assumed idempotent HTTP methods. + // In a future iteration we might want to annotate requests that are idempotent + // to further improve this logic here. + if resp != nil && resp.Request != nil { + switch resp.Request.Method { + case http.MethodConnect, http.MethodOptions, http.MethodTrace, http.MethodHead, http.MethodGet: + return true, nil + } + } + + // Only retry errors that we know happened before writing to the wire + var urlErr *url.Error + var netOpErr *net.OpError + var dnsErr *net.DNSError + // see Go src/net/http/transport.go + var potentialTLSHandshakeErr interface { + Timeout() bool + Temporary() bool + } + + switch { + // DNS errors are safe - they happen before any connection + case errors.As(err, &dnsErr): + // NXDOMAIN should not be retried + if dnsErr.IsNotFound { + return false, err + } + // Other DNS errors are safe to retry + return true, nil + + // Direct net.OpError for dial operations + case errors.As(err, &netOpErr): + // from the comments in the implementation of net.OpError.Temporary + // it seems that it's safe to retry temporary OpErrors. + if netOpErr.Temporary() { + return true, nil + } + + if strings.EqualFold(netOpErr.Op, "dial") { + return true, nil + } + + // Connection refused errors are safe - they happen at TCP establishment + case errors.As(err, &urlErr): + if strings.Contains(urlErr.Error(), "connection refused") { + return true, nil + } + + // TLS handshake errors are safe if we can identify them + case errors.As(err, &potentialTLSHandshakeErr): + // Check if this is a TLS handshake timeout specifically + if strings.Contains(err.Error(), "net/http: TLS handshake timeout") { + return true, nil + } + } + + // we are conservative here and do not want to retry any "unknown" errors, because + // they could have happened when the connection was already established and the request + // partially fulfilled. We don't have the insights here if the request + // was idempotent or not, so we reject a retry. + return false, nil } - if !c.disableRetries && (resp.StatusCode == 429 || resp.StatusCode >= 500) { + + // 429 Too Many Requests is recoverable. Sometimes the server puts + // a Retry-After response header to indicate when the server is + // available to start processing request from client. + if resp.StatusCode == http.StatusTooManyRequests { return true, nil } + + // Check the response code. We retry on 500-range responses to allow + // the server time to recover, as 500's are typically not permanent + // errors and may relate to outages on the server side. This will catch + // invalid response codes as well, like 0 and 999. + // Status code 0 is especially important for AWS ALB: + // https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html#response-code-000 + if resp.StatusCode == 0 || (resp.StatusCode >= 500 && resp.StatusCode != http.StatusNotImplemented) { + // return true, fmt.Errorf("unexpected HTTP status %s", resp.Status) + return true, nil + } + return false, nil } diff --git a/gitlab_service_map_generated_test.go b/gitlab_service_map_generated_test.go index f94ef095..a9fd7499 100644 --- a/gitlab_service_map_generated_test.go +++ b/gitlab_service_map_generated_test.go @@ -89,6 +89,7 @@ var serviceMap = map[any]any{ &MergeTrainsService{}: (*MergeTrainsServiceInterface)(nil), &MetadataService{}: (*MetadataServiceInterface)(nil), &MilestonesService{}: (*MilestonesServiceInterface)(nil), + &ModelRegistryService{}: (*ModelRegistryServiceInterface)(nil), &NamespacesService{}: (*NamespacesServiceInterface)(nil), &NotesService{}: (*NotesServiceInterface)(nil), &NotificationSettingsService{}: (*NotificationSettingsServiceInterface)(nil), @@ -101,6 +102,7 @@ var serviceMap = map[any]any{ &PipelinesService{}: (*PipelinesServiceInterface)(nil), &PlanLimitsService{}: (*PlanLimitsServiceInterface)(nil), &ProjectAccessTokensService{}: (*ProjectAccessTokensServiceInterface)(nil), + &ProjectAliasesService{}: (*ProjectAliasesServiceInterface)(nil), &ProjectBadgesService{}: (*ProjectBadgesServiceInterface)(nil), &ProjectClustersService{}: (*ProjectClustersServiceInterface)(nil), &ProjectFeatureFlagService{}: (*ProjectFeatureFlagServiceInterface)(nil), @@ -112,12 +114,14 @@ var serviceMap = map[any]any{ &ProjectRepositoryStorageMoveService{}: (*ProjectRepositoryStorageMoveServiceInterface)(nil), &ProjectSecuritySettingsService{}: (*ProjectSecuritySettingsServiceInterface)(nil), &ProjectSnippetsService{}: (*ProjectSnippetsServiceInterface)(nil), + &ProjectStatisticsService{}: (*ProjectStatisticsServiceInterface)(nil), &ProjectTemplatesService{}: (*ProjectTemplatesServiceInterface)(nil), &ProjectVariablesService{}: (*ProjectVariablesServiceInterface)(nil), &ProjectVulnerabilitiesService{}: (*ProjectVulnerabilitiesServiceInterface)(nil), &ProjectsService{}: (*ProjectsServiceInterface)(nil), &ProtectedBranchesService{}: (*ProtectedBranchesServiceInterface)(nil), &ProtectedEnvironmentsService{}: (*ProtectedEnvironmentsServiceInterface)(nil), + &ProtectedPackagesService{}: (*ProtectedPackagesServiceInterface)(nil), &ProtectedTagsService{}: (*ProtectedTagsServiceInterface)(nil), &ReleaseLinksService{}: (*ReleaseLinksServiceInterface)(nil), &ReleasesService{}: (*ReleasesServiceInterface)(nil), diff --git a/gitlab_test.go b/gitlab_test.go index 303c7f2e..caca07c7 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -22,12 +22,14 @@ import ( "errors" "fmt" "io" + "net" "net/http" "net/http/cookiejar" "net/http/httptest" "net/url" "os" "reflect" + "strconv" "strings" "testing" "time" @@ -847,6 +849,8 @@ func TestNewAuthSourceClient(t *testing.T) { } func TestHasStatusCode(t *testing.T) { + t.Parallel() + // GIVEN tests := []struct { name string @@ -888,6 +892,8 @@ func TestHasStatusCode(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() + // WHEN actual := HasStatusCode(tt.err, tt.hasStatusCode) @@ -898,6 +904,8 @@ func TestHasStatusCode(t *testing.T) { } func TestNewRequestToURL_disallowedURL(t *testing.T) { + t.Parallel() + // GIVEN tests := []struct { name string @@ -923,6 +931,8 @@ func TestNewRequestToURL_disallowedURL(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() + u, err := url.Parse(tt.url) require.NoError(t, err) @@ -934,6 +944,8 @@ func TestNewRequestToURL_disallowedURL(t *testing.T) { } func TestNewRequestToURL_allowedURL(t *testing.T) { + t.Parallel() + // GIVEN tests := []struct { url string @@ -952,6 +964,8 @@ func TestNewRequestToURL_allowedURL(t *testing.T) { for _, tt := range tests { t.Run(tt.url, func(t *testing.T) { + t.Parallel() + u, err := url.Parse(tt.url) require.NoError(t, err) @@ -1017,11 +1031,15 @@ func TestWithInterceptor(t *testing.T) { t.Parallel() t.Run("when nil interceptor has been passed, then it will result in an error", func(t *testing.T) { + t.Parallel() + _, err := NewClient("", WithInterceptor(nil)) require.Error(t, err) }) t.Run("when interceptor option is provided, then it is used in the client as part of the http round tripping of the transportation", func(t *testing.T) { + t.Parallel() + client, err := NewClient("", WithInterceptor(func(next http.RoundTripper) http.RoundTripper { assert.NotNil(t, next, "it was expected that the next middleware is not empty, most likely being the default transport in worse case scenario") @@ -1039,6 +1057,8 @@ func TestWithInterceptor(t *testing.T) { }) t.Run("enables request manipulation", func(t *testing.T) { + t.Parallel() + client, err := NewClient("", WithInterceptor(func(next http.RoundTripper) http.RoundTripper { assert.NotNil(t, next, "it was expected that the next middleware is not empty, most likely being the default transport in worse case scenario") @@ -1066,6 +1086,8 @@ func TestWithInterceptor(t *testing.T) { }) t.Run("ordering aligned to how interceptors are provided, as this makes it easier to read a option setup", func(t *testing.T) { + t.Parallel() + var ordering []int client, err := NewClient("", WithInterceptor(func(next http.RoundTripper) http.RoundTripper { @@ -1097,6 +1119,8 @@ func TestWithInterceptor(t *testing.T) { }) t.Run("e2e", func(t *testing.T) { + t.Parallel() + const endpoint = "/api/v4/user" mux := http.NewServeMux() @@ -1136,3 +1160,326 @@ type StubRoundTripper func(r *http.Request) (*http.Response, error) func (fn StubRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { return fn(r) } + +func TestClient_DefaultRetryPolicy_RetryOnStatusCodes(t *testing.T) { + t.Parallel() + + tests := []struct { + statusCode int + expectedRetry bool + expectedError bool + }{ + // We can't write an invalid status code. See RetryOnZeroStatusCode test + // { + // statusCode: 0, + // expectedRetry: true, + // }, + { + statusCode: http.StatusOK, + expectedRetry: false, + expectedError: false, + }, + { + statusCode: http.StatusNotImplemented, + expectedRetry: false, + expectedError: true, + }, + { + statusCode: http.StatusBadRequest, + expectedRetry: false, + expectedError: true, + }, + { + statusCode: http.StatusTooManyRequests, + expectedRetry: true, + expectedError: true, + }, + } + + for _, tt := range tests { + t.Run(strconv.Itoa(tt.statusCode), func(t *testing.T) { + t.Parallel() + + // GIVEN + retries := 0 + mux := http.NewServeMux() + mux.HandleFunc("/api/v4/user", func(w http.ResponseWriter, r *http.Request) { + retries++ + + w.WriteHeader(tt.statusCode) + w.Write([]byte(`{}`)) + }) + server := httptest.NewServer(mux) + t.Cleanup(server.Close) + + client, err := NewClient( + "", + WithBaseURL(server.URL), + WithHTTPClient(server.Client()), + WithCustomRetryMax(1), + ) + require.NoError(t, err) + + // WHEN + _, resp, err := client.Users.CurrentUser() + + // THEN + if tt.expectedError { + require.Error(t, err) + assert.True(t, HasStatusCode(err, tt.statusCode)) + } else { + require.NoError(t, err) + assert.Equal(t, tt.statusCode, resp.StatusCode) + } + + if tt.expectedRetry { + assert.Equal(t, 2, retries, "Expected 2 retries, got %d", retries) + } else { + assert.Equal(t, 1, retries, "Didn't expect a retry to happen, but endpoint counter indicates that the request has been retried") + } + }) + } +} + +func TestClient_DefaultRetryPolicy_RetryOnIdempotentRequests_ByMethod(t *testing.T) { + t.Parallel() + + tests := []struct { + method string + expectedRetry bool + }{ + { + method: http.MethodGet, + expectedRetry: true, + }, + { + method: http.MethodPost, + expectedRetry: false, + }, + } + + for _, tt := range tests { + t.Run(tt.method, func(t *testing.T) { + t.Parallel() + + // GIVEN + client, err := NewClient( + "", + WithCustomRetryMax(1), + ) + require.NoError(t, err) + + // WHEN + retry, err := client.retryHTTPCheck(context.Background(), &http.Response{Request: &http.Request{Method: tt.method}}, errors.New("dummy")) + + // THEN + assert.Equal(t, tt.expectedRetry, retry) + assert.NoError(t, err) + }) + } +} + +// TestClient_DefaultRetryPolicy_RetryOnZeroStatusCode tests retry for status code 0 +// +// We test for this bogus status code because of AWS ALB, see: +// https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html#response-code-000 +func TestClient_DefaultRetryPolicy_RetryOnZeroStatusCode(t *testing.T) { + t.Parallel() + + // GIVEN + client, err := NewClient( + "", + ) + require.NoError(t, err) + + // WHEN + retry, err := client.retryHTTPCheck(context.Background(), &http.Response{StatusCode: 0}, nil) + + // THEN + assert.True(t, retry) + assert.NoError(t, err) +} + +func TestClient_DefaultRetryPolicy_RetryOnNetworkErrors(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + err error + expectedRetry bool + }{ + { + name: "DNS error - NXDOMAIN should not retry", + err: &net.DNSError{Err: "no such host", IsNotFound: true}, + expectedRetry: false, + }, + { + name: "DNS error - temporary DNS error should retry", + err: &net.DNSError{Err: "temporary failure", IsTimeout: true}, + expectedRetry: true, + }, + { + name: "DNS error - other DNS error should retry", + err: &net.DNSError{Err: "server failure"}, + expectedRetry: true, + }, + { + name: "OpError - temporary error should retry", + err: &net.OpError{Op: "read", Net: "tcp", Err: &mockTemporaryError{temporary: true}}, + expectedRetry: true, + }, + { + name: "OpError - dial operation should retry", + err: &net.OpError{Op: "dial", Net: "tcp", Err: errors.New("connection failed")}, + expectedRetry: true, + }, + { + name: "OpError - non-temporary, non-dial should not retry", + err: &net.OpError{Op: "write", Net: "tcp", Err: errors.New("broken pipe")}, + expectedRetry: false, + }, + { + name: "URL error - connection refused should retry", + err: &url.Error{Op: "Get", URL: "http://example.com", Err: errors.New("connection refused")}, + expectedRetry: true, + }, + { + name: "URL error - other URL error should not retry", + err: &url.Error{Op: "Get", URL: "http://example.com", Err: errors.New("other error")}, + expectedRetry: false, + }, + { + name: "TLS handshake timeout should retry", + err: &mockTLSHandshakeError{msg: "net/http: TLS handshake timeout"}, + expectedRetry: true, + }, + { + name: "Other TLS error should not retry", + err: &mockTLSHandshakeError{msg: "tls: bad certificate"}, + expectedRetry: false, + }, + { + name: "Unknown error should not retry (conservative)", + err: errors.New("unknown network error"), + expectedRetry: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + // GIVEN + client, err := NewClient("") + require.NoError(t, err) + + // Create a mock response with POST method (non-idempotent) to test error-specific logic + // For idempotent methods like GET, the retry logic returns true immediately for any error + resp := &http.Response{ + Request: &http.Request{Method: http.MethodPost}, + } + + // WHEN + retry, err := client.retryHTTPCheck(context.Background(), resp, tt.err) + + // THEN + assert.Equal(t, tt.expectedRetry, retry, "Expected retry=%v for error: %v", tt.expectedRetry, tt.err) + if tt.expectedRetry { + assert.NoError(t, err) + } + }) + } +} + +func TestClient_DefaultRetryPolicy_ContextCancellation(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + ctx func() context.Context + }{ + { + name: "context canceled", + ctx: func() context.Context { + ctx, cancel := context.WithCancel(context.Background()) + cancel() + return ctx + }, + }, + { + name: "context deadline exceeded", + ctx: func() context.Context { + ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(-time.Hour)) + defer cancel() + return ctx + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + // GIVEN + client, err := NewClient("") + require.NoError(t, err) + + ctx := tt.ctx() + + // WHEN + retry, err := client.retryHTTPCheck(ctx, nil, errors.New("some error")) + + // THEN + assert.False(t, retry) + assert.Equal(t, ctx.Err(), err) + }) + } +} + +func TestClient_DefaultRetryPolicy_RetriesDisabled(t *testing.T) { + t.Parallel() + + // GIVEN + client, err := NewClient("", WithCustomRetryMax(0)) + require.NoError(t, err) + + // Manually disable retries to test this specific path + client.disableRetries = true + + // WHEN + retry, err := client.retryHTTPCheck(context.Background(), nil, errors.New("some error")) + + // THEN + assert.False(t, retry) + assert.NoError(t, err) +} + +// mockTemporaryError implements a temporary error for testing +type mockTemporaryError struct { + temporary bool +} + +func (e *mockTemporaryError) Error() string { + return "mock temporary error" +} + +func (e *mockTemporaryError) Temporary() bool { + return e.temporary +} + +// mockTLSHandshakeError implements an error that looks like a TLS handshake error +type mockTLSHandshakeError struct { + msg string +} + +func (e *mockTLSHandshakeError) Error() string { + return e.msg +} + +func (e *mockTLSHandshakeError) Timeout() bool { + return strings.Contains(e.msg, "timeout") +} + +func (e *mockTLSHandshakeError) Temporary() bool { + return strings.Contains(e.msg, "timeout") +} diff --git a/gitlaboauth2/callback_server_test.go b/gitlaboauth2/callback_server_test.go index 659446e0..d6c1db78 100644 --- a/gitlaboauth2/callback_server_test.go +++ b/gitlaboauth2/callback_server_test.go @@ -16,7 +16,11 @@ import ( ) func TestBrowserFunc(t *testing.T) { + t.Parallel() + t.Run("successful browser function call", func(t *testing.T) { + t.Parallel() + called := false var capturedURL string @@ -35,6 +39,8 @@ func TestBrowserFunc(t *testing.T) { }) t.Run("browser function returns error", func(t *testing.T) { + t.Parallel() + expectedError := errors.New("browser failed to open") browserFunc := BrowserFunc(func(url string) error { @@ -48,8 +54,8 @@ func TestBrowserFunc(t *testing.T) { }) } -func TestNewCallbackServer(t *testing.T) { - t.Run("creates callback server with valid parameters", func(t *testing.T) { +func TestNewCallbackServer(t *testing.T) { //nolint:paralleltest + t.Run("creates callback server with valid parameters", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -67,7 +73,7 @@ func TestNewCallbackServer(t *testing.T) { assert.NotNil(t, server.browser) }) - t.Run("creates callback server with nil browser function", func(t *testing.T) { + t.Run("creates callback server with nil browser function", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -81,8 +87,8 @@ func TestNewCallbackServer(t *testing.T) { }) } -func TestCallbackServer_GetToken(t *testing.T) { - t.Run("successful token retrieval", func(t *testing.T) { +func TestCallbackServer_GetToken(t *testing.T) { //nolint:paralleltest + t.Run("successful token retrieval", func(t *testing.T) { //nolint:paralleltest // Create a test server to mock the OAuth2 provider mockProvider := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Mock token exchange endpoint @@ -150,7 +156,7 @@ func TestCallbackServer_GetToken(t *testing.T) { assert.Contains(t, capturedURL, "state") }) - t.Run("context timeout", func(t *testing.T) { + t.Run("context timeout", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:9999/auth/redirect", @@ -173,7 +179,7 @@ func TestCallbackServer_GetToken(t *testing.T) { assert.Equal(t, context.DeadlineExceeded, err) }) - t.Run("browser function fails", func(t *testing.T) { + t.Run("browser function fails", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:9999/auth/redirect", @@ -196,7 +202,7 @@ func TestCallbackServer_GetToken(t *testing.T) { assert.Contains(t, err.Error(), "failed to open browser") }) - t.Run("invalid redirect URL", func(t *testing.T) { + t.Run("invalid redirect URL", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "://invalid-url", @@ -215,7 +221,7 @@ func TestCallbackServer_GetToken(t *testing.T) { assert.Contains(t, err.Error(), "missing protocol scheme") }) - t.Run("server fails to start", func(t *testing.T) { + t.Run("server fails to start", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -237,8 +243,8 @@ func TestCallbackServer_GetToken(t *testing.T) { }) } -func TestCallbackServer_CallbackHandler(t *testing.T) { - t.Run("successful callback with valid code and state", func(t *testing.T) { +func TestCallbackServer_CallbackHandler(t *testing.T) { //nolint:paralleltest + t.Run("successful callback with valid code and state", func(t *testing.T) { //nolint:paralleltest // Create a test server to mock the OAuth2 provider mockProvider := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/oauth/token" { @@ -295,7 +301,7 @@ func TestCallbackServer_CallbackHandler(t *testing.T) { assert.Equal(t, "text/html", w.Header().Get("Content-Type")) }) - t.Run("callback with invalid state", func(t *testing.T) { + t.Run("callback with invalid state", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -333,7 +339,7 @@ func TestCallbackServer_CallbackHandler(t *testing.T) { assert.Contains(t, w.Body.String(), "invalid state") }) - t.Run("callback with missing authorization code", func(t *testing.T) { + t.Run("callback with missing authorization code", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -371,7 +377,7 @@ func TestCallbackServer_CallbackHandler(t *testing.T) { assert.Contains(t, w.Body.String(), "no authorization code received") }) - t.Run("callback with OAuth error", func(t *testing.T) { + t.Run("callback with OAuth error", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -409,7 +415,7 @@ func TestCallbackServer_CallbackHandler(t *testing.T) { assert.Contains(t, w.Body.String(), "authorization error: access_denied") }) - t.Run("token exchange fails", func(t *testing.T) { + t.Run("token exchange fails", func(t *testing.T) { //nolint:paralleltest // Create a test server that returns an error mockProvider := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/oauth/token" { @@ -459,8 +465,8 @@ func TestCallbackServer_CallbackHandler(t *testing.T) { }) } -func TestCallbackServer_Shutdown(t *testing.T) { - t.Run("shutdown with no server", func(t *testing.T) { +func TestCallbackServer_Shutdown(t *testing.T) { //nolint:paralleltest + t.Run("shutdown with no server", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -474,7 +480,7 @@ func TestCallbackServer_Shutdown(t *testing.T) { }) }) - t.Run("shutdown with running server", func(t *testing.T) { + t.Run("shutdown with running server", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -495,8 +501,8 @@ func TestCallbackServer_Shutdown(t *testing.T) { }) } -func TestCallbackServer_EdgeCases(t *testing.T) { - t.Run("handles malformed callback URLs", func(t *testing.T) { +func TestCallbackServer_EdgeCases(t *testing.T) { //nolint:paralleltest + t.Run("handles malformed callback URLs", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -519,7 +525,7 @@ func TestCallbackServer_EdgeCases(t *testing.T) { }) }) - t.Run("handles empty query parameters", func(t *testing.T) { + t.Run("handles empty query parameters", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -550,7 +556,7 @@ func TestCallbackServer_EdgeCases(t *testing.T) { } }) - t.Run("handles context cancellation", func(t *testing.T) { + t.Run("handles context cancellation", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:9999/auth/redirect", @@ -576,8 +582,8 @@ func TestCallbackServer_EdgeCases(t *testing.T) { }) } -func TestCallbackServer_ErrorHandling(t *testing.T) { - t.Run("handles server startup failure gracefully", func(t *testing.T) { +func TestCallbackServer_ErrorHandling(t *testing.T) { //nolint:paralleltest + t.Run("handles server startup failure gracefully", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -597,7 +603,7 @@ func TestCallbackServer_ErrorHandling(t *testing.T) { assert.Nil(t, token) }) - t.Run("handles missing state parameter", func(t *testing.T) { + t.Run("handles missing state parameter", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", @@ -630,7 +636,7 @@ func TestCallbackServer_ErrorHandling(t *testing.T) { assert.Equal(t, http.StatusBadRequest, w.Code) }) - t.Run("handles multiple error parameters in callback", func(t *testing.T) { + t.Run("handles multiple error parameters in callback", func(t *testing.T) { //nolint:paralleltest config := &oauth2.Config{ ClientID: "test-client-id", RedirectURL: "http://localhost:7171/auth/redirect", diff --git a/go.mod b/go.mod index 83567c41..6ca0179c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module gitlab.com/gitlab-org/api/client-go go 1.24 require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.9-20250912141014-52f32327d4b0.1 + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.10-20250912141014-52f32327d4b0.1 buf.build/go/protovalidate v0.14.0 buf.build/go/protoyaml v0.6.0 github.com/MakeNowJust/heredoc/v2 v2.0.1 @@ -13,9 +13,10 @@ require ( github.com/stretchr/testify v1.11.1 github.com/zalando/go-keyring v0.2.6 go.uber.org/mock v0.6.0 + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 golang.org/x/oauth2 v0.30.0 golang.org/x/time v0.12.0 - google.golang.org/protobuf v1.36.9 + google.golang.org/protobuf v1.36.10 gopkg.in/yaml.v3 v3.0.1 ) @@ -23,13 +24,12 @@ require ( al.essio.dev/pkg/shellescape v1.6.0 // indirect cel.dev/expr v0.24.0 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/danieljoos/wincred v1.2.2 // indirect + github.com/danieljoos/wincred v1.2.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/google/cel-go v0.26.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stoewer/go-strcase v1.3.1 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/sys v0.34.0 // indirect golang.org/x/text v0.28.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 // indirect diff --git a/go.sum b/go.sum index 7f4aa101..dfac1fe3 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ al.essio.dev/pkg/shellescape v1.6.0 h1:NxFcEqzFSEVCGN2yq7Huv/9hyCEGVa/TncnOOBBeXHA= al.essio.dev/pkg/shellescape v1.6.0/go.mod h1:6sIqp7X2P6mThCQ7twERpZTuigpr6KbZWtls1U8I890= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.9-20250912141014-52f32327d4b0.1 h1:DQLS/rRxLHuugVzjJU5AvOwD57pdFl9he/0O7e5P294= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.9-20250912141014-52f32327d4b0.1/go.mod h1:aY3zbkNan5F+cGm9lITDP6oxJIwu0dn9KjJuJjWaHkg= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.10-20250912141014-52f32327d4b0.1 h1:31on4W/yPcV4nZHL4+UCiCvLPsMqe/vJcNg8Rci0scc= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.10-20250912141014-52f32327d4b0.1/go.mod h1:fUl8CEN/6ZAMk6bP8ahBJPUJw7rbp+j4x+wCcYi2IG4= buf.build/go/protovalidate v0.14.0 h1:kr/rC/no+DtRyYX+8KXLDxNnI1rINz0imk5K44ZpZ3A= buf.build/go/protovalidate v0.14.0/go.mod h1:+F/oISho9MO7gJQNYC2VWLzcO1fTPmaTA08SDYJZncA= buf.build/go/protoyaml v0.6.0 h1:Nzz1lvcXF8YgNZXk+voPPwdU8FjDPTUV4ndNTXN0n2w= @@ -12,8 +12,8 @@ github.com/MakeNowJust/heredoc/v2 v2.0.1 h1:rlCHh70XXXv7toz95ajQWOWQnN4WNLt0TdpZ github.com/MakeNowJust/heredoc/v2 v2.0.1/go.mod h1:6/2Abh5s+hc3g9nbWLe9ObDIOhaRrqsyY9MWy+4JdRM= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= -github.com/danieljoos/wincred v1.2.2 h1:774zMFJrqaeYCK2W57BgAem/MLi6mtSE47MB6BOJ0i0= -github.com/danieljoos/wincred v1.2.2/go.mod h1:w7w4Utbrz8lqeMbDAK0lkNJUv5sAOkFi7nd/ogr0Uh8= +github.com/danieljoos/wincred v1.2.3 h1:v7dZC2x32Ut3nEfRH+vhoZGvN72+dQ/snVXo/vMFLdQ= +github.com/danieljoos/wincred v1.2.3/go.mod h1:6qqX0WNrS4RzPZ1tnroDzq9kY3fu1KwE7MRLQK4X0bs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -77,8 +77,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 h1: google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw= -google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/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-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/group_activity_analytics_test.go b/group_activity_analytics_test.go index b136bf82..1751c487 100644 --- a/group_activity_analytics_test.go +++ b/group_activity_analytics_test.go @@ -45,6 +45,8 @@ func TestGroupActivityAnalytics_GetRecentlyCreatedMergeRequestsCount(t *testing. } func TestGroupActivityAnalytics_GetRecentlyAddedMembersCount(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/analytics/group_activity/new_members_count", func(w http.ResponseWriter, r *http.Request) { diff --git a/group_hooks_test.go b/group_hooks_test.go index ff068eae..83e1dc8e 100644 --- a/group_hooks_test.go +++ b/group_hooks_test.go @@ -448,6 +448,8 @@ func TestTriggerTestGroupHook(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() + resp, err := client.Groups.TriggerTestGroupHook(tt.groupID, tt.hookID, tt.trigger) if tt.wantErr { diff --git a/group_members.go b/group_members.go index f0d445dd..a7fcbe95 100644 --- a/group_members.go +++ b/group_members.go @@ -55,6 +55,7 @@ type GroupMember struct { AvatarURL string `json:"avatar_url"` WebURL string `json:"web_url"` CreatedAt *time.Time `json:"created_at"` + CreatedBy *MemberCreatedBy `json:"created_by"` ExpiresAt *ISOTime `json:"expires_at"` AccessLevel AccessLevelValue `json:"access_level"` Email string `json:"email,omitempty"` diff --git a/group_members_test.go b/group_members_test.go index 783feadd..cd6f36d4 100644 --- a/group_members_test.go +++ b/group_members_test.go @@ -139,6 +139,14 @@ func TestListGroupMembersWithoutEmail(t *testing.T) { "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "created_at": "2012-10-21T14:13:35Z", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, "expires_at": "2012-10-22", "access_level": 30, "group_saml_identity": null @@ -155,13 +163,21 @@ func TestListGroupMembersWithoutEmail(t *testing.T) { expiresAtISOTime := ISOTime(*expiresAt) want := []*GroupMember{ { - ID: 1, - Username: "raymond_smith", - Name: "Raymond Smith", - State: "active", - AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", - WebURL: "http://192.168.1.8:3000/root", - CreatedAt: mustParseTime("2012-10-21T14:13:35Z"), + ID: 1, + Username: "raymond_smith", + Name: "Raymond Smith", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + CreatedAt: mustParseTime("2012-10-21T14:13:35Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, ExpiresAt: &expiresAtISOTime, AccessLevel: 30, }, @@ -189,6 +205,14 @@ func TestListGroupMembersWithEmail(t *testing.T) { "web_url": "http://192.168.1.8:3000/root", "created_at": "2012-10-21T14:13:35Z", "expires_at": "2012-10-22", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, "access_level": 30, "email": "john@example.com", "group_saml_identity": null @@ -205,13 +229,21 @@ func TestListGroupMembersWithEmail(t *testing.T) { expiresAtISOTime := ISOTime(*expiresAt) want := []*GroupMember{ { - ID: 1, - Username: "raymond_smith", - Name: "Raymond Smith", - State: "active", - AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", - WebURL: "http://192.168.1.8:3000/root", - CreatedAt: mustParseTime("2012-10-21T14:13:35Z"), + ID: 1, + Username: "raymond_smith", + Name: "Raymond Smith", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + CreatedAt: mustParseTime("2012-10-21T14:13:35Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, ExpiresAt: &expiresAtISOTime, AccessLevel: 30, Email: "john@example.com", @@ -239,6 +271,14 @@ func TestListGroupMembersWithoutSAML(t *testing.T) { "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "created_at": "2012-10-21T14:13:35Z", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, "expires_at": "2012-10-22", "access_level": 30, "group_saml_identity": null @@ -255,13 +295,21 @@ func TestListGroupMembersWithoutSAML(t *testing.T) { expiresAtISOTime := ISOTime(*expiresAt) want := []*GroupMember{ { - ID: 1, - Username: "raymond_smith", - Name: "Raymond Smith", - State: "active", - AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", - WebURL: "http://192.168.1.8:3000/root", - CreatedAt: mustParseTime("2012-10-21T14:13:35Z"), + ID: 1, + Username: "raymond_smith", + Name: "Raymond Smith", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + CreatedAt: mustParseTime("2012-10-21T14:13:35Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, ExpiresAt: &expiresAtISOTime, AccessLevel: 30, GroupSAMLIdentity: nil, @@ -289,6 +337,14 @@ func TestListGroupMembersWithSAML(t *testing.T) { "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "created_at": "2012-10-21T14:13:35Z", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, "expires_at": "2012-10-22", "access_level": 30, "group_saml_identity": { @@ -309,13 +365,21 @@ func TestListGroupMembersWithSAML(t *testing.T) { expiresAtISOTime := ISOTime(*expiresAt) want := []*GroupMember{ { - ID: 2, - Username: "john_doe", - Name: "John Doe", - State: "active", - AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", - WebURL: "http://192.168.1.8:3000/root", - CreatedAt: mustParseTime("2012-10-21T14:13:35Z"), + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + CreatedAt: mustParseTime("2012-10-21T14:13:35Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, ExpiresAt: &expiresAtISOTime, AccessLevel: 30, GroupSAMLIdentity: &GroupMemberSAMLIdentity{ @@ -400,15 +464,23 @@ func TestGetGroupMemberAll(t *testing.T) { fmt.Fprint(w, ` { - "id": 2, - "name": "aaa", - "username": "aaaName", - "state": "active", - "avatar_url": "https://secure.gravatar.com/avatar/e547676d82f1e16954b2280a5b4cbe79?s=80&d=identicon", - "web_url": "https://gitlab.example.cn/aaa", - "access_level": 30, - "created_at": "2024-06-19T07:14:02.793Z", - "expires_at": null + "id": 2, + "name": "aaa", + "username": "aaaName", + "state": "active", + "avatar_url": "https://secure.gravatar.com/avatar/e547676d82f1e16954b2280a5b4cbe79?s=80&d=identicon", + "web_url": "https://gitlab.example.cn/aaa", + "access_level": 30, + "created_at": "2024-06-19T07:14:02.793Z", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, + "expires_at": null } `) }) @@ -422,6 +494,14 @@ func TestGetGroupMemberAll(t *testing.T) { WebURL: "https://gitlab.example.cn/aaa", AccessLevel: AccessLevelValue(30), CreatedAt: mustParseTime("2024-06-19T07:14:02.793Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, } pm, resp, err := client.GroupMembers.GetInheritedGroupMember(1, 2, nil, nil) diff --git a/merge_requests.go b/merge_requests.go index 6ffa1fa7..053c4f89 100644 --- a/merge_requests.go +++ b/merge_requests.go @@ -311,13 +311,13 @@ func (s *MergeRequestsService) ListMergeRequests(opt *ListMergeRequestsOptions, return nil, nil, err } - var m []*BasicMergeRequest - resp, err := s.client.Do(req, &m) + var mrs []*MergeRequest + resp, err := s.client.Do(req, &mrs) if err != nil { return nil, resp, err } - return m, resp, nil + return toBasic(mrs), resp, nil } // ListProjectMergeRequestsOptions represents the available ListMergeRequests() @@ -374,13 +374,13 @@ func (s *MergeRequestsService) ListProjectMergeRequests(pid any, opt *ListProjec return nil, nil, err } - var m []*BasicMergeRequest - resp, err := s.client.Do(req, &m) + var mrs []*MergeRequest + resp, err := s.client.Do(req, &mrs) if err != nil { return nil, resp, err } - return m, resp, nil + return toBasic(mrs), resp, nil } // ListGroupMergeRequestsOptions represents the available ListGroupMergeRequests() @@ -437,13 +437,13 @@ func (s *MergeRequestsService) ListGroupMergeRequests(gid any, opt *ListGroupMer return nil, nil, err } - var m []*BasicMergeRequest - resp, err := s.client.Do(req, &m) + var mrs []*MergeRequest + resp, err := s.client.Do(req, &mrs) if err != nil { return nil, resp, err } - return m, resp, nil + return toBasic(mrs), resp, nil } // GetMergeRequestsOptions represents the available GetMergeRequests() @@ -1401,3 +1401,13 @@ func (s *MergeRequestsService) GetMergeRequestDependencies(pid any, mergeRequest return mrd, resp, err } + +func toBasic(mrs []*MergeRequest) []*BasicMergeRequest { + ret := make([]*BasicMergeRequest, len(mrs)) + + for i, mr := range mrs { + ret[i] = &mr.BasicMergeRequest + } + + return ret +} diff --git a/merge_requests_test.go b/merge_requests_test.go index 5977868c..4f150ad3 100644 --- a/merge_requests_test.go +++ b/merge_requests_test.go @@ -125,19 +125,19 @@ func TestGetMergeRequest(t *testing.T) { require.Equal(t, "## What does this MR do?\r\n\r\nThis adds the capability to destroy/hide designs.", mergeRequest.Description) require.Equal(t, "https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14656", mergeRequest.WebURL) require.Equal(t, "mergeable", mergeRequest.DetailedMergeStatus) - require.Equal(t, mergeRequest.Author, &ajk) - require.Equal(t, mergeRequest.Assignee, &tk) + require.Equal(t, &ajk, mergeRequest.Author) + require.Equal(t, &tk, mergeRequest.Assignee) require.Equal(t, []*BasicUser{&tk}, mergeRequest.Assignees) require.Equal(t, []*BasicUser{&tk}, mergeRequest.Reviewers) - require.Equal(t, mergeRequest.Labels, labels) + require.Equal(t, labels, mergeRequest.Labels) require.True(t, mergeRequest.Squash) require.Equal(t, 245, mergeRequest.UserNotesCount) - require.Equal(t, mergeRequest.Pipeline, &pipelineBasic) - require.Equal(t, mergeRequest.HeadPipeline, &pipelineDetailed) + require.Equal(t, &pipelineBasic, mergeRequest.Pipeline) + require.Equal(t, &pipelineDetailed, mergeRequest.HeadPipeline) mrCreation := time.Date(2019, time.July, 11, 22, 34, 43, 500000000, time.UTC) - require.Equal(t, mergeRequest.CreatedAt, &mrCreation) + require.Equal(t, &mrCreation, mergeRequest.CreatedAt) mrUpdate := time.Date(2019, time.August, 20, 9, 9, 56, 690000000, time.UTC) - require.Equal(t, mergeRequest.UpdatedAt, &mrUpdate) + require.Equal(t, &mrUpdate, mergeRequest.UpdatedAt) require.True(t, mergeRequest.FirstContribution) require.True(t, mergeRequest.HasConflicts) require.True(t, mergeRequest.Draft) @@ -503,6 +503,8 @@ index c7c7da3..ce2cd85 100644 func TestIntSliceOrString(t *testing.T) { t.Parallel() t.Run("any", func(t *testing.T) { + t.Parallel() + opts := &ListMergeRequestsOptions{} opts.ApprovedByIDs = ApproverIDs(UserIDAny) q, err := query.Values(opts) @@ -510,6 +512,8 @@ func TestIntSliceOrString(t *testing.T) { assert.Equal(t, "Any", q.Get("approved_by_ids")) }) t.Run("none", func(t *testing.T) { + t.Parallel() + opts := &ListMergeRequestsOptions{} opts.ApprovedByIDs = ApproverIDs(UserIDNone) q, err := query.Values(opts) @@ -517,6 +521,8 @@ func TestIntSliceOrString(t *testing.T) { assert.Equal(t, "None", q.Get("approved_by_ids")) }) t.Run("ids", func(t *testing.T) { + t.Parallel() + opts := &ListMergeRequestsOptions{} opts.ApprovedByIDs = ApproverIDs([]int{1, 2, 3}) q, err := query.Values(opts) @@ -529,6 +535,8 @@ func TestIntSliceOrString(t *testing.T) { func TestAssigneeIDMarshalling(t *testing.T) { t.Parallel() t.Run("any", func(t *testing.T) { + t.Parallel() + opts := &ListMergeRequestsOptions{} opts.AssigneeID = AssigneeID(UserIDAny) q, err := query.Values(opts) @@ -538,6 +546,8 @@ func TestAssigneeIDMarshalling(t *testing.T) { assert.JSONEq(t, `{"assignee_id":"Any"}`, string(js)) }) t.Run("none", func(t *testing.T) { + t.Parallel() + opts := &ListMergeRequestsOptions{} opts.AssigneeID = AssigneeID(UserIDNone) q, err := query.Values(opts) @@ -547,6 +557,8 @@ func TestAssigneeIDMarshalling(t *testing.T) { assert.JSONEq(t, `{"assignee_id":"None"}`, string(js)) }) t.Run("id", func(t *testing.T) { + t.Parallel() + opts := &ListMergeRequestsOptions{} opts.AssigneeID = AssigneeID(5) q, err := query.Values(opts) @@ -679,3 +691,76 @@ func TestAcceptMergeRequest(t *testing.T) { assert.Equal(t, want, mr) } + +func TestListGroupMergeRequests(t *testing.T) { + t.Parallel() + mux, client := setup(t) + const groupID = "12345" + + path := fmt.Sprintf("/%sgroups/%s/merge_requests", apiVersionPath, groupID) + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + testFormBody(t, r, "scope", "all") + testFormBody(t, r, "target_branch", "main") + testFormBody(t, r, "state", "merged") + testFormBody(t, r, "with_labels_details", "true") + + mustWriteHTTPResponse(t, w, "testdata/list_group_merge_requests.json") + }) + + opts := ListGroupMergeRequestsOptions{ + Scope: Ptr("all"), + TargetBranch: Ptr("main"), + State: Ptr("merged"), + WithLabelsDetails: Ptr(true), + } + + mrs, resp, err := client.MergeRequests.ListGroupMergeRequests(groupID, &opts) + require.NoError(t, err) + require.NotNil(t, resp) + require.Len(t, mrs, 1) + + mr := mrs[0] + + assert.Equal(t, Labels{ + "dependencies", + "dependency-type::patch", + "maintenance::dependency", + "type::maintenance", + }, mr.Labels) + + assert.Equal(t, []*LabelDetails{ + { + ID: 30201862, + Name: "dependencies", + Description: "Merge requests from Renovate (https://gitlab.com/gitlab-com/gl-infra/renovate/renovate-ci/)", + DescriptionHTML: "Merge requests from Renovate (https://gitlab.com/gitlab-com/gl-infra/renovate/renovate-ci/)", + TextColor: "#FFFFFF", + Color: "#6699cc", + }, + { + ID: 39246230, + Name: "dependency-type::patch", + Description: "Renovate patch version upgrade", + DescriptionHTML: "Renovate patch version upgrade", + TextColor: "#FFFFFF", + Color: "#6699cc", + }, + { + ID: 24287561, + Name: "maintenance::dependency", + Description: "Dependency updates and their version upgrades", + DescriptionHTML: "Dependency updates and their version upgrades", + TextColor: "#FFFFFF", + Color: "#7f8c8d", + }, + { + ID: 23853047, + Name: "type::maintenance", + Description: "Upkeeping efforts and catch-up corrective improvements that are not Feature nor Bugs. Read more at https://handbook.gitlab.com/handbook/product/groups/product-analysis/engineering/metrics/#work-type-classification", + DescriptionHTML: "Upkeeping efforts and catch-up corrective improvements that are not Feature nor Bugs. Read more at https://handbook.gitlab.com/handbook/product/groups/product-analysis/engineering/metrics/#work-type-classification", + TextColor: "#FFFFFF", + Color: "#330066", + }, + }, mr.LabelDetails) +} diff --git a/model_registry.go b/model_registry.go new file mode 100644 index 00000000..9611e885 --- /dev/null +++ b/model_registry.go @@ -0,0 +1,61 @@ +package gitlab + +import ( + "bytes" + "fmt" + "net/http" + "net/url" +) + +type ( + ModelRegistryServiceInterface interface { + DownloadMachineLearningModelPackage(pid, modelVersionID any, path string, filename string, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) + } + + // ModelRegistryService handles communication with the model registry related methods + // of the GitLab API. + // + // GitLab API docs: https://docs.gitlab.com/api/model_registry/ + ModelRegistryService struct { + client *Client + } +) + +var _ ModelRegistryServiceInterface = (*ModelRegistryService)(nil) + +// DownloadMachineLearningModelPackage downloads a machine learning model package file. +// +// GitLab API docs: https://docs.gitlab.com/api/model_registry/#download-a-model-package-file +func (s *ModelRegistryService) DownloadMachineLearningModelPackage(pid, modelVersionID any, path string, filename string, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + + // The modelVersionID can be an int or a string like "candidate:5", + // so we convert it to a string for the URL. + mvid, err := parseID(modelVersionID) + if err != nil { + return nil, nil, err + } + + u := fmt.Sprintf("projects/%s/packages/ml_models/%s/files/%s/%s", + PathEscape(project), + url.PathEscape(mvid), + url.PathEscape(path), + url.PathEscape(filename), + ) + + req, err := s.client.NewRequest(http.MethodGet, u, nil, options) + if err != nil { + return nil, nil, err + } + + registryDownload := new(bytes.Buffer) + resp, err := s.client.Do(req, registryDownload) + if err != nil { + return nil, resp, err + } + + return bytes.NewReader(registryDownload.Bytes()), resp, err +} diff --git a/model_registry_test.go b/model_registry_test.go new file mode 100644 index 00000000..cd4bbe18 --- /dev/null +++ b/model_registry_test.go @@ -0,0 +1,36 @@ +package gitlab + +import ( + "fmt" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestDownloadMachineLearningModelPackage(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // Mock out the API request and response + mux.HandleFunc("/api/v4/projects/1/packages/ml_models/2/files/path/filename", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + // Creating test data JSON files is optional, you can also include the JSON inline. + fmt.Fprint(w, `fake content`) + }) + + // Call the function being tested + registry, resp, err := client.ModelRegistry.DownloadMachineLearningModelPackage(1, 2, "path", "filename") + + require.NoError(t, err) + assert.NotNil(t, resp) + + data, err := io.ReadAll(registry) + require.NoError(t, err) + + want := []byte("fake content") + + assert.Equal(t, want, data) +} diff --git a/namespaces_test.go b/namespaces_test.go index fb87d4b7..27f8867d 100644 --- a/namespaces_test.go +++ b/namespaces_test.go @@ -101,6 +101,8 @@ func TestListNamespaces(t *testing.T) { for _, tc := range testCases { t.Run(tc.event, func(t *testing.T) { + t.Parallel() + namespaces, _, err := client.Namespaces.ListNamespaces(&ListNamespacesOptions{Search: tc.search, OwnedOnly: tc.ownedOnly}) if err != nil { t.Errorf("Namespaces.ListNamespaces returned error: %v", err) diff --git a/pagination_test.go b/pagination_test.go index 7e40c7b0..f4c2792d 100644 --- a/pagination_test.go +++ b/pagination_test.go @@ -16,6 +16,8 @@ import ( ) func TestPagination_Scan_OffsetBased(t *testing.T) { + t.Parallel() + mux, client := setup(t) handleTwoPagesSuccessfully(t, mux) @@ -32,6 +34,8 @@ func TestPagination_Scan_OffsetBased(t *testing.T) { } func TestPagination_Scan_KeysetBased(t *testing.T) { + t.Parallel() + mux, client := setup(t) handleTwoPagesSuccessfullyWithKeyset(t, mux) @@ -53,6 +57,8 @@ func TestPagination_Scan_KeysetBased(t *testing.T) { } func TestPagination_Scan_Error(t *testing.T) { + t.Parallel() + mux, client := setup(t) handleTwoPagesWithFailure(t, mux) @@ -69,6 +75,8 @@ func TestPagination_Scan_Error(t *testing.T) { } func TestPagination_Scan_ExhaustedError(t *testing.T) { + t.Parallel() + mux, client := setup(t) handleTwoPagesWithFailure(t, mux) @@ -83,6 +91,8 @@ func TestPagination_Scan_ExhaustedError(t *testing.T) { } func TestPagination_Scan2(t *testing.T) { + t.Parallel() + mux, client := setup(t) handleTwoPagesSuccessfully(t, mux) @@ -102,6 +112,8 @@ func TestPagination_Scan2(t *testing.T) { } func TestPagination_Scan2_Error(t *testing.T) { + t.Parallel() + mux, client := setup(t) handleTwoPagesWithFailure(t, mux) @@ -130,6 +142,8 @@ func TestPagination_Scan2_Error(t *testing.T) { } func TestPagination_Must(t *testing.T) { + t.Parallel() + it := Must(func(yield func(int, error) bool) { yield(42, nil) }) xs := slices.Collect(it) @@ -138,6 +152,8 @@ func TestPagination_Must(t *testing.T) { } func TestPagination_Must_Error(t *testing.T) { + t.Parallel() + assert.Panics(t, func() { it := Must(func(yield func(int, error) bool) { yield(0, errors.New("sentinel")) }) _ = slices.Collect(it) @@ -145,6 +161,8 @@ func TestPagination_Must_Error(t *testing.T) { } func TestPagination_ScanAndCollect(t *testing.T) { + t.Parallel() + mux, client := setup(t) handleTwoPagesSuccessfully(t, mux) @@ -158,6 +176,8 @@ func TestPagination_ScanAndCollect(t *testing.T) { } func TestPagination_ScanAndCollect_Error(t *testing.T) { + t.Parallel() + mux, client := setup(t) handleTwoPagesWithFailure(t, mux) diff --git a/pipeline_triggers.go b/pipeline_triggers.go index f441a6ef..d353ee58 100644 --- a/pipeline_triggers.go +++ b/pipeline_triggers.go @@ -209,6 +209,10 @@ type RunPipelineTriggerOptions struct { Ref *string `url:"ref" json:"ref"` Token *string `url:"token" json:"token"` Variables map[string]string `url:"variables,omitempty" json:"variables,omitempty"` + + // Inputs contains pipeline input parameters. + // See PipelineInputsOption for supported types and usage. + Inputs PipelineInputsOption `url:"inputs,omitempty" json:"inputs,omitempty"` } // RunPipelineTrigger starts a trigger from a project. diff --git a/pipeline_triggers_test.go b/pipeline_triggers_test.go index f2517508..2820c7c7 100644 --- a/pipeline_triggers_test.go +++ b/pipeline_triggers_test.go @@ -17,8 +17,10 @@ package gitlab import ( + "errors" "fmt" "net/http" + "reflect" "testing" "time" @@ -170,18 +172,93 @@ func TestDeletePipelineTrigger(t *testing.T) { func TestRunPipelineTrigger(t *testing.T) { t.Parallel() - mux, client := setup(t) - mux.HandleFunc("/api/v4/projects/1/trigger/pipeline", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, http.MethodPost) - fmt.Fprint(w, `{"id":1, "status":"pending"}`) - }) + cases := []struct { + name string + opt *RunPipelineTriggerOptions + want map[string]any + wantErr error + }{ + { + name: "base", + opt: &RunPipelineTriggerOptions{ + Ref: Ptr("main"), + Token: Ptr("test-token"), + }, + want: map[string]any{ + "ref": "main", + "token": "test-token", + }, + }, + { + name: "with variables", + opt: &RunPipelineTriggerOptions{ + Ref: Ptr("main"), + Token: Ptr("test-token"), + Variables: map[string]string{ + "UPLOAD_TO_S3": "true", + "TEST": "test variable", + }, + }, + want: map[string]any{ + "ref": "main", + "token": "test-token", + "variables": map[string]any{ + "UPLOAD_TO_S3": "true", + "TEST": "test variable", + }, + }, + }, + { + name: "with inputs", + opt: &RunPipelineTriggerOptions{ + Ref: Ptr("main"), + Token: Ptr("test-token"), + Inputs: map[string]PipelineInputValueInterface{ + "string_option": NewPipelineInputValue("foo"), + "integer_option": NewPipelineInputValue(42), + "boolean_option": NewPipelineInputValue(true), + "array_option": NewPipelineInputValue([]string{"bar", "qux"}), + }, + }, + want: map[string]any{ + "ref": "main", + "token": "test-token", + "inputs": map[string]any{ + "string_option": "foo", + "integer_option": float64(42), + "boolean_option": true, + "array_option": []any{"bar", "qux"}, + }, + }, + }, + } - opt := &RunPipelineTriggerOptions{Ref: Ptr("master")} - pipeline, resp, err := client.PipelineTriggers.RunPipelineTrigger(1, opt) - assert.NoError(t, err) - assert.NotNil(t, resp) + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() - want := &Pipeline{ID: 1, Status: "pending"} - assert.Equal(t, want, pipeline) + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/1/trigger/pipeline", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodPost) + testBodyJSON(t, r, tc.want) + mustWriteJSONResponse(t, w, map[string]any{"id": 1, "status": "pending"}) + }) + + pipeline, _, err := client.PipelineTriggers.RunPipelineTrigger(1, tc.opt) + if !errors.Is(err, tc.wantErr) { + t.Errorf("PipelineTriggers.RunPipelineTrigger() = error %v, want error %v", err, tc.wantErr) + } + + if err != nil { + return + } + + want := &Pipeline{ID: 1, Status: "pending"} + if !reflect.DeepEqual(want, pipeline) { + t.Errorf("PipelineTriggers.RunPipelineTrigger returned %+v, want %+v", pipeline, want) + } + }) + } } diff --git a/pipelines.go b/pipelines.go index e20f5066..c40deb0a 100644 --- a/pipelines.go +++ b/pipelines.go @@ -17,9 +17,12 @@ package gitlab import ( + "encoding/json" "fmt" "net/http" "time" + + "golang.org/x/exp/constraints" ) type PipelineSource string @@ -373,6 +376,10 @@ func (s *PipelinesService) GetLatestPipeline(pid any, opt *GetLatestPipelineOpti type CreatePipelineOptions struct { Ref *string `url:"ref" json:"ref"` Variables *[]*PipelineVariableOptions `url:"variables,omitempty" json:"variables,omitempty"` + + // Inputs contains pipeline input parameters. + // See PipelineInputsOption for supported types and usage. + Inputs PipelineInputsOption `url:"inputs,omitempty" json:"inputs,omitempty"` } // PipelineVariableOptions represents a pipeline variable option. @@ -384,6 +391,67 @@ type PipelineVariableOptions struct { VariableType *VariableTypeValue `url:"variable_type,omitempty" json:"variable_type,omitempty"` } +// PipelineInputsOption represents pipeline input parameters with type-safe values. +// Each value must be wrapped using NewPipelineInputValue() to ensure compile-time type safety. +// +// Supported value types: +// - string +// - integers (int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64) +// - floats (float32, float64) +// - bool +// - []string +// +// Example: +// +// inputs := PipelineInputsOption{ +// "environment": NewPipelineInputValue("production"), +// "replicas": NewPipelineInputValue(3), +// "debug": NewPipelineInputValue(false), +// "regions": NewPipelineInputValue([]string{"us-east", "eu-west"}), +// } +// +// GitLab API docs: +// - https://docs.gitlab.com/api/pipelines/#create-a-new-pipeline +// - https://docs.gitlab.com/api/pipeline_triggers/#trigger-a-pipeline-with-a-token +type PipelineInputsOption map[string]PipelineInputValueInterface + +// PipelineInputValueInterface is implemented by PipelineInputValue[T] for supported pipeline input types. +// Use NewPipelineInputValue() to create instances - do not implement this interface directly. +// +// See PipelineInputsOption for supported types and usage examples. +type PipelineInputValueInterface interface { + pipelineInputValue() +} + +// 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 +} + +// PipelineInputValue wraps a pipeline input value with compile-time type safety. +// Use NewPipelineInputValue() to create instances of this type. +type PipelineInputValue[T PipelineInputValueType] struct { + Value T +} + +// MarshalJSON implements the json.Marshaler interface. +func (v PipelineInputValue[T]) MarshalJSON() ([]byte, error) { + return json.Marshal(v.Value) +} + +// pipelineInputValue implements PipelineInputValueInterface. +func (PipelineInputValue[T]) pipelineInputValue() {} + +// NewPipelineInputValue wraps a value for use in pipeline inputs. +// Similar to Ptr(), this ensures type safety at compile time. +// Supported types: string, integers, floats, bool, []string +func NewPipelineInputValue[T PipelineInputValueType](value T) PipelineInputValue[T] { + return PipelineInputValue[T]{ + Value: value, + } +} + // CreatePipeline creates a new project pipeline. // // GitLab API docs: diff --git a/pipelines_test.go b/pipelines_test.go index 75894910..7ea9279f 100644 --- a/pipelines_test.go +++ b/pipelines_test.go @@ -17,6 +17,7 @@ package gitlab import ( + "errors" "net/http" "reflect" "testing" @@ -213,24 +214,107 @@ func TestGetLatestPipeline_WithRef(t *testing.T) { assert.Equal(t, &Pipeline{ID: 1, Status: "success"}, pipeline) } +// Assert that PipelineInputValue[T] implements the PipelineInputValueInterface. +var _ PipelineInputValueInterface = PipelineInputValue[string]{} + func TestCreatePipeline(t *testing.T) { t.Parallel() - mux, client := setup(t) - - mux.HandleFunc("/api/v4/projects/1/pipeline", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, http.MethodPost) - mustWriteJSONResponse(t, w, map[string]any{"id": 1, "status": "pending"}) - }) - opt := &CreatePipelineOptions{Ref: Ptr("master")} - pipeline, _, err := client.Pipelines.CreatePipeline(1, opt) - if err != nil { - t.Errorf("Pipelines.CreatePipeline returned error: %v", err) + cases := []struct { + name string + opt *CreatePipelineOptions + want map[string]any + wantErr error + }{ + { + name: "base", + opt: &CreatePipelineOptions{Ref: Ptr("main")}, + want: map[string]any{ + "ref": "main", + }, + }, + { + name: "with variables", + opt: &CreatePipelineOptions{ + Ref: Ptr("main"), + Variables: Ptr([]*PipelineVariableOptions{ + { + Key: Ptr("UPLOAD_TO_S3"), + Value: Ptr("true"), + VariableType: Ptr(FileVariableType), + }, + { + Key: Ptr("TEST"), + Value: Ptr("test variable"), + VariableType: Ptr(EnvVariableType), + }, + }), + }, + want: map[string]any{ + "ref": "main", + "variables": []any{ + map[string]any{ + "key": "UPLOAD_TO_S3", + "value": "true", + "variable_type": "file", + }, + map[string]any{ + "key": "TEST", + "value": "test variable", + "variable_type": "env_var", + }, + }, + }, + }, + { + name: "with inputs", + opt: &CreatePipelineOptions{ + Ref: Ptr("main"), + Inputs: map[string]PipelineInputValueInterface{ + "string_option": NewPipelineInputValue("foo"), + "integer_option": NewPipelineInputValue(42), + "boolean_option": NewPipelineInputValue(true), + "array_option": NewPipelineInputValue([]string{"bar", "qux"}), + }, + }, + want: map[string]any{ + "ref": "main", + "inputs": map[string]any{ + "string_option": "foo", + "integer_option": float64(42), + "boolean_option": true, + "array_option": []any{"bar", "qux"}, + }, + }, + }, } - want := &Pipeline{ID: 1, Status: "pending"} - if !reflect.DeepEqual(want, pipeline) { - t.Errorf("Pipelines.CreatePipeline returned %+v, want %+v", pipeline, want) + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/1/pipeline", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodPost) + testBodyJSON(t, r, tc.want) + mustWriteJSONResponse(t, w, map[string]any{"id": 1, "status": "pending"}) + }) + + pipeline, _, err := client.Pipelines.CreatePipeline(1, tc.opt) + if !errors.Is(err, tc.wantErr) { + t.Errorf("Pipelines.CreatePipeline() = error %v, want error %v", err, tc.wantErr) + } + + if err != nil { + return + } + + want := &Pipeline{ID: 1, Status: "pending"} + if !reflect.DeepEqual(want, pipeline) { + t.Errorf("Pipelines.CreatePipeline returned %+v, want %+v", pipeline, want) + } + }) } } diff --git a/project_aliases.go b/project_aliases.go new file mode 100644 index 00000000..a1af481c --- /dev/null +++ b/project_aliases.go @@ -0,0 +1,121 @@ +package gitlab + +import ( + "fmt" + "net/http" +) + +type ( + ProjectAliasesServiceInterface interface { + ListProjectAliases(options ...RequestOptionFunc) ([]*ProjectAlias, *Response, error) + GetProjectAlias(name string, options ...RequestOptionFunc) (*ProjectAlias, *Response, error) + CreateProjectAlias(opt *CreateProjectAliasOptions, options ...RequestOptionFunc) (*ProjectAlias, *Response, error) + DeleteProjectAlias(name string, options ...RequestOptionFunc) (*Response, error) + } + + // ProjectAliasesService handles communication with the project aliases related methods of the GitLab API. + // + // GitLab API docs: https://docs.gitlab.com/api/project_aliases/ + ProjectAliasesService struct { + client *Client + } +) + +var _ ProjectAliasesServiceInterface = (*ProjectAliasesService)(nil) + +// ProjectAlias represents a GitLab project alias. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_aliases/ +type ProjectAlias struct { + ID int `json:"id"` + ProjectID int `json:"project_id"` + Name string `json:"name"` +} + +// CreateProjectAliasOptions represents the options for creating a project alias. +// +// GitLab API docs: +// 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"` +} + +// ListProjectAliases gets a list of all project aliases. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_aliases/#list-all-project-aliases +func (s *ProjectAliasesService) ListProjectAliases(options ...RequestOptionFunc) ([]*ProjectAlias, *Response, error) { + u := "project_aliases" + + req, err := s.client.NewRequest(http.MethodGet, u, nil, options) + if err != nil { + return nil, nil, err + } + + var aliases []*ProjectAlias + resp, err := s.client.Do(req, &aliases) + if err != nil { + return nil, resp, err + } + + return aliases, resp, nil +} + +// GetProjectAlias gets details of a project alias. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_aliases/#get-project-alias-details +func (s *ProjectAliasesService) GetProjectAlias(name string, options ...RequestOptionFunc) (*ProjectAlias, *Response, error) { + u := fmt.Sprintf("project_aliases/%s", PathEscape(name)) + + req, err := s.client.NewRequest(http.MethodGet, u, nil, options) + if err != nil { + return nil, nil, err + } + + aliasObj := new(ProjectAlias) + resp, err := s.client.Do(req, aliasObj) + if err != nil { + return nil, resp, err + } + + return aliasObj, resp, nil +} + +// CreateProjectAlias creates a new project alias. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_aliases/#create-a-project-alias +func (s *ProjectAliasesService) CreateProjectAlias(opt *CreateProjectAliasOptions, options ...RequestOptionFunc) (*ProjectAlias, *Response, error) { + u := "project_aliases" + + req, err := s.client.NewRequest(http.MethodPost, u, opt, options) + if err != nil { + return nil, nil, err + } + + alias := new(ProjectAlias) + resp, err := s.client.Do(req, alias) + if err != nil { + return nil, resp, err + } + + return alias, resp, nil +} + +// DeleteProjectAlias deletes a project alias. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_aliases/#delete-a-project-alias +func (s *ProjectAliasesService) DeleteProjectAlias(name string, options ...RequestOptionFunc) (*Response, error) { + u := fmt.Sprintf("project_aliases/%s", PathEscape(name)) + + req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} diff --git a/project_aliases_test.go b/project_aliases_test.go new file mode 100644 index 00000000..417206ba --- /dev/null +++ b/project_aliases_test.go @@ -0,0 +1,188 @@ +package gitlab + +import ( + "encoding/json" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestProjectAliasesService_CreateProjectAlias(t *testing.T) { + t.Parallel() + + mux, client := setup(t) + + mux.HandleFunc("/api/v4/project_aliases", func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, "POST", r.Method) + + body, err := io.ReadAll(r.Body) + require.NoError(t, err) + + var payload CreateProjectAliasOptions + err = json.Unmarshal(body, &payload) + require.NoError(t, err) + + require.NotNil(t, payload.Name) + assert.Equal(t, "my-alias", *payload.Name) + assert.Equal(t, 1, payload.ProjectID) + + w.WriteHeader(http.StatusCreated) + w.Write([]byte(`{"id": 10, "name": "my-alias", "project_id": 1}`)) + }) + + s := client.ProjectAliases + opt := &CreateProjectAliasOptions{ + Name: Ptr("my-alias"), + ProjectID: 1, + } + alias, resp, err := s.CreateProjectAlias(opt) + require.NoError(t, err) + assert.Equal(t, 10, alias.ID) + assert.Equal(t, "my-alias", alias.Name) + assert.Equal(t, 1, alias.ProjectID) + assert.Equal(t, 201, resp.StatusCode) +} + +func TestProjectAliasesService_DeleteProjectAlias(t *testing.T) { + t.Parallel() + + mux, client := setup(t) + + mux.HandleFunc("/api/v4/project_aliases/my-alias", func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, "DELETE", r.Method) + w.WriteHeader(http.StatusNoContent) + }) + + s := client.ProjectAliases + resp, err := s.DeleteProjectAlias("my-alias") + require.NoError(t, err) + assert.Equal(t, 204, resp.StatusCode) +} + +func TestProjectAliasesService_GetProjectAlias(t *testing.T) { + t.Parallel() + + mux, client := setup(t) + + mux.HandleFunc("/api/v4/project_aliases/my-alias", func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, "GET", r.Method) + w.WriteHeader(http.StatusOK) + w.Write([]byte(`{"id": 10, "name": "my-alias", "project_id": 1}`)) + }) + + s := client.ProjectAliases + alias, resp, err := s.GetProjectAlias("my-alias") + require.NoError(t, err) + assert.Equal(t, 10, alias.ID) + assert.Equal(t, "my-alias", alias.Name) + assert.Equal(t, 1, alias.ProjectID) + assert.Equal(t, 200, resp.StatusCode) +} + +func TestProjectAliasesService_ListProjectAliases(t *testing.T) { + t.Parallel() + + mux, client := setup(t) + + mux.HandleFunc("/api/v4/project_aliases", func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, "GET", r.Method) + w.WriteHeader(http.StatusOK) + w.Write([]byte(`[{"id": 10, "name": "my-alias", "project_id": 1}]`)) + }) + + s := client.ProjectAliases + aliases, resp, err := s.ListProjectAliases() + require.NoError(t, err) + require.Len(t, aliases, 1) + assert.Equal(t, 10, aliases[0].ID) + assert.Equal(t, "my-alias", aliases[0].Name) + assert.Equal(t, 1, aliases[0].ProjectID) + assert.Equal(t, 200, resp.StatusCode) +} + +func TestProjectAliasesService_GetProjectAlias_WithSpecialCharacters(t *testing.T) { + t.Parallel() + + mux, client := setup(t) + + aliasName := "my/alias?with=special&chars" + expectedEscaped := "my%2Falias%3Fwith%3Dspecial%26chars" + + mux.HandleFunc("/api/v4/project_aliases/"+expectedEscaped, func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, "GET", r.Method) + w.WriteHeader(http.StatusOK) + w.Write([]byte(`{"id": 10, "name": "my/alias?with=special&chars", "project_id": 1}`)) + }) + + s := client.ProjectAliases + alias, resp, err := s.GetProjectAlias(aliasName) + require.NoError(t, err) + assert.Equal(t, 10, alias.ID) + assert.Equal(t, "my/alias?with=special&chars", alias.Name) + assert.Equal(t, 1, alias.ProjectID) + assert.Equal(t, 200, resp.StatusCode) +} + +func TestProjectAliasesService_DeleteProjectAlias_WithSpecialCharacters(t *testing.T) { + t.Parallel() + + mux, client := setup(t) + + aliasName := "my/alias?with=special&chars" + expectedEscaped := "my%2Falias%3Fwith%3Dspecial%26chars" + + mux.HandleFunc("/api/v4/project_aliases/"+expectedEscaped, func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, "DELETE", r.Method) + w.WriteHeader(http.StatusNoContent) + }) + + s := client.ProjectAliases + resp, err := s.DeleteProjectAlias(aliasName) + require.NoError(t, err) + assert.Equal(t, 204, resp.StatusCode) +} + +func TestProjectAliasesService_GetProjectAlias_WithSpacesAndDots(t *testing.T) { + t.Parallel() + + mux, client := setup(t) + + aliasName := "my alias.name" + expectedEscaped := "my%20alias%2Ename" + + mux.HandleFunc("/api/v4/project_aliases/"+expectedEscaped, func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, "GET", r.Method) + w.WriteHeader(http.StatusOK) + w.Write([]byte(`{"id": 20, "name": "my alias.name", "project_id": 2}`)) + }) + + s := client.ProjectAliases + alias, resp, err := s.GetProjectAlias(aliasName) + require.NoError(t, err) + assert.Equal(t, 20, alias.ID) + assert.Equal(t, "my alias.name", alias.Name) + assert.Equal(t, 2, alias.ProjectID) + assert.Equal(t, 200, resp.StatusCode) +} + +func TestProjectAliasesService_DeleteProjectAlias_WithSpacesAndDots(t *testing.T) { + t.Parallel() + + mux, client := setup(t) + + aliasName := "my alias.name" + expectedEscaped := "my%20alias%2Ename" + + mux.HandleFunc("/api/v4/project_aliases/"+expectedEscaped, func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, "DELETE", r.Method) + w.WriteHeader(http.StatusNoContent) + }) + + s := client.ProjectAliases + resp, err := s.DeleteProjectAlias(aliasName) + require.NoError(t, err) + assert.Equal(t, 204, resp.StatusCode) +} diff --git a/project_members.go b/project_members.go index fa4bbcef..e12a2fa6 100644 --- a/project_members.go +++ b/project_members.go @@ -55,6 +55,7 @@ type ProjectMember struct { Name string `json:"name"` State string `json:"state"` CreatedAt *time.Time `json:"created_at"` + CreatedBy *MemberCreatedBy `json:"created_by"` ExpiresAt *ISOTime `json:"expires_at"` AccessLevel AccessLevelValue `json:"access_level"` WebURL string `json:"web_url"` @@ -62,6 +63,15 @@ type ProjectMember struct { MemberRole *MemberRole `json:"member_role"` } +type MemberCreatedBy 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"` +} + // ListProjectMembersOptions represents the available ListProjectMembers() and // ListAllProjectMembers() options. // diff --git a/project_members_test.go b/project_members_test.go index eee5aa75..62d9593c 100644 --- a/project_members_test.go +++ b/project_members_test.go @@ -19,16 +19,25 @@ func TestProjectMembersService_ListProjectMembers(t *testing.T) { testMethod(t, r, http.MethodGet) fmt.Fprintf(w, ` [ - { + { "id": 1, "username": "venkatesh_thalluri", "name": "Venkatesh Thalluri", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", + "created_at": "2012-10-22T14:13:35Z", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, "access_level": 30, "group_saml_identity": null - } + } ] `) }) @@ -42,6 +51,15 @@ func TestProjectMembersService_ListProjectMembers(t *testing.T) { AccessLevel: 30, WebURL: "http://192.168.1.8:3000/root", AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + CreatedAt: mustParseTime("2012-10-22T14:13:35Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, }} pms, resp, err := client.ProjectMembers.ListProjectMembers(1, nil, nil) @@ -73,16 +91,25 @@ func TestProjectMembersService_ListAllProjectMembers(t *testing.T) { testMethod(t, r, http.MethodGet) fmt.Fprintf(w, ` [ - { + { "id": 1, "username": "venkatesh_thalluri", "name": "Venkatesh Thalluri", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", + "created_at": "2012-10-22T14:13:35Z", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, "access_level": 30, "group_saml_identity": null - } + } ] `) }) @@ -96,6 +123,15 @@ func TestProjectMembersService_ListAllProjectMembers(t *testing.T) { AccessLevel: 30, WebURL: "http://192.168.1.8:3000/root", AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + CreatedAt: mustParseTime("2012-10-22T14:13:35Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, }} pms, resp, err := client.ProjectMembers.ListAllProjectMembers(1, nil, nil) @@ -127,16 +163,25 @@ func TestProjectMembersService_GetProjectMember(t *testing.T) { testMethod(t, r, http.MethodGet) fmt.Fprintf(w, ` { - "id": 1, - "username": "venkatesh_thalluri", - "name": "Venkatesh Thalluri", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", - "web_url": "http://192.168.1.8:3000/root", - "access_level": 30, - "email": "venkatesh.thalluri@example.com", - "expires_at": null, - "group_saml_identity": null + "id": 1, + "username": "venkatesh_thalluri", + "name": "Venkatesh Thalluri", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root", + "created_at": "2012-10-22T14:13:35Z", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, + "access_level": 30, + "email": "venkatesh.thalluri@example.com", + "expires_at": null, + "group_saml_identity": null } `) }) @@ -151,6 +196,15 @@ func TestProjectMembersService_GetProjectMember(t *testing.T) { AccessLevel: 30, WebURL: "http://192.168.1.8:3000/root", AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + CreatedAt: mustParseTime("2012-10-22T14:13:35Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, } pm, resp, err := client.ProjectMembers.GetProjectMember(1, 1, nil, nil) @@ -182,16 +236,25 @@ func TestProjectMembersService_GetInheritedProjectMember(t *testing.T) { testMethod(t, r, http.MethodGet) fmt.Fprintf(w, ` { - "id": 1, - "username": "venkatesh_thalluri", - "name": "Venkatesh Thalluri", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", - "web_url": "http://192.168.1.8:3000/root", - "access_level": 30, - "email": "venkatesh.thalluri@example.com", - "expires_at": null, - "group_saml_identity": null + "id": 1, + "username": "venkatesh_thalluri", + "name": "Venkatesh Thalluri", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root", + "created_at": "2012-10-22T14:13:35Z", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, + "access_level": 30, + "email": "venkatesh.thalluri@example.com", + "expires_at": null, + "group_saml_identity": null } `) }) @@ -206,6 +269,15 @@ func TestProjectMembersService_GetInheritedProjectMember(t *testing.T) { AccessLevel: 30, WebURL: "http://192.168.1.8:3000/root", AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + CreatedAt: mustParseTime("2012-10-22T14:13:35Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, } pm, resp, err := client.ProjectMembers.GetInheritedProjectMember(1, 1, nil, nil) @@ -250,16 +322,25 @@ func TestProjectMembersService_AddProjectMember(t *testing.T) { fmt.Fprintf(w, ` { - "id": 1, - "username": "venkatesh_thalluri", - "name": "Venkatesh Thalluri", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", - "web_url": "http://192.168.1.8:3000/root", - "access_level": 30, - "email": "venkatesh.thalluri@example.com", - "expires_at": null, - "group_saml_identity": null + "id": 1, + "username": "venkatesh_thalluri", + "name": "Venkatesh Thalluri", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root", + "created_at": "2012-10-22T14:13:35Z", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, + "access_level": 30, + "email": "venkatesh.thalluri@example.com", + "expires_at": null, + "group_saml_identity": null } `) }) @@ -274,6 +355,15 @@ func TestProjectMembersService_AddProjectMember(t *testing.T) { AccessLevel: 30, WebURL: "http://192.168.1.8:3000/root", AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + CreatedAt: mustParseTime("2012-10-22T14:13:35Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, } pm, resp, err := client.ProjectMembers.AddProjectMember(1, &AddProjectMemberOptions{ @@ -308,16 +398,25 @@ func TestProjectMembersService_EditProjectMember(t *testing.T) { testMethod(t, r, http.MethodPut) fmt.Fprintf(w, ` { - "id": 1, - "username": "venkatesh_thalluri", - "name": "Venkatesh Thalluri", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", - "web_url": "http://192.168.1.8:3000/root", - "access_level": 30, - "email": "venkatesh.thalluri@example.com", - "expires_at": null, - "group_saml_identity": null + "id": 1, + "username": "venkatesh_thalluri", + "name": "Venkatesh Thalluri", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root", + "created_at": "2012-10-22T14:13:35Z", + "created_by": { + "id": 2, + "username": "john_doe", + "name": "John Doe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root" + }, + "access_level": 30, + "email": "venkatesh.thalluri@example.com", + "expires_at": null, + "group_saml_identity": null } `) }) @@ -332,6 +431,15 @@ func TestProjectMembersService_EditProjectMember(t *testing.T) { AccessLevel: 30, WebURL: "http://192.168.1.8:3000/root", AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + CreatedAt: mustParseTime("2012-10-22T14:13:35Z"), + CreatedBy: &MemberCreatedBy{ + ID: 2, + Username: "john_doe", + Name: "John Doe", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + WebURL: "http://192.168.1.8:3000/root", + }, } pm, resp, err := client.ProjectMembers.EditProjectMember(1, 1, nil, nil) @@ -363,16 +471,16 @@ func TestProjectMembersService_DeleteProjectMember(t *testing.T) { testMethod(t, r, http.MethodDelete) fmt.Fprintf(w, ` { - "id": 1, - "username": "venkatesh_thalluri", - "name": "Venkatesh Thalluri", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", - "web_url": "http://192.168.1.8:3000/root", - "access_level": 30, - "email": "venkatesh.thalluri@example.com", - "expires_at": null, - "group_saml_identity": null + "id": 1, + "username": "venkatesh_thalluri", + "name": "Venkatesh Thalluri", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root", + "access_level": 30, + "email": "venkatesh.thalluri@example.com", + "expires_at": null, + "group_saml_identity": null } `) }) diff --git a/project_statistics.go b/project_statistics.go new file mode 100644 index 00000000..1ff9edf9 --- /dev/null +++ b/project_statistics.go @@ -0,0 +1,66 @@ +package gitlab + +import ( + "fmt" + "net/http" +) + +type ( + ProjectStatisticsServiceInterface interface { + // Last30DaysStatistics gets the project statistics for the last 30 days. + // + // GitLab API docs: https://docs.gitlab.com/api/project_statistics/#get-the-statistics-of-the-last-30-days + Last30DaysStatistics(pid any, options ...RequestOptionFunc) (*ProjectStatistics, *Response, error) + } + + // ProjectStatisticsService handles communication with the project statistics related methods + // of the GitLab API. + // + // GitLab API docs: https://docs.gitlab.com/api/project_statistics + ProjectStatisticsService struct { + client *Client + } +) + +// ProjectStatistics represents the Project Statistics. +// +// GitLab API docs: https://docs.gitlab.com/api/project_statistics +type ProjectStatistics struct { + Fetches FetchStats `json:"fetches"` +} + +type FetchStats struct { + Total int64 `json:"total"` + Days []DayStats `json:"days"` +} + +type DayStats struct { + Count int64 `json:"count"` + Date string `json:"date"` +} + +var _ ProjectStatisticsServiceInterface = (*ProjectStatisticsService)(nil) + +func (s *ProjectStatisticsService) Last30DaysStatistics(pid any, options ...RequestOptionFunc) (*ProjectStatistics, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + + u := fmt.Sprintf("projects/%s/statistics", + PathEscape(project), + ) + + req, err := s.client.NewRequest(http.MethodGet, u, nil, options) + if err != nil { + return nil, nil, err + } + + projectStats := new(ProjectStatistics) + resp, err := s.client.Do(req, projectStats) + if err != nil { + return nil, resp, err + } + + return projectStats, resp, err +} diff --git a/project_statistics_test.go b/project_statistics_test.go new file mode 100644 index 00000000..3c9742c4 --- /dev/null +++ b/project_statistics_test.go @@ -0,0 +1,59 @@ +package gitlab + +import ( + "fmt" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestProjectStatisticsService_Last30DaysStatistics(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/1/statistics", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + fmt.Fprint(w, ` + { + "fetches": { + "total": 50, + "days": [ + { + "count": 10, + "date": "2025-10-07" + }, + { + "count": 40, + "date": "2025-10-06" + } + ] + } + } + `) + }) + + // This is the expected struct that the JSON response should unmarshal into. + want := &ProjectStatistics{ + Fetches: FetchStats{ + Total: 50, + Days: []DayStats{ + { + Count: 10, + Date: "2025-10-07", + }, + { + Count: 40, + Date: "2025-10-06", + }, + }, + }, + } + + // Test the happy path. + stats, resp, err := client.ProjectStatistics.Last30DaysStatistics(1) + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, want, stats) +} diff --git a/projects.go b/projects.go index 662ba7e0..0a7b840a 100644 --- a/projects.go +++ b/projects.go @@ -86,6 +86,7 @@ type ( 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) + ListProjectStarrers(pid any, opts *ListProjectStarrersOptions, options ...RequestOptionFunc) ([]*ProjectStarrer, *Response, error) } // ProjectsService handles communication with the repositories related methods @@ -136,6 +137,7 @@ type Project struct { 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"` @@ -763,6 +765,7 @@ type CreateProjectOptions struct { SecurityAndComplianceAccessLevel *AccessControlValue `url:"security_and_compliance_access_level,omitempty" json:"security_and_compliance_access_level,omitempty"` SharedRunnersEnabled *bool `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"` GroupRunnersEnabled *bool `url:"group_runners_enabled,omitempty" json:"group_runners_enabled,omitempty"` + ResourceGroupDefaultProcessMode *ResourceGroupProcessMode `url:"resource_group_default_process_mode,omitempty" json:"resource_group_default_process_mode,omitempty"` ShowDefaultAwardEmojis *bool `url:"show_default_award_emojis,omitempty" json:"show_default_award_emojis,omitempty"` SnippetsAccessLevel *AccessControlValue `url:"snippets_access_level,omitempty" json:"snippets_access_level,omitempty"` SquashCommitTemplate *string `url:"squash_commit_template,omitempty" json:"squash_commit_template,omitempty"` @@ -1009,6 +1012,7 @@ type EditProjectOptions struct { ServiceDeskEnabled *bool `url:"service_desk_enabled,omitempty" json:"service_desk_enabled,omitempty"` SharedRunnersEnabled *bool `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"` GroupRunnersEnabled *bool `url:"group_runners_enabled,omitempty" json:"group_runners_enabled,omitempty"` + ResourceGroupDefaultProcessMode *ResourceGroupProcessMode `url:"resource_group_default_process_mode,omitempty" json:"resource_group_default_process_mode,omitempty"` ShowDefaultAwardEmojis *bool `url:"show_default_award_emojis,omitempty" json:"show_default_award_emojis,omitempty"` SnippetsAccessLevel *AccessControlValue `url:"snippets_access_level,omitempty" json:"snippets_access_level,omitempty"` SquashCommitTemplate *string `url:"squash_commit_template,omitempty" json:"squash_commit_template,omitempty"` @@ -2467,3 +2471,47 @@ func (s *ProjectsService) GetRepositoryStorage(pid any, options ...RequestOption return prs, resp, nil } + +// ProjectStarrer represents a user who starred a project. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_starring/#list-users-who-starred-a-project +type ProjectStarrer struct { + StarredSince time.Time `json:"starred_since"` + User ProjectUser `json:"user"` +} + +// ListProjectStarrersOptions represents the available ListProjectStarrers() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_starring/#list-users-who-starred-a-project +type ListProjectStarrersOptions struct { + ListOptions + Search *string `url:"search,omitempty" json:"search,omitempty"` +} + +// ListProjectStarrers gets users who starred a project. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_starring/#list-users-who-starred-a-project +func (s *ProjectsService) ListProjectStarrers(pid any, opts *ListProjectStarrersOptions, options ...RequestOptionFunc) ([]*ProjectStarrer, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + + u := fmt.Sprintf("projects/%s/starrers", PathEscape(project)) + + req, err := s.client.NewRequest(http.MethodGet, u, opts, options) + if err != nil { + return nil, nil, err + } + + var starrers []*ProjectStarrer + resp, err := s.client.Do(req, &starrers) + if err != nil { + return nil, resp, err + } + + return starrers, resp, nil +} diff --git a/projects_test.go b/projects_test.go index 63e586c9..9a8d1ef8 100644 --- a/projects_test.go +++ b/projects_test.go @@ -53,6 +53,8 @@ func TestListProjects(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects", func(w http.ResponseWriter, r *http.Request) { @@ -428,7 +430,8 @@ func TestGetProjectByID(t *testing.T) { "ci_pipeline_variables_minimum_override_role": "no_one_allowed", "packages_enabled": false, "build_coverage_regex": "Total.*([0-9]{1,3})%", - "ci_delete_pipelines_in_seconds": 14 + "ci_delete_pipelines_in_seconds": 14, + "resource_group_default_process_mode": "oldest_first" }`) }) @@ -448,6 +451,7 @@ func TestGetProjectByID(t *testing.T) { CIRestrictPipelineCancellationRole: "developer", CIPipelineVariablesMinimumOverrideRole: "no_one_allowed", CIDeletePipelinesInSeconds: 14, + ResourceGroupDefaultProcessMode: OldestFirst, } project, resp, err := client.Projects.GetProject(1, nil) @@ -1584,7 +1588,7 @@ func TestListProjectHooks(t *testing.T) { } // Test that the "CustomWebhookTemplate" serializes properly -func TestProjectAddWebhook_CustomTemplateStuff(t *testing.T) { +func TestAddProjectHook_CustomTemplateStuff(t *testing.T) { t.Parallel() mux, client := setup(t) customWebhookSet := false @@ -1639,7 +1643,7 @@ func TestProjectAddWebhook_CustomTemplateStuff(t *testing.T) { } // Test that the "CustomWebhookTemplate" serializes properly when editing -func TestProjectEditWebhook_CustomTemplateStuff(t *testing.T) { +func TestEditProjectHook_CustomTemplateStuff(t *testing.T) { t.Parallel() mux, client := setup(t) customWebhookSet := false @@ -1692,6 +1696,24 @@ func TestProjectEditWebhook_CustomTemplateStuff(t *testing.T) { assert.Len(t, hook.CustomHeaders, 2) } +func TestDeleteProjectHook(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/1/hooks/1", + func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodDelete) + w.WriteHeader(http.StatusNoContent) + }, + ) + + resp, err := client.Projects.DeleteProjectHook(1, 1) + + assert.NoError(t, err) + + assert.Equal(t, http.StatusNoContent, resp.StatusCode) +} + func TestSetProjectWebhookURLVariable(t *testing.T) { t.Parallel() mux, client := setup(t) @@ -2174,3 +2196,99 @@ func TestEditProject_DuoReviewEnabledSetting(t *testing.T) { assert.True(t, attributeFound) assert.True(t, project.AutoDuoCodeReviewEnabled) } + +func TestEditProject_ResourceGroupDefaultProcessModeSetting(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + opt := &EditProjectOptions{ + ResourceGroupDefaultProcessMode: Ptr(OldestFirst), + } + + // Store whether we've seen all the attributes we set + attributeFound := false + + mux.HandleFunc("/api/v4/projects/1", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodPut) + + // Check that our request properly included resource_group_default_process_mode + body, err := io.ReadAll(r.Body) + if err != nil { + t.Fatalf("Unable to read body properly. Error: %v", err) + } + + // Set the value to check if our value is included + attributeFound = strings.Contains(string(body), "resource_group_default_process_mode") + + // Print the start of the mock example from https://docs.gitlab.com/api/projects/#edit-a-project + // including the attribute we edited + fmt.Fprint(w, ` + { + "id": 1, + "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", + "description_html": "

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

", + "default_branch": "main", + "visibility": "private", + "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git", + "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", + "web_url": "http://example.com/diaspora/diaspora-project-site", + "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md", + "resource_group_default_process_mode": "oldest_first" + }`) + }) + + project, resp, err := client.Projects.EditProject(1, opt) + assert.NoError(t, err) + assert.Equal(t, http.StatusOK, resp.StatusCode) + assert.True(t, attributeFound) + assert.Equal(t, OldestFirst, project.ResourceGroupDefaultProcessMode) +} + +func TestListProjectStarrers(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/123/starrers", func(w http.ResponseWriter, r *http.Request) { + testURL(t, r, "/api/v4/projects/123/starrers?page=2&per_page=3&search=jane_smith") + testMethod(t, r, http.MethodGet) + fmt.Fprint(w, `[ + { + "starred_since": "2019-01-28T14:47:30.642Z", + "user": { + "id": 1, + "username": "jane_smith", + "name": "Jane Smith", + "state": "active", + "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", + "web_url": "http://localhost:3000/jane_smith" + } + } + ]`) + }) + + opts := &ListProjectStarrersOptions{ + ListOptions: ListOptions{Page: 2, PerPage: 3}, + Search: Ptr("jane_smith"), + } + + starrers, resp, err := client.Projects.ListProjectStarrers(123, opts) + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.Len(t, starrers, 1) + + want := []*ProjectStarrer{ + { + StarredSince: *mustParseTime("2019-01-28T14:47:30.642Z"), + User: ProjectUser{ + ID: 1, + Username: "jane_smith", + Name: "Jane Smith", + State: "active", + AvatarURL: "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", + WebURL: "http://localhost:3000/jane_smith", + }, + }, + } + + assert.Equal(t, want, starrers) +} diff --git a/protected_packages.go b/protected_packages.go new file mode 100644 index 00000000..711427c8 --- /dev/null +++ b/protected_packages.go @@ -0,0 +1,165 @@ +package gitlab + +import ( + "fmt" + "net/http" +) + +type ( + ProtectedPackagesServiceInterface interface { + // ListPackageProtectionRules gets a list of project package protection rules. + // + // GitLab API docs: + // https://docs.gitlab.com/api/project_packages_protection_rules/#list-package-protection-rules + ListPackageProtectionRules(pid any, opt *ListPackageProtectionRulesOptions, options ...RequestOptionFunc) ([]*PackageProtectionRule, *Response, error) + // CreatePackageProtectionRules creates a new package protection rules. + // + // GitLab API docs: + // https://docs.gitlab.com/api/project_packages_protection_rules/#create-a-package-protection-rule + CreatePackageProtectionRules(pid any, opt *CreatePackageProtectionRulesOptions, options ...RequestOptionFunc) (*PackageProtectionRule, *Response, error) + // UpdatePackageProtectionRules updates an existing package protection rule. + // + // GitLab API docs: + // https://docs.gitlab.com/api/project_packages_protection_rules/#update-a-package-protection-rule + UpdatePackageProtectionRules(pid any, packageProtectionRule int64, opt *UpdatePackageProtectionRulesOptions, options ...RequestOptionFunc) (*PackageProtectionRule, *Response, error) + // DeletePackageProtectionRules deletes an existing package protection rules. + // + // GitLab API docs: + // https://docs.gitlab.com/api/project_packages_protection_rules/#delete-a-package-protection-rule + DeletePackageProtectionRules(pid any, packageProtectionRule int64, options ...RequestOptionFunc) (*Response, error) + } + + // ProtectedPackagesService handles communication with the protected packages related methods + // of the GitLab API. + // + // GitLab API docs: + // https://docs.gitlab.com/api/project_packages_protection_rules/ + ProtectedPackagesService struct { + client *Client + } +) + +var _ ProtectedPackagesServiceInterface = (*ProtectedPackagesService)(nil) + +// PackageProtectionRule represents a GitLab package protection rule. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_packages_protection_rules +type PackageProtectionRule struct { + ID int64 `json:"id"` + ProjectID int64 `json:"project_id"` + PackageNamePattern string `json:"package_name_pattern"` + PackageType string `json:"package_type"` + MinimumAccessLevelForDelete string `json:"minimum_access_level_for_delete"` + MinimumAccessLevelForPush string `json:"minimum_access_level_for_push"` +} + +// ListPackageProtectionRulesOptions represents the available ListPackageProtectionRules() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_packages_protection_rules/#list-package-protection-rules +type ListPackageProtectionRulesOptions struct { + ListOptions +} + +// CreatePackageProtectionRulesOptions represents the available CreatePackageProtectionRules() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_packages_protection_rules/#create-a-package-protection-rule +type CreatePackageProtectionRulesOptions struct { + PackageNamePattern *string `url:"package_name_pattern" json:"package_name_pattern"` + PackageType *string `url:"package_type" json:"package_type"` + 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 +// UpdatePackageProtectionRules() options. +// +// GitLab API docs: +// https://docs.gitlab.com/api/project_packages_protection_rules/#update-a-package-protection-rule +type UpdatePackageProtectionRulesOptions struct { + PackageNamePattern *string `url:"package_name_pattern" json:"package_name_pattern"` + PackageType *string `url:"package_type" json:"package_type"` + 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) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + + u := fmt.Sprintf("projects/%s/packages/protection/rules", PathEscape(project)) + + req, err := s.client.NewRequest(http.MethodGet, u, opts, options) + if err != nil { + return nil, nil, err + } + + var b []*PackageProtectionRule + resp, err := s.client.Do(req, &b) + if err != nil { + return nil, resp, err + } + + return b, resp, nil +} + +func (s *ProtectedPackagesService) CreatePackageProtectionRules(pid any, opt *CreatePackageProtectionRulesOptions, options ...RequestOptionFunc) (*PackageProtectionRule, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/packages/protection/rules", PathEscape(project)) + + req, err := s.client.NewRequest(http.MethodPost, u, opt, options) + if err != nil { + return nil, nil, err + } + + p := new(PackageProtectionRule) + resp, err := s.client.Do(req, p) + if err != nil { + return nil, resp, err + } + + return p, resp, nil +} + +func (s *ProtectedPackagesService) DeletePackageProtectionRules(pid any, packageProtectionRule int64, options ...RequestOptionFunc) (*Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, err + } + u := fmt.Sprintf("projects/%s/packages/protection/rules/%d", PathEscape(project), packageProtectionRule) + + req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} + +func (s *ProtectedPackagesService) UpdatePackageProtectionRules(pid any, packageProtectionRule int64, opt *UpdatePackageProtectionRulesOptions, options ...RequestOptionFunc) (*PackageProtectionRule, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/packages/protection/rules/%d", PathEscape(project), packageProtectionRule) + + req, err := s.client.NewRequest(http.MethodPatch, u, opt, options) + if err != nil { + return nil, nil, err + } + + p := new(PackageProtectionRule) + resp, err := s.client.Do(req, p) + if err != nil { + return nil, resp, err + } + + return p, resp, nil +} diff --git a/protected_packages_test.go b/protected_packages_test.go new file mode 100644 index 00000000..088645db --- /dev/null +++ b/protected_packages_test.go @@ -0,0 +1,149 @@ +package gitlab + +import ( + "fmt" + "net/http" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestProtectedPackagesService_ListPackageProtectionRules(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/1/packages/protection/rules", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + fmt.Fprint(w, ` + [ + { + "id": 1, + "project_id": 1, + "package_name_pattern": "@my-scope/my-package-*", + "package_type": "npm", + "minimum_access_level_for_delete": "owner", + "minimum_access_level_for_push": "maintainer" + } + ] + `) + }) + + want := []*PackageProtectionRule{{ + ID: 1, + ProjectID: 1, + PackageNamePattern: "@my-scope/my-package-*", + PackageType: "npm", + MinimumAccessLevelForDelete: "owner", + MinimumAccessLevelForPush: "maintainer", + }} + + rules, resp, err := client.ProtectedPackages.ListPackageProtectionRules(1, nil) + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, want, rules) +} + +func TestProtectedPackagesService_CreatePackageProtectionRules(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/1/packages/protection/rules", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodPost) + fmt.Fprint(w, ` + { + "id": 1, + "project_id": 1, + "package_name_pattern": "@my-scope/my-package-*", + "package_type": "npm", + "minimum_access_level_for_delete": "owner", + "minimum_access_level_for_push": "maintainer" + } + `) + }) + + want := &PackageProtectionRule{ + ID: 1, + ProjectID: 1, + PackageNamePattern: "@my-scope/my-package-*", + PackageType: "npm", + MinimumAccessLevelForDelete: "owner", + MinimumAccessLevelForPush: "maintainer", + } + + opts := &CreatePackageProtectionRulesOptions{ + PackageNamePattern: Ptr("@my-scope/my-package-*"), + PackageType: Ptr("npm"), + MinimumAccessLevelForDelete: Ptr(int64(MaintainerPermissions)), + MinimumAccessLevelForPush: Ptr(int64(OwnerPermissions)), + } + + rule, resp, err := client.ProtectedPackages.CreatePackageProtectionRules(1, opts) + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, want, rule) +} + +func TestProtectedPackagesService_UpdatePackageProtectionRules(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/1/packages/protection/rules/123", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodPatch) + fmt.Fprint(w, ` + { + "id": 123, + "project_id": 1, + "package_name_pattern": "@my-scope/my-package-updated", + "package_type": "npm", + "minimum_access_level_for_delete": "owner", + "minimum_access_level_for_push": "owner" + } + `) + }) + + want := &PackageProtectionRule{ + ID: 123, + ProjectID: 1, + PackageNamePattern: "@my-scope/my-package-updated", + PackageType: "npm", + MinimumAccessLevelForDelete: "owner", + MinimumAccessLevelForPush: "owner", + } + + opts := &UpdatePackageProtectionRulesOptions{ + PackageNamePattern: Ptr("@my-scope/my-package-updated"), + MinimumAccessLevelForPush: Ptr(int64(OwnerPermissions)), + } + + rule, resp, err := client.ProtectedPackages.UpdatePackageProtectionRules(1, int64(123), opts) + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, want, rule) +} + +func TestProtectedPackagesService_DeletePackageProtectionRules(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/1/packages/protection/rules/123", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodDelete) + w.WriteHeader(http.StatusNoContent) + }) + + resp, err := client.ProtectedPackages.DeletePackageProtectionRules(1, int64(123)) + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, http.StatusNoContent, resp.StatusCode) + + resp, err = client.ProtectedPackages.DeletePackageProtectionRules(1.23, int64(123)) + require.ErrorIs(t, err, ErrInvalidIDType) + require.Nil(t, resp) + + resp, err = client.ProtectedPackages.DeletePackageProtectionRules(1, int64(123), errorOption) + require.ErrorIs(t, err, errRequestOptionFunc) + require.Nil(t, resp) + + resp, err = client.ProtectedPackages.DeletePackageProtectionRules(7, int64(123)) + require.Error(t, err) + require.Equal(t, http.StatusNotFound, resp.StatusCode) +} diff --git a/releaselinks_test.go b/releaselinks_test.go index 6299bc11..012d3192 100644 --- a/releaselinks_test.go +++ b/releaselinks_test.go @@ -114,6 +114,8 @@ func TestReleaseLinksService_CreateReleaseLink(t *testing.T) { } for _, tc := range testCases { t.Run(tc.description, func(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/1/releases/v0.1/assets/links", diff --git a/request_handler.go b/request_handler.go new file mode 100644 index 00000000..0912d2f6 --- /dev/null +++ b/request_handler.go @@ -0,0 +1,64 @@ +package gitlab + +// Generic utility functions to handle common request/response patterns + +// DoRequestReturnObject handles requests that return a single object +// This is a generic utility function for GitLab API endpoints that return a single resource. +// +// GitLab API docs: https://docs.gitlab.com/ee/api/ +func DoRequestReturnObject[T any]( + client *Client, + method, url string, + body any, + options []RequestOptionFunc, +) (*T, *Response, error) { + result := new(T) + req, err := client.NewRequest(method, url, body, options) + if err != nil { + return nil, nil, err + } + resp, err := client.Do(req, result) + if err != nil { + return nil, resp, err + } + return result, resp, nil +} + +// DoRequestReturnSlice handles requests that return a slice of objects +// This is a generic utility function for GitLab API endpoints that return a slice of objects +// +// GitLab API docs: https://docs.gitlab.com/ee/api/ +func DoRequestReturnSlice[T any]( + client *Client, + method, url string, + body any, + options []RequestOptionFunc, +) ([]T, *Response, error) { + var result []T + req, err := client.NewRequest(method, url, body, options) + if err != nil { + return nil, nil, err + } + resp, err := client.Do(req, &result) + if err != nil { + return nil, resp, err + } + return result, resp, nil +} + +// DoRequestReturnVoid handles requests that don't return data +// This is a generic utility function for GitLab API endpoints that perform actions without returning response data. +// +// GitLab API docs: https://docs.gitlab.com/ee/api/ +func DoRequestReturnVoid( + client *Client, + method, url string, + body any, + options []RequestOptionFunc, +) (*Response, error) { + req, err := client.NewRequest(method, url, body, options) + if err != nil { + return nil, err + } + return client.Do(req, nil) +} diff --git a/request_handler_test.go b/request_handler_test.go new file mode 100644 index 00000000..b62add29 --- /dev/null +++ b/request_handler_test.go @@ -0,0 +1,328 @@ +package gitlab + +import ( + "encoding/json" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// Test structs for testing +type TestUser struct { + ID int64 `json:"id"` + Name string `json:"name"` +} + +type TestProject struct { + ID int64 `json:"id"` + Name string `json:"name"` + Description string `json:"description"` +} + +func TestDoRequestReturnObjectSuccess(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // GIVEN a mock server that returns a test user from testdata + path := "/api/v4/users/1" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + mustWriteHTTPResponse(t, w, "testdata/get_user.json") + }) + + // WHEN DoRequestReturnObject is called with valid parameters + user, resp, err := DoRequestReturnObject[TestUser]( + client, + http.MethodGet, + "users/1", + nil, + nil, + ) + + // THEN the request should succeed and return the expected user + assert.NoError(t, err) + assert.Equal(t, 200, resp.StatusCode) + assert.Equal(t, int64(1), user.ID) + assert.Equal(t, "John Smith", user.Name) +} + +func TestDoRequestReturnObjectPOSTWithBody(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // GIVEN a mock server that creates and returns a project + path := "/api/v4/projects" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodPost) + + var reqBody TestProject + err := json.NewDecoder(r.Body).Decode(&reqBody) + require.NoError(t, err) + require.Equal(t, "New Project", reqBody.Name) + + w.WriteHeader(201) + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"id": 1, "name": "New Project", "description": "Test project"}`)) + }) + + // GIVEN a project creation request body + requestBody := &TestProject{ + Name: "New Project", + Description: "Test project", + } + + // WHEN DoRequestReturnObject is called with POST method and body + project, resp, err := DoRequestReturnObject[TestProject]( + client, + http.MethodPost, + "projects", + requestBody, + nil, + ) + + // THEN the project should be created successfully + assert.NoError(t, err) + assert.Equal(t, 201, resp.StatusCode) + assert.Equal(t, "New Project", project.Name) +} + +func TestDoRequestReturnObjectErrorResponse(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // GIVEN a mock server that returns a 404 error + path := "/api/v4/users/999" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + w.WriteHeader(404) + w.Write([]byte(`{"message": "Not found"}`)) + }) + + // WHEN DoRequestReturnObject is called for a non-existent user + user, resp, err := DoRequestReturnObject[TestUser]( + client, + http.MethodGet, + "users/999", + nil, + nil, + ) + + // THEN the request should fail with a 404 error + assert.Error(t, err) + assert.Equal(t, 404, resp.StatusCode) + assert.Nil(t, user) +} + +func TestDoRequestReturnSliceSuccess(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // GIVEN a mock server that returns a list of users from testdata + path := "/api/v4/users" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + mustWriteHTTPResponse(t, w, "testdata/list_users.json") + }) + + // WHEN DoRequestReturnSlice is called to fetch users + users, resp, err := DoRequestReturnSlice[TestUser]( + client, + http.MethodGet, + "users", + nil, + nil, + ) + + // THEN the request should succeed and return all users + assert.NoError(t, err) + assert.Equal(t, 200, resp.StatusCode) + assert.Len(t, users, 3) + + expectedUsers := []TestUser{ + {ID: 1, Name: "Example User 1"}, + {ID: 2, Name: "Example User 2"}, + {ID: 3, Name: "Example User 3"}, + } + for i, user := range users { + assert.Equal(t, expectedUsers[i].ID, user.ID) + assert.Equal(t, expectedUsers[i].Name, user.Name) + } +} + +func TestDoRequestReturnSliceEmptySlice(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // GIVEN a mock server that returns an empty array + path := "/api/v4/users" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + w.Header().Set("Content-Type", "application/json") + w.Write([]byte("[]")) + }) + + // WHEN DoRequestReturnSlice is called on an endpoint with no data + users, resp, err := DoRequestReturnSlice[TestUser]( + client, + http.MethodGet, + "users", + nil, + nil, + ) + + // THEN the request should succeed and return an empty slice + assert.NoError(t, err) + assert.Equal(t, 200, resp.StatusCode) + assert.Empty(t, users) +} + +func TestDoRequestReturnSliceErrorResponse(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // GIVEN a mock server that returns a 500 error + path := "/api/v4/users" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + w.WriteHeader(500) + w.Write([]byte(`{"message": "Internal server error"}`)) + }) + + // WHEN DoRequestReturnSlice is called on a failing endpoint + users, resp, err := DoRequestReturnSlice[TestUser]( + client, + http.MethodGet, + "users", + nil, + nil, + ) + + // THEN the request should fail with a 500 error + assert.Error(t, err) + assert.Equal(t, 500, resp.StatusCode) + assert.Nil(t, users) +} + +func TestDoRequestReturnVoidSuccessDELETE(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // GIVEN a mock server that accepts DELETE requests + path := "/api/v4/users/1" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodDelete) + w.WriteHeader(204) // No Content + }) + + // WHEN DoRequestReturnVoid is called with DELETE method + resp, err := DoRequestReturnVoid( + client, + http.MethodDelete, + "users/1", + nil, + nil, + ) + + // THEN the request should succeed with no content + assert.NoError(t, err) + assert.Equal(t, 204, resp.StatusCode) +} + +func TestDoRequestReturnVoidSuccessPUT(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // GIVEN a mock server that accepts PUT requests with body validation + path := "/api/v4/merge_requests/1/approve" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodPut) + + var reqBody map[string]interface{} + err := json.NewDecoder(r.Body).Decode(&reqBody) + require.NoError(t, err) + require.Equal(t, "approve", reqBody["action"]) + + w.WriteHeader(200) + }) + + // GIVEN an approval request body + requestBody := map[string]string{"action": "approve"} + + // WHEN DoRequestReturnVoid is called with PUT method and body + resp, err := DoRequestReturnVoid( + client, + http.MethodPut, + "merge_requests/1/approve", + requestBody, + nil, + ) + + // THEN the request should succeed + assert.NoError(t, err) + assert.Equal(t, 200, resp.StatusCode) +} + +func TestDoRequestReturnVoidErrorResponse(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // GIVEN a mock server that returns a 403 forbidden error + path := "/api/v4/users/1" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodDelete) + w.WriteHeader(403) + w.Write([]byte(`{"message": "Forbidden"}`)) + }) + + // WHEN DoRequestReturnVoid is called on a forbidden operation + resp, err := DoRequestReturnVoid( + client, + http.MethodDelete, + "users/1", + nil, + nil, + ) + + // THEN the request should fail with a 403 error + assert.Error(t, err) + assert.Equal(t, 403, resp.StatusCode) +} + +func TestRequestHandlerWithOptions(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + // GIVEN a mock server that validates query parameters and headers + // from options + path := "/api/v4/users" + mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + // Check that query parameters from options are included + assert.Equal(t, "2", r.URL.Query().Get("page")) + assert.Equal(t, "test-value", r.Header.Get("X-Test-Header")) + + mustWriteHTTPResponse(t, w, "testdata/list_users_public_email.json") + }) + + // GIVEN request options with pagination and custom header + options := []RequestOptionFunc{ + WithOffsetPaginationParameters(2), + WithHeader("X-Test-Header", "test-value"), + } + + // WHEN DoRequestReturnSlice is called with request options + users, resp, err := DoRequestReturnSlice[TestUser]( + client, + http.MethodGet, + "users", + nil, + options, + ) + + // THEN the request should succeed with options applied + assert.NoError(t, err) + assert.Equal(t, 200, resp.StatusCode) + assert.Len(t, users, 1) +} diff --git a/resource_milestone_events_test.go b/resource_milestone_events_test.go index 281b46f7..0b9af7af 100644 --- a/resource_milestone_events_test.go +++ b/resource_milestone_events_test.go @@ -9,6 +9,8 @@ import ( ) func TestListIssueMilestoneEvents(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/5/issues/11/resource_milestone_events", func(w http.ResponseWriter, r *http.Request) { @@ -72,6 +74,8 @@ func TestListIssueMilestoneEvents(t *testing.T) { } func TestGetIssueMilestoneEvent(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/5/issues/11/resource_milestone_events/143", func(w http.ResponseWriter, r *http.Request) { @@ -133,6 +137,8 @@ func TestGetIssueMilestoneEvent(t *testing.T) { } func TestListMergeMilestoneEvents(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/5/merge_requests/11/resource_milestone_events", func(w http.ResponseWriter, r *http.Request) { @@ -196,6 +202,8 @@ func TestListMergeMilestoneEvents(t *testing.T) { } func TestGetMergeRequestMilestoneEvent(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/5/merge_requests/11/resource_milestone_events/120", func(w http.ResponseWriter, r *http.Request) { diff --git a/scripts/commitlint/lint.js b/scripts/commitlint/lint.js deleted file mode 100644 index 88b1d2bc..00000000 --- a/scripts/commitlint/lint.js +++ /dev/null @@ -1,103 +0,0 @@ -import read from '@commitlint/read'; -import lint from '@commitlint/lint'; -import format from '@commitlint/format'; -import config from '@commitlint/config-conventional'; - -// You can test the script by setting these environment variables -const { - CI_MERGE_REQUEST_DIFF_BASE_SHA, // refers to the main branch - CI_MERGE_REQUEST_SQUASH_ON_MERGE, // true if the squash MR checkbox is ticked - CI_MERGE_REQUEST_TITLE, // MR Title - CI_MERGE_REQUEST_EVENT_TYPE, // equal to 'merge_train' if the pipeline is a merge train pipeline - CI, // true when script is run in a CI/CD pipeline - LAST_MR_COMMIT, // This variable is created by `lint.sh` script. It represents the MR commit that's direct parent of the newly created merge commit. -} = process.env; - -// Leaving this alone for now even though it doesn't point to client-go because -// we'll want to create our own commit documentation eventually. I don't think we need to -// for the first iteration though. -const urlSemanticRelease = - 'https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/main/docs/developer/commits.md'; - -// See rule docs https://commitlint.js.org/#/reference-rules -const customRules = { - "body-max-line-length": [0, "always", 100], - "subject-case": [0, "always", ["sentence-case"]], - "header-max-length": [2, "always", 200], - - // Inherited from upstream cli configuration, but - // I think they're worth leaving for client-go. - "body-leading-blank": [2, "always"], - "footer-leading-blank": [2, "always"] -}; - -async function getCommitsInMr() { - const diffBaseSha = CI_MERGE_REQUEST_DIFF_BASE_SHA; - const sourceBranchSha = LAST_MR_COMMIT; - const messages = await read({ from: diffBaseSha, to: sourceBranchSha }); - return messages; -} - -const messageMatcher = r => r.test.bind(r); - -async function isConventional(message) { - return lint( - message, - { ...config.rules, ...customRules }, - { - defaultIgnores: false, - ignores: [ - messageMatcher(/^[Rr]evert .*/), - messageMatcher(/^(?:fixup|squash)!/), - messageMatcher(/^Merge branch/), - messageMatcher(/^\d+\.\d+\.\d+/), - ], - }, - ); -} - -async function lintMr() { - const commits = await getCommitsInMr(); - - // When MR is set to squash, but it's not yet being merged, we check the MR Title - if ( - CI_MERGE_REQUEST_SQUASH_ON_MERGE === 'true' && - CI_MERGE_REQUEST_EVENT_TYPE !== 'merge_train' - ) { - console.log( - 'INFO: The MR is set to squash. We will lint the MR Title (used as the commit message by default).', - ); - return isConventional(CI_MERGE_REQUEST_TITLE).then(Array.of); - } - console.log('INFO: Checking all commits that will be added by this MR.'); - return Promise.all(commits.map(commit => isConventional(commit))); -} - -async function run() { - if (!CI) { - console.error('This script can only run in GitLab CI.'); - process.exit(1); - } - - if (!LAST_MR_COMMIT) { - console.error( - 'LAST_MR_COMMIT environment variable is not present. Make sure this script is run from `lint.sh`', - ); - process.exit(1); - } - - const results = await lintMr(); - - console.error(format({ results }, { helpUrl: urlSemanticRelease })); - - const numOfErrors = results.reduce((acc, result) => acc + result.errors.length, 0); - if (numOfErrors !== 0) { - process.exit(1); - } -} - -run().catch(err => { - console.error(err); - process.exit(1); -}); - diff --git a/scripts/commitlint/lint.sh b/scripts/commitlint/lint.sh deleted file mode 100755 index fe4ca87e..00000000 --- a/scripts/commitlint/lint.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -set -e # Abort script at first error, when a command exits with non-zero status (except in until or while loops, if-tests, list constructs) -set -u # Attempt to use undefined variable outputs error message, and forces an exit -# set -x # Similar to verbose mode (-v), but expands commands -set -o pipefail # Causes a pipeline to return the exit status of the last command in the pipe that returned a non-zero return value. - -SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) - -get_last_mr_commit() { - if [ "$CI_MERGE_REQUEST_EVENT_TYPE" == "detached" ]; then - echo "WARNING: This project doesn't have merge train enabled. This script can't guarantee that invalid commits will not be added." - echo "Invalid commits can be added if the person merging the MR changes the commit message or if somebody toggles the 'squash on merge' button after this job run." - LAST_MR_COMMIT="$(git rev-parse HEAD)" - return - fi - - FIRST_PARENT="$(git rev-parse HEAD^1)" - SECOND_PARENT="$(git rev-parse HEAD^2)" - # The following two ifs check which of the parent commits is coming from the MR - # We use the fact that the other parent is always the target branch (usually main) HEAD SHA - if [ "$FIRST_PARENT" == "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA" ]; then - LAST_MR_COMMIT="$SECOND_PARENT" - fi - - if [ "$SECOND_PARENT" == "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA" ]; then - LAST_MR_COMMIT="$FIRST_PARENT" - fi -} - -get_last_mr_commit -export LAST_MR_COMMIT - -node "$SCRIPT_DIR/lint.js" \ No newline at end of file diff --git a/scripts/commitlint/package-lock.json b/scripts/commitlint/package-lock.json deleted file mode 100644 index f52012da..00000000 --- a/scripts/commitlint/package-lock.json +++ /dev/null @@ -1,550 +0,0 @@ -{ - "name": "commit-lint", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "commit-lint", - "version": "0.0.1", - "license": "MIT", - "dependencies": { - "@commitlint/config-conventional": "^19.8.0", - "@commitlint/format": "^19.8.1", - "@commitlint/lint": "^19.8.1", - "@commitlint/read": "^19.8.1" - } - }, - "node_modules/@commitlint/config-conventional": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-19.8.1.tgz", - "integrity": "sha512-/AZHJL6F6B/G959CsMAzrPKKZjeEiAVifRyEwXxcT6qtqbPwGw+iQxmNS+Bu+i09OCtdNRW6pNpBvgPrtMr9EQ==", - "license": "MIT", - "dependencies": { - "@commitlint/types": "^19.8.1", - "conventional-changelog-conventionalcommits": "^7.0.2" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/ensure": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-19.8.1.tgz", - "integrity": "sha512-mXDnlJdvDzSObafjYrOSvZBwkD01cqB4gbnnFuVyNpGUM5ijwU/r/6uqUmBXAAOKRfyEjpkGVZxaDsCVnHAgyw==", - "license": "MIT", - "dependencies": { - "@commitlint/types": "^19.8.1", - "lodash.camelcase": "^4.3.0", - "lodash.kebabcase": "^4.1.1", - "lodash.snakecase": "^4.1.1", - "lodash.startcase": "^4.4.0", - "lodash.upperfirst": "^4.3.1" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/format": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-19.8.1.tgz", - "integrity": "sha512-kSJj34Rp10ItP+Eh9oCItiuN/HwGQMXBnIRk69jdOwEW9llW9FlyqcWYbHPSGofmjsqeoxa38UaEA5tsbm2JWw==", - "license": "MIT", - "dependencies": { - "@commitlint/types": "^19.8.1", - "chalk": "^5.3.0" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/is-ignored": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-19.8.1.tgz", - "integrity": "sha512-AceOhEhekBUQ5dzrVhDDsbMaY5LqtN8s1mqSnT2Kz1ERvVZkNihrs3Sfk1Je/rxRNbXYFzKZSHaPsEJJDJV8dg==", - "license": "MIT", - "dependencies": { - "@commitlint/types": "^19.8.1", - "semver": "^7.6.0" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/lint": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-19.8.1.tgz", - "integrity": "sha512-52PFbsl+1EvMuokZXLRlOsdcLHf10isTPlWwoY1FQIidTsTvjKXVXYb7AvtpWkDzRO2ZsqIgPK7bI98x8LRUEw==", - "license": "MIT", - "dependencies": { - "@commitlint/is-ignored": "^19.8.1", - "@commitlint/parse": "^19.8.1", - "@commitlint/rules": "^19.8.1", - "@commitlint/types": "^19.8.1" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/message": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-19.8.1.tgz", - "integrity": "sha512-+PMLQvjRXiU+Ae0Wc+p99EoGEutzSXFVwQfa3jRNUZLNW5odZAyseb92OSBTKCu+9gGZiJASt76Cj3dLTtcTdg==", - "license": "MIT", - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/parse": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-19.8.1.tgz", - "integrity": "sha512-mmAHYcMBmAgJDKWdkjIGq50X4yB0pSGpxyOODwYmoexxxiUCy5JJT99t1+PEMK7KtsCtzuWYIAXYAiKR+k+/Jw==", - "license": "MIT", - "dependencies": { - "@commitlint/types": "^19.8.1", - "conventional-changelog-angular": "^7.0.0", - "conventional-commits-parser": "^5.0.0" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/read": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-19.8.1.tgz", - "integrity": "sha512-03Jbjb1MqluaVXKHKRuGhcKWtSgh3Jizqy2lJCRbRrnWpcM06MYm8th59Xcns8EqBYvo0Xqb+2DoZFlga97uXQ==", - "license": "MIT", - "dependencies": { - "@commitlint/top-level": "^19.8.1", - "@commitlint/types": "^19.8.1", - "git-raw-commits": "^4.0.0", - "minimist": "^1.2.8", - "tinyexec": "^1.0.0" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/rules": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-19.8.1.tgz", - "integrity": "sha512-Hnlhd9DyvGiGwjfjfToMi1dsnw1EXKGJNLTcsuGORHz6SS9swRgkBsou33MQ2n51/boIDrbsg4tIBbRpEWK2kw==", - "license": "MIT", - "dependencies": { - "@commitlint/ensure": "^19.8.1", - "@commitlint/message": "^19.8.1", - "@commitlint/to-lines": "^19.8.1", - "@commitlint/types": "^19.8.1" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/to-lines": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-19.8.1.tgz", - "integrity": "sha512-98Mm5inzbWTKuZQr2aW4SReY6WUukdWXuZhrqf1QdKPZBCCsXuG87c+iP0bwtD6DBnmVVQjgp4whoHRVixyPBg==", - "license": "MIT", - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/top-level": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-19.8.1.tgz", - "integrity": "sha512-Ph8IN1IOHPSDhURCSXBz44+CIu+60duFwRsg6HqaISFHQHbmBtxVw4ZrFNIYUzEP7WwrNPxa2/5qJ//NK1FGcw==", - "license": "MIT", - "dependencies": { - "find-up": "^7.0.0" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/types": { - "version": "19.8.1", - "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-19.8.1.tgz", - "integrity": "sha512-/yCrWGCoA1SVKOks25EGadP9Pnj0oAIHGpl2wH2M2Y46dPM2ueb8wyCVOD7O3WCTkaJ0IkKvzhl1JY7+uCT2Dw==", - "license": "MIT", - "dependencies": { - "@types/conventional-commits-parser": "^5.0.0", - "chalk": "^5.3.0" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@types/conventional-commits-parser": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@types/conventional-commits-parser/-/conventional-commits-parser-5.0.1.tgz", - "integrity": "sha512-7uz5EHdzz2TqoMfV7ee61Egf5y6NkcO4FB/1iCCQnbeiI1F3xzv3vK5dBCXUCLQgGYS+mUeigK1iKQzvED+QnQ==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "24.3.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.1.tgz", - "integrity": "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==", - "license": "MIT", - "dependencies": { - "undici-types": "~7.10.0" - } - }, - "node_modules/array-ify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", - "license": "MIT" - }, - "node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/compare-func": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", - "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", - "license": "MIT", - "dependencies": { - "array-ify": "^1.0.0", - "dot-prop": "^5.1.0" - } - }, - "node_modules/conventional-changelog-angular": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", - "integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==", - "license": "ISC", - "dependencies": { - "compare-func": "^2.0.0" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/conventional-changelog-conventionalcommits": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz", - "integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==", - "license": "ISC", - "dependencies": { - "compare-func": "^2.0.0" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/conventional-commits-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz", - "integrity": "sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==", - "license": "MIT", - "dependencies": { - "is-text-path": "^2.0.0", - "JSONStream": "^1.3.5", - "meow": "^12.0.1", - "split2": "^4.0.0" - }, - "bin": { - "conventional-commits-parser": "cli.mjs" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/dargs": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-8.1.0.tgz", - "integrity": "sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "license": "MIT", - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-7.0.0.tgz", - "integrity": "sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==", - "license": "MIT", - "dependencies": { - "locate-path": "^7.2.0", - "path-exists": "^5.0.0", - "unicorn-magic": "^0.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/git-raw-commits": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-4.0.0.tgz", - "integrity": "sha512-ICsMM1Wk8xSGMowkOmPrzo2Fgmfo4bMHLNX6ytHjajRJUqvHOw/TFapQ+QG75c3X/tTDDhOSRPGC52dDbNM8FQ==", - "license": "MIT", - "dependencies": { - "dargs": "^8.0.0", - "meow": "^12.0.1", - "split2": "^4.0.0" - }, - "bin": { - "git-raw-commits": "cli.mjs" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-text-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", - "integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==", - "license": "MIT", - "dependencies": { - "text-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", - "engines": [ - "node >= 0.2.0" - ], - "license": "MIT" - }, - "node_modules/JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "license": "(MIT OR Apache-2.0)", - "dependencies": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - }, - "bin": { - "JSONStream": "bin.js" - }, - "engines": { - "node": "*" - } - }, - "node_modules/locate-path": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", - "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", - "license": "MIT", - "dependencies": { - "p-locate": "^6.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "license": "MIT" - }, - "node_modules/lodash.kebabcase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", - "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", - "license": "MIT" - }, - "node_modules/lodash.snakecase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", - "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", - "license": "MIT" - }, - "node_modules/lodash.startcase": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", - "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==", - "license": "MIT" - }, - "node_modules/lodash.upperfirst": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", - "integrity": "sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==", - "license": "MIT" - }, - "node_modules/meow": { - "version": "12.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", - "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", - "license": "MIT", - "engines": { - "node": ">=16.10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "license": "MIT", - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "license": "MIT", - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "license": "ISC", - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/text-extensions": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", - "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "license": "MIT" - }, - "node_modules/tinyexec": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.1.tgz", - "integrity": "sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==", - "license": "MIT" - }, - "node_modules/undici-types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", - "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", - "license": "MIT" - }, - "node_modules/unicorn-magic": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", - "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/yocto-queue": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", - "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", - "license": "MIT", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/scripts/commitlint/package.json b/scripts/commitlint/package.json deleted file mode 100644 index ee8ecf97..00000000 --- a/scripts/commitlint/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "commit-lint", - "version": "0.0.1", - "main": "lint.js", - "author": "", - "license": "MIT", - "type": "module", - "dependencies": { - "@commitlint/config-conventional": "^19.8.0", - "@commitlint/format": "^19.8.1", - "@commitlint/lint": "^19.8.1", - "@commitlint/read": "^19.8.1" - } -} - diff --git a/terraform_states_test.go b/terraform_states_test.go index cf059f21..afa61de3 100644 --- a/terraform_states_test.go +++ b/terraform_states_test.go @@ -12,6 +12,8 @@ import ( ) func TestTerraformState_List(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/graphql", func(w http.ResponseWriter, r *http.Request) { @@ -92,6 +94,8 @@ func TestTerraformState_List(t *testing.T) { } func TestTerraformState_Get(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/graphql", func(w http.ResponseWriter, r *http.Request) { @@ -142,6 +146,8 @@ func TestTerraformState_Get(t *testing.T) { } func TestTerraformState_DownloadLatest(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/terraform/state/production", func(w http.ResponseWriter, r *http.Request) { @@ -158,6 +164,8 @@ func TestTerraformState_DownloadLatest(t *testing.T) { } func TestTerraformState_Download(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/terraform/state/production/versions/42", func(w http.ResponseWriter, r *http.Request) { @@ -174,6 +182,8 @@ func TestTerraformState_Download(t *testing.T) { } func TestTerraformState_Delete(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/terraform/state/production", func(w http.ResponseWriter, r *http.Request) { @@ -185,6 +195,8 @@ func TestTerraformState_Delete(t *testing.T) { } func TestTerraformState_DeleteVersion(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/terraform/state/production/versions/42", func(w http.ResponseWriter, r *http.Request) { @@ -196,6 +208,8 @@ func TestTerraformState_DeleteVersion(t *testing.T) { } func TestTerraformState_Lock(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/terraform/state/production/lock", func(w http.ResponseWriter, r *http.Request) { @@ -207,6 +221,8 @@ func TestTerraformState_Lock(t *testing.T) { } func TestTerraformState_Unlock(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/20/terraform/state/production/lock", func(w http.ResponseWriter, r *http.Request) { diff --git a/testdata/list_group_merge_requests.json b/testdata/list_group_merge_requests.json new file mode 100644 index 00000000..519a8025 --- /dev/null +++ b/testdata/list_group_merge_requests.json @@ -0,0 +1,138 @@ +[ + { + "id": 418570794, + "iid": 1084, + "project_id": 46229026, + "title": "chore(deps): update registry.gitlab.com/gitlab-com/gl-infra/platform/runway/runwayctl/runwayctl docker tag to v4.0.1", + "description": "This MR contains the following updates:\n\n| Package | Update | Change |\n|---|---|---|\n| registry.gitlab.com/gitlab-com/gl-infra/platform/runway/runwayctl/runwayctl | patch | |\n\nView the [Renovate pipeline for this MR](https://gitlab.com/gitlab-com/gl-infra/platform/runway/provisioner/-/jobs/11492353311)\n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this MR and you won't be reminded about this update again.\n\n---\n\n - [ ] \u003c!-- rebase-check --\u003eIf you want to rebase/retry this MR, check this box\n\n---\n\nThis MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).\n\u003c!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45OS4yIiwidXBkYXRlZEluVmVyIjoiNDEuOTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwiZGVwZW5kZW5jeS10eXBlOjpwYXRjaCIsIm1haW50ZW5hbmNlOjpkZXBlbmRlbmN5IiwidHlwZTo6bWFpbnRlbmFuY2UiXX0=--\u003e", + "state": "merged", + "created_at": "2025-09-25T13:39:02.693Z", + "updated_at": "2025-09-25T13:55:39.445Z", + "merged_by": { + "id": 19535662, + "username": "fforster", + "public_email": "fforster@gitlab.com", + "name": "Florian Forster", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/19535662/avatar.png", + "web_url": "https://gitlab.com/fforster" + }, + "merge_user": { + "id": 19535662, + "username": "fforster", + "public_email": "fforster@gitlab.com", + "name": "Florian Forster", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/19535662/avatar.png", + "web_url": "https://gitlab.com/fforster" + }, + "merged_at": "2025-09-25T13:51:04.717Z", + "closed_by": null, + "closed_at": null, + "target_branch": "main", + "source_branch": "renovate/registry.gitlab.com-gitlab-com-gl-infra-platform-runway-runwayctl-runwayctl-4.x", + "user_notes_count": 2, + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 24614294, + "username": "group_67740146_bot_7c548ecafb02767811ea1226de16525a", + "public_email": null, + "name": "Runway Renovate Robot", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/24614294/avatar-small.jpg", + "web_url": "https://gitlab.com/group_67740146_bot_7c548ecafb02767811ea1226de16525a" + }, + "assignees": [], + "assignee": null, + "reviewers": [ + { + "id": 25362292, + "username": "jtoto-gtl", + "public_email": "jtoto@gitlab.com", + "name": "JP Toto", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/25362292/avatar.png", + "web_url": "https://gitlab.com/jtoto-gtl" + } + ], + "source_project_id": 46229026, + "target_project_id": 46229026, + "labels": [ + { + "id": 30201862, + "name": "dependencies", + "description": "Merge requests from Renovate (https://gitlab.com/gitlab-com/gl-infra/renovate/renovate-ci/)", + "description_html": "Merge requests from Renovate (\u003ca href=\"https://gitlab.com/gitlab-com/gl-infra/renovate/renovate-ci/\"\u003ehttps://gitlab.com/gitlab-com/gl-infra/renovate/renovate-ci/\u003c/a\u003e)", + "text_color": "#FFFFFF", + "color": "#6699cc" + }, + { + "id": 39246230, + "name": "dependency-type::patch", + "description": "Renovate patch version upgrade", + "description_html": "Renovate patch version upgrade", + "text_color": "#FFFFFF", + "color": "#6699cc" + }, + { + "id": 24287561, + "name": "maintenance::dependency", + "description": "Dependency updates and their version upgrades", + "description_html": "Dependency updates and their version upgrades", + "text_color": "#FFFFFF", + "color": "#7f8c8d" + }, + { + "id": 23853047, + "name": "type::maintenance", + "description": "Upkeeping efforts and catch-up corrective improvements that are not Feature nor Bugs. Read more at https://handbook.gitlab.com/handbook/product/groups/product-analysis/engineering/metrics/#work-type-classification", + "description_html": "Upkeeping efforts and catch-up corrective improvements that are not Feature nor Bugs. Read more at \u003ca href=\"https://handbook.gitlab.com/handbook/product/groups/product-analysis/engineering/metrics/#work-type-classification\" rel=\"nofollow noreferrer noopener\" target=\"_blank\"\u003ehttps://handbook.gitlab.com/handbook/product/groups/product-analysis/engineering/metrics/#work-type-classification\u003c/a\u003e", + "text_color": "#FFFFFF", + "color": "#330066" + } + ], + "draft": false, + "imported": false, + "imported_from": "none", + "work_in_progress": false, + "milestone": null, + "merge_when_pipeline_succeeds": false, + "merge_status": "can_be_merged", + "detailed_merge_status": "not_open", + "merge_after": null, + "sha": "c824f1a9ee80ed354f21c2188d45992e972a1553", + "merge_commit_sha": "3c3516c724b60250a61d972f2f503cd0b84882a4", + "squash_commit_sha": "c824f1a9ee80ed354f21c2188d45992e972a1553", + "discussion_locked": null, + "should_remove_source_branch": true, + "force_remove_source_branch": true, + "prepared_at": "2025-09-25T13:39:13.854Z", + "reference": "!1084", + "references": { + "short": "!1084", + "relative": "provisioner!1084", + "full": "gitlab-com/gl-infra/platform/runway/provisioner!1084" + }, + "web_url": "https://gitlab.com/gitlab-com/gl-infra/platform/runway/provisioner/-/merge_requests/1084", + "time_stats": { + "time_estimate": 0, + "total_time_spent": 0, + "human_time_estimate": null, + "human_total_time_spent": null + }, + "squash": true, + "squash_on_merge": true, + "task_completion_status": { + "count": 1, + "completed_count": 0 + }, + "has_conflicts": false, + "blocking_discussions_resolved": true, + "approvals_before_merge": null + } +] diff --git a/testdata/list_users.json b/testdata/list_users.json new file mode 100644 index 00000000..85ce1e02 --- /dev/null +++ b/testdata/list_users.json @@ -0,0 +1,26 @@ +[ + { + "id": 1, + "username": "example_user1", + "name": "Example User 1", + "state": "active", + "public_email": "longcat1@example.com", + "web_url": "http://localhost:3000/example_user1" + }, + { + "id": 2, + "username": "example_user2", + "name": "Example User 2", + "state": "active", + "public_email": "longcat2@example.com", + "web_url": "http://localhost:3000/example_user2" + }, + { + "id": 3, + "username": "example_user3", + "name": "Example User 3", + "state": "active", + "public_email": "longcat3@example.com", + "web_url": "http://localhost:3000/example_user3" + } +] diff --git a/testing/api_generated.go b/testing/api_generated.go index 070610c0..0e445f35 100644 --- a/testing/api_generated.go +++ b/testing/api_generated.go @@ -89,6 +89,7 @@ package testing //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=merge_trains_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MergeTrainsServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=metadata_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MetadataServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=milestones_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MilestonesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=model_registry_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ModelRegistryServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=namespaces_mock.go -package=testing gitlab.com/gitlab-org/api/client-go NamespacesServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=notes_mock.go -package=testing gitlab.com/gitlab-org/api/client-go NotesServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=notifications_mock.go -package=testing gitlab.com/gitlab-org/api/client-go NotificationSettingsServiceInterface @@ -101,6 +102,7 @@ package testing //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pipelines_mock.go -package=testing gitlab.com/gitlab-org/api/client-go PipelinesServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=plan_limits_mock.go -package=testing gitlab.com/gitlab-org/api/client-go PlanLimitsServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_access_tokens_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectAccessTokensServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_aliases_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectAliasesServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_badges_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectBadgesServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_clusters_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectClustersServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_feature_flags_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectFeatureFlagServiceInterface @@ -112,12 +114,14 @@ package testing //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_repository_storage_move_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectRepositoryStorageMoveServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_security_settings_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectSecuritySettingsServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_snippets_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectSnippetsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_statistics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectStatisticsServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_templates_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectTemplatesServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_variables_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectVariablesServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_vulnerabilities_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectVulnerabilitiesServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=projects_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectsServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_branches_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProtectedBranchesServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_environments_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProtectedEnvironmentsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_packages_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProtectedPackagesServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_tags_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProtectedTagsServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=releaselinks_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ReleaseLinksServiceInterface //go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=releases_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ReleasesServiceInterface diff --git a/testing/client_generated.go b/testing/client_generated.go index 410478c1..d1787802 100644 --- a/testing/client_generated.go +++ b/testing/client_generated.go @@ -98,6 +98,7 @@ type testClientMocks struct { MockMergeTrains *MockMergeTrainsServiceInterface MockMetadata *MockMetadataServiceInterface MockMilestones *MockMilestonesServiceInterface + MockModelRegistry *MockModelRegistryServiceInterface MockNamespaces *MockNamespacesServiceInterface MockNotes *MockNotesServiceInterface MockNotificationSettings *MockNotificationSettingsServiceInterface @@ -110,6 +111,7 @@ type testClientMocks struct { MockPipelines *MockPipelinesServiceInterface MockPlanLimits *MockPlanLimitsServiceInterface MockProjectAccessTokens *MockProjectAccessTokensServiceInterface + MockProjectAliases *MockProjectAliasesServiceInterface MockProjectBadges *MockProjectBadgesServiceInterface MockProjectCluster *MockProjectClustersServiceInterface MockProjectFeatureFlags *MockProjectFeatureFlagServiceInterface @@ -121,12 +123,14 @@ type testClientMocks struct { MockProjectRepositoryStorageMove *MockProjectRepositoryStorageMoveServiceInterface MockProjectSecuritySettings *MockProjectSecuritySettingsServiceInterface MockProjectSnippets *MockProjectSnippetsServiceInterface + MockProjectStatistics *MockProjectStatisticsServiceInterface MockProjectTemplates *MockProjectTemplatesServiceInterface MockProjectVariables *MockProjectVariablesServiceInterface MockProjectVulnerabilities *MockProjectVulnerabilitiesServiceInterface MockProjects *MockProjectsServiceInterface MockProtectedBranches *MockProtectedBranchesServiceInterface MockProtectedEnvironments *MockProtectedEnvironmentsServiceInterface + MockProtectedPackages *MockProtectedPackagesServiceInterface MockProtectedTags *MockProtectedTagsServiceInterface MockReleaseLinks *MockReleaseLinksServiceInterface MockReleases *MockReleasesServiceInterface @@ -248,6 +252,7 @@ func newTestClientWithCtrl(ctrl *gomock.Controller, options ...gitlab.ClientOpti mockMergeTrains := NewMockMergeTrainsServiceInterface(ctrl) mockMetadata := NewMockMetadataServiceInterface(ctrl) mockMilestones := NewMockMilestonesServiceInterface(ctrl) + mockModelRegistry := NewMockModelRegistryServiceInterface(ctrl) mockNamespaces := NewMockNamespacesServiceInterface(ctrl) mockNotes := NewMockNotesServiceInterface(ctrl) mockNotificationSettings := NewMockNotificationSettingsServiceInterface(ctrl) @@ -260,6 +265,7 @@ func newTestClientWithCtrl(ctrl *gomock.Controller, options ...gitlab.ClientOpti mockPipelines := NewMockPipelinesServiceInterface(ctrl) mockPlanLimits := NewMockPlanLimitsServiceInterface(ctrl) mockProjectAccessTokens := NewMockProjectAccessTokensServiceInterface(ctrl) + mockProjectAliases := NewMockProjectAliasesServiceInterface(ctrl) mockProjectBadges := NewMockProjectBadgesServiceInterface(ctrl) mockProjectCluster := NewMockProjectClustersServiceInterface(ctrl) mockProjectFeatureFlags := NewMockProjectFeatureFlagServiceInterface(ctrl) @@ -271,12 +277,14 @@ func newTestClientWithCtrl(ctrl *gomock.Controller, options ...gitlab.ClientOpti mockProjectRepositoryStorageMove := NewMockProjectRepositoryStorageMoveServiceInterface(ctrl) mockProjectSecuritySettings := NewMockProjectSecuritySettingsServiceInterface(ctrl) mockProjectSnippets := NewMockProjectSnippetsServiceInterface(ctrl) + mockProjectStatistics := NewMockProjectStatisticsServiceInterface(ctrl) mockProjectTemplates := NewMockProjectTemplatesServiceInterface(ctrl) mockProjectVariables := NewMockProjectVariablesServiceInterface(ctrl) mockProjectVulnerabilities := NewMockProjectVulnerabilitiesServiceInterface(ctrl) mockProjects := NewMockProjectsServiceInterface(ctrl) mockProtectedBranches := NewMockProtectedBranchesServiceInterface(ctrl) mockProtectedEnvironments := NewMockProtectedEnvironmentsServiceInterface(ctrl) + mockProtectedPackages := NewMockProtectedPackagesServiceInterface(ctrl) mockProtectedTags := NewMockProtectedTagsServiceInterface(ctrl) mockReleaseLinks := NewMockReleaseLinksServiceInterface(ctrl) mockReleases := NewMockReleasesServiceInterface(ctrl) @@ -397,6 +405,7 @@ func newTestClientWithCtrl(ctrl *gomock.Controller, options ...gitlab.ClientOpti MergeTrains: mockMergeTrains, Metadata: mockMetadata, Milestones: mockMilestones, + ModelRegistry: mockModelRegistry, Namespaces: mockNamespaces, Notes: mockNotes, NotificationSettings: mockNotificationSettings, @@ -409,6 +418,7 @@ func newTestClientWithCtrl(ctrl *gomock.Controller, options ...gitlab.ClientOpti Pipelines: mockPipelines, PlanLimits: mockPlanLimits, ProjectAccessTokens: mockProjectAccessTokens, + ProjectAliases: mockProjectAliases, ProjectBadges: mockProjectBadges, ProjectCluster: mockProjectCluster, ProjectFeatureFlags: mockProjectFeatureFlags, @@ -420,12 +430,14 @@ func newTestClientWithCtrl(ctrl *gomock.Controller, options ...gitlab.ClientOpti ProjectRepositoryStorageMove: mockProjectRepositoryStorageMove, ProjectSecuritySettings: mockProjectSecuritySettings, ProjectSnippets: mockProjectSnippets, + ProjectStatistics: mockProjectStatistics, ProjectTemplates: mockProjectTemplates, ProjectVariables: mockProjectVariables, ProjectVulnerabilities: mockProjectVulnerabilities, Projects: mockProjects, ProtectedBranches: mockProtectedBranches, ProtectedEnvironments: mockProtectedEnvironments, + ProtectedPackages: mockProtectedPackages, ProtectedTags: mockProtectedTags, ReleaseLinks: mockReleaseLinks, Releases: mockReleases, @@ -558,6 +570,7 @@ func newTestClientWithCtrl(ctrl *gomock.Controller, options ...gitlab.ClientOpti MockMergeTrains: mockMergeTrains, MockMetadata: mockMetadata, MockMilestones: mockMilestones, + MockModelRegistry: mockModelRegistry, MockNamespaces: mockNamespaces, MockNotes: mockNotes, MockNotificationSettings: mockNotificationSettings, @@ -570,6 +583,7 @@ func newTestClientWithCtrl(ctrl *gomock.Controller, options ...gitlab.ClientOpti MockPipelines: mockPipelines, MockPlanLimits: mockPlanLimits, MockProjectAccessTokens: mockProjectAccessTokens, + MockProjectAliases: mockProjectAliases, MockProjectBadges: mockProjectBadges, MockProjectCluster: mockProjectCluster, MockProjectFeatureFlags: mockProjectFeatureFlags, @@ -581,12 +595,14 @@ func newTestClientWithCtrl(ctrl *gomock.Controller, options ...gitlab.ClientOpti MockProjectRepositoryStorageMove: mockProjectRepositoryStorageMove, MockProjectSecuritySettings: mockProjectSecuritySettings, MockProjectSnippets: mockProjectSnippets, + MockProjectStatistics: mockProjectStatistics, MockProjectTemplates: mockProjectTemplates, MockProjectVariables: mockProjectVariables, MockProjectVulnerabilities: mockProjectVulnerabilities, MockProjects: mockProjects, MockProtectedBranches: mockProtectedBranches, MockProtectedEnvironments: mockProtectedEnvironments, + MockProtectedPackages: mockProtectedPackages, MockProtectedTags: mockProtectedTags, MockReleaseLinks: mockReleaseLinks, MockReleases: mockReleases, diff --git a/testing/enterprise_users_mock.go b/testing/enterprise_users_mock.go index 4684ab1f..727d70e2 100644 --- a/testing/enterprise_users_mock.go +++ b/testing/enterprise_users_mock.go @@ -40,6 +40,50 @@ func (m *MockEnterpriseUsersServiceInterface) EXPECT() *MockEnterpriseUsersServi return m.recorder } +// DeleteEnterpriseUser mocks base method. +func (m *MockEnterpriseUsersServiceInterface) DeleteEnterpriseUser(gid any, uid int, deleteOptions *gitlab.DeleteEnterpriseUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{gid, uid, deleteOptions} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteEnterpriseUser", varargs...) + ret0, _ := ret[0].(*gitlab.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteEnterpriseUser indicates an expected call of DeleteEnterpriseUser. +func (mr *MockEnterpriseUsersServiceInterfaceMockRecorder) DeleteEnterpriseUser(gid, uid, deleteOptions any, options ...any) *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{gid, uid, deleteOptions}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteEnterpriseUser", reflect.TypeOf((*MockEnterpriseUsersServiceInterface)(nil).DeleteEnterpriseUser), varargs...) + return &MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall{Call: call} +} + +// MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall wrap *gomock.Call +type MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall) Return(arg0 *gitlab.Response, arg1 error) *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall) Do(f func(any, int, *gitlab.DeleteEnterpriseUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall) DoAndReturn(f func(any, int, *gitlab.DeleteEnterpriseUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + // Disable2FAForEnterpriseUser mocks base method. func (m *MockEnterpriseUsersServiceInterface) Disable2FAForEnterpriseUser(gid any, uid int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() diff --git a/testing/model_registry_mock.go b/testing/model_registry_mock.go new file mode 100644 index 00000000..44ccecbf --- /dev/null +++ b/testing/model_registry_mock.go @@ -0,0 +1,87 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: gitlab.com/gitlab-org/api/client-go (interfaces: ModelRegistryServiceInterface) +// +// Generated by this command: +// +// mockgen -typed -destination=model_registry_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ModelRegistryServiceInterface +// + +// Package testing is a generated GoMock package. +package testing + +import ( + bytes "bytes" + reflect "reflect" + + gitlab "gitlab.com/gitlab-org/api/client-go" + gomock "go.uber.org/mock/gomock" +) + +// MockModelRegistryServiceInterface is a mock of ModelRegistryServiceInterface interface. +type MockModelRegistryServiceInterface struct { + ctrl *gomock.Controller + recorder *MockModelRegistryServiceInterfaceMockRecorder + isgomock struct{} +} + +// MockModelRegistryServiceInterfaceMockRecorder is the mock recorder for MockModelRegistryServiceInterface. +type MockModelRegistryServiceInterfaceMockRecorder struct { + mock *MockModelRegistryServiceInterface +} + +// NewMockModelRegistryServiceInterface creates a new mock instance. +func NewMockModelRegistryServiceInterface(ctrl *gomock.Controller) *MockModelRegistryServiceInterface { + mock := &MockModelRegistryServiceInterface{ctrl: ctrl} + mock.recorder = &MockModelRegistryServiceInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockModelRegistryServiceInterface) EXPECT() *MockModelRegistryServiceInterfaceMockRecorder { + return m.recorder +} + +// DownloadMachineLearningModelPackage mocks base method. +func (m *MockModelRegistryServiceInterface) DownloadMachineLearningModelPackage(pid, modelVersionID any, path, filename string, options ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{pid, modelVersionID, path, filename} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DownloadMachineLearningModelPackage", varargs...) + ret0, _ := ret[0].(*bytes.Reader) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// DownloadMachineLearningModelPackage indicates an expected call of DownloadMachineLearningModelPackage. +func (mr *MockModelRegistryServiceInterfaceMockRecorder) DownloadMachineLearningModelPackage(pid, modelVersionID, path, filename any, options ...any) *MockModelRegistryServiceInterfaceDownloadMachineLearningModelPackageCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{pid, modelVersionID, path, filename}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DownloadMachineLearningModelPackage", reflect.TypeOf((*MockModelRegistryServiceInterface)(nil).DownloadMachineLearningModelPackage), varargs...) + return &MockModelRegistryServiceInterfaceDownloadMachineLearningModelPackageCall{Call: call} +} + +// MockModelRegistryServiceInterfaceDownloadMachineLearningModelPackageCall wrap *gomock.Call +type MockModelRegistryServiceInterfaceDownloadMachineLearningModelPackageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockModelRegistryServiceInterfaceDownloadMachineLearningModelPackageCall) Return(arg0 *bytes.Reader, arg1 *gitlab.Response, arg2 error) *MockModelRegistryServiceInterfaceDownloadMachineLearningModelPackageCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockModelRegistryServiceInterfaceDownloadMachineLearningModelPackageCall) Do(f func(any, any, string, string, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockModelRegistryServiceInterfaceDownloadMachineLearningModelPackageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockModelRegistryServiceInterfaceDownloadMachineLearningModelPackageCall) DoAndReturn(f func(any, any, string, string, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockModelRegistryServiceInterfaceDownloadMachineLearningModelPackageCall { + c.Call = c.Call.DoAndReturn(f) + return c +} diff --git a/testing/project_aliases_mock.go b/testing/project_aliases_mock.go new file mode 100644 index 00000000..4ac6894b --- /dev/null +++ b/testing/project_aliases_mock.go @@ -0,0 +1,219 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: gitlab.com/gitlab-org/api/client-go (interfaces: ProjectAliasesServiceInterface) +// +// Generated by this command: +// +// mockgen -typed -destination=project_aliases_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectAliasesServiceInterface +// + +// Package testing is a generated GoMock package. +package testing + +import ( + reflect "reflect" + + gitlab "gitlab.com/gitlab-org/api/client-go" + gomock "go.uber.org/mock/gomock" +) + +// MockProjectAliasesServiceInterface is a mock of ProjectAliasesServiceInterface interface. +type MockProjectAliasesServiceInterface struct { + ctrl *gomock.Controller + recorder *MockProjectAliasesServiceInterfaceMockRecorder + isgomock struct{} +} + +// MockProjectAliasesServiceInterfaceMockRecorder is the mock recorder for MockProjectAliasesServiceInterface. +type MockProjectAliasesServiceInterfaceMockRecorder struct { + mock *MockProjectAliasesServiceInterface +} + +// NewMockProjectAliasesServiceInterface creates a new mock instance. +func NewMockProjectAliasesServiceInterface(ctrl *gomock.Controller) *MockProjectAliasesServiceInterface { + mock := &MockProjectAliasesServiceInterface{ctrl: ctrl} + mock.recorder = &MockProjectAliasesServiceInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockProjectAliasesServiceInterface) EXPECT() *MockProjectAliasesServiceInterfaceMockRecorder { + return m.recorder +} + +// CreateProjectAlias mocks base method. +func (m *MockProjectAliasesServiceInterface) CreateProjectAlias(opt *gitlab.CreateProjectAliasOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectAlias, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{opt} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateProjectAlias", varargs...) + ret0, _ := ret[0].(*gitlab.ProjectAlias) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// CreateProjectAlias indicates an expected call of CreateProjectAlias. +func (mr *MockProjectAliasesServiceInterfaceMockRecorder) CreateProjectAlias(opt any, options ...any) *MockProjectAliasesServiceInterfaceCreateProjectAliasCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{opt}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateProjectAlias", reflect.TypeOf((*MockProjectAliasesServiceInterface)(nil).CreateProjectAlias), varargs...) + return &MockProjectAliasesServiceInterfaceCreateProjectAliasCall{Call: call} +} + +// MockProjectAliasesServiceInterfaceCreateProjectAliasCall wrap *gomock.Call +type MockProjectAliasesServiceInterfaceCreateProjectAliasCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProjectAliasesServiceInterfaceCreateProjectAliasCall) Return(arg0 *gitlab.ProjectAlias, arg1 *gitlab.Response, arg2 error) *MockProjectAliasesServiceInterfaceCreateProjectAliasCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProjectAliasesServiceInterfaceCreateProjectAliasCall) Do(f func(*gitlab.CreateProjectAliasOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAlias, *gitlab.Response, error)) *MockProjectAliasesServiceInterfaceCreateProjectAliasCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProjectAliasesServiceInterfaceCreateProjectAliasCall) DoAndReturn(f func(*gitlab.CreateProjectAliasOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAlias, *gitlab.Response, error)) *MockProjectAliasesServiceInterfaceCreateProjectAliasCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// DeleteProjectAlias mocks base method. +func (m *MockProjectAliasesServiceInterface) DeleteProjectAlias(name string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{name} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteProjectAlias", varargs...) + ret0, _ := ret[0].(*gitlab.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteProjectAlias indicates an expected call of DeleteProjectAlias. +func (mr *MockProjectAliasesServiceInterfaceMockRecorder) DeleteProjectAlias(name any, options ...any) *MockProjectAliasesServiceInterfaceDeleteProjectAliasCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{name}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteProjectAlias", reflect.TypeOf((*MockProjectAliasesServiceInterface)(nil).DeleteProjectAlias), varargs...) + return &MockProjectAliasesServiceInterfaceDeleteProjectAliasCall{Call: call} +} + +// MockProjectAliasesServiceInterfaceDeleteProjectAliasCall wrap *gomock.Call +type MockProjectAliasesServiceInterfaceDeleteProjectAliasCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProjectAliasesServiceInterfaceDeleteProjectAliasCall) Return(arg0 *gitlab.Response, arg1 error) *MockProjectAliasesServiceInterfaceDeleteProjectAliasCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProjectAliasesServiceInterfaceDeleteProjectAliasCall) Do(f func(string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectAliasesServiceInterfaceDeleteProjectAliasCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProjectAliasesServiceInterfaceDeleteProjectAliasCall) DoAndReturn(f func(string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectAliasesServiceInterfaceDeleteProjectAliasCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// GetProjectAlias mocks base method. +func (m *MockProjectAliasesServiceInterface) GetProjectAlias(name string, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectAlias, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{name} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetProjectAlias", varargs...) + ret0, _ := ret[0].(*gitlab.ProjectAlias) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetProjectAlias indicates an expected call of GetProjectAlias. +func (mr *MockProjectAliasesServiceInterfaceMockRecorder) GetProjectAlias(name any, options ...any) *MockProjectAliasesServiceInterfaceGetProjectAliasCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{name}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProjectAlias", reflect.TypeOf((*MockProjectAliasesServiceInterface)(nil).GetProjectAlias), varargs...) + return &MockProjectAliasesServiceInterfaceGetProjectAliasCall{Call: call} +} + +// MockProjectAliasesServiceInterfaceGetProjectAliasCall wrap *gomock.Call +type MockProjectAliasesServiceInterfaceGetProjectAliasCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProjectAliasesServiceInterfaceGetProjectAliasCall) Return(arg0 *gitlab.ProjectAlias, arg1 *gitlab.Response, arg2 error) *MockProjectAliasesServiceInterfaceGetProjectAliasCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProjectAliasesServiceInterfaceGetProjectAliasCall) Do(f func(string, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAlias, *gitlab.Response, error)) *MockProjectAliasesServiceInterfaceGetProjectAliasCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProjectAliasesServiceInterfaceGetProjectAliasCall) DoAndReturn(f func(string, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAlias, *gitlab.Response, error)) *MockProjectAliasesServiceInterfaceGetProjectAliasCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// ListProjectAliases mocks base method. +func (m *MockProjectAliasesServiceInterface) ListProjectAliases(options ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectAlias, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListProjectAliases", varargs...) + ret0, _ := ret[0].([]*gitlab.ProjectAlias) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// ListProjectAliases indicates an expected call of ListProjectAliases. +func (mr *MockProjectAliasesServiceInterfaceMockRecorder) ListProjectAliases(options ...any) *MockProjectAliasesServiceInterfaceListProjectAliasesCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListProjectAliases", reflect.TypeOf((*MockProjectAliasesServiceInterface)(nil).ListProjectAliases), options...) + return &MockProjectAliasesServiceInterfaceListProjectAliasesCall{Call: call} +} + +// MockProjectAliasesServiceInterfaceListProjectAliasesCall wrap *gomock.Call +type MockProjectAliasesServiceInterfaceListProjectAliasesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProjectAliasesServiceInterfaceListProjectAliasesCall) Return(arg0 []*gitlab.ProjectAlias, arg1 *gitlab.Response, arg2 error) *MockProjectAliasesServiceInterfaceListProjectAliasesCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProjectAliasesServiceInterfaceListProjectAliasesCall) Do(f func(...gitlab.RequestOptionFunc) ([]*gitlab.ProjectAlias, *gitlab.Response, error)) *MockProjectAliasesServiceInterfaceListProjectAliasesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProjectAliasesServiceInterfaceListProjectAliasesCall) DoAndReturn(f func(...gitlab.RequestOptionFunc) ([]*gitlab.ProjectAlias, *gitlab.Response, error)) *MockProjectAliasesServiceInterfaceListProjectAliasesCall { + c.Call = c.Call.DoAndReturn(f) + return c +} diff --git a/testing/project_statistics_mock.go b/testing/project_statistics_mock.go new file mode 100644 index 00000000..c9ccbca8 --- /dev/null +++ b/testing/project_statistics_mock.go @@ -0,0 +1,86 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: gitlab.com/gitlab-org/api/client-go (interfaces: ProjectStatisticsServiceInterface) +// +// Generated by this command: +// +// mockgen -typed -destination=project_statistics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectStatisticsServiceInterface +// + +// Package testing is a generated GoMock package. +package testing + +import ( + reflect "reflect" + + gitlab "gitlab.com/gitlab-org/api/client-go" + gomock "go.uber.org/mock/gomock" +) + +// MockProjectStatisticsServiceInterface is a mock of ProjectStatisticsServiceInterface interface. +type MockProjectStatisticsServiceInterface struct { + ctrl *gomock.Controller + recorder *MockProjectStatisticsServiceInterfaceMockRecorder + isgomock struct{} +} + +// MockProjectStatisticsServiceInterfaceMockRecorder is the mock recorder for MockProjectStatisticsServiceInterface. +type MockProjectStatisticsServiceInterfaceMockRecorder struct { + mock *MockProjectStatisticsServiceInterface +} + +// NewMockProjectStatisticsServiceInterface creates a new mock instance. +func NewMockProjectStatisticsServiceInterface(ctrl *gomock.Controller) *MockProjectStatisticsServiceInterface { + mock := &MockProjectStatisticsServiceInterface{ctrl: ctrl} + mock.recorder = &MockProjectStatisticsServiceInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockProjectStatisticsServiceInterface) EXPECT() *MockProjectStatisticsServiceInterfaceMockRecorder { + return m.recorder +} + +// Last30DaysStatistics mocks base method. +func (m *MockProjectStatisticsServiceInterface) Last30DaysStatistics(pid any, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectStatistics, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{pid} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Last30DaysStatistics", varargs...) + ret0, _ := ret[0].(*gitlab.ProjectStatistics) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// Last30DaysStatistics indicates an expected call of Last30DaysStatistics. +func (mr *MockProjectStatisticsServiceInterfaceMockRecorder) Last30DaysStatistics(pid any, options ...any) *MockProjectStatisticsServiceInterfaceLast30DaysStatisticsCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{pid}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Last30DaysStatistics", reflect.TypeOf((*MockProjectStatisticsServiceInterface)(nil).Last30DaysStatistics), varargs...) + return &MockProjectStatisticsServiceInterfaceLast30DaysStatisticsCall{Call: call} +} + +// MockProjectStatisticsServiceInterfaceLast30DaysStatisticsCall wrap *gomock.Call +type MockProjectStatisticsServiceInterfaceLast30DaysStatisticsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProjectStatisticsServiceInterfaceLast30DaysStatisticsCall) Return(arg0 *gitlab.ProjectStatistics, arg1 *gitlab.Response, arg2 error) *MockProjectStatisticsServiceInterfaceLast30DaysStatisticsCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProjectStatisticsServiceInterfaceLast30DaysStatisticsCall) Do(f func(any, ...gitlab.RequestOptionFunc) (*gitlab.ProjectStatistics, *gitlab.Response, error)) *MockProjectStatisticsServiceInterfaceLast30DaysStatisticsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProjectStatisticsServiceInterfaceLast30DaysStatisticsCall) DoAndReturn(f func(any, ...gitlab.RequestOptionFunc) (*gitlab.ProjectStatistics, *gitlab.Response, error)) *MockProjectStatisticsServiceInterfaceLast30DaysStatisticsCall { + c.Call = c.Call.DoAndReturn(f) + return c +} diff --git a/testing/projects_mock.go b/testing/projects_mock.go index 7344fc5b..001ebaf5 100644 --- a/testing/projects_mock.go +++ b/testing/projects_mock.go @@ -1519,6 +1519,51 @@ func (c *MockProjectsServiceInterfaceListProjectHooksCall) DoAndReturn(f func(an return c } +// ListProjectStarrers mocks base method. +func (m *MockProjectsServiceInterface) ListProjectStarrers(pid any, opts *gitlab.ListProjectStarrersOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectStarrer, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{pid, opts} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListProjectStarrers", varargs...) + ret0, _ := ret[0].([]*gitlab.ProjectStarrer) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// ListProjectStarrers indicates an expected call of ListProjectStarrers. +func (mr *MockProjectsServiceInterfaceMockRecorder) ListProjectStarrers(pid, opts any, options ...any) *MockProjectsServiceInterfaceListProjectStarrersCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{pid, opts}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListProjectStarrers", reflect.TypeOf((*MockProjectsServiceInterface)(nil).ListProjectStarrers), varargs...) + return &MockProjectsServiceInterfaceListProjectStarrersCall{Call: call} +} + +// MockProjectsServiceInterfaceListProjectStarrersCall wrap *gomock.Call +type MockProjectsServiceInterfaceListProjectStarrersCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProjectsServiceInterfaceListProjectStarrersCall) Return(arg0 []*gitlab.ProjectStarrer, arg1 *gitlab.Response, arg2 error) *MockProjectsServiceInterfaceListProjectStarrersCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProjectsServiceInterfaceListProjectStarrersCall) Do(f func(any, *gitlab.ListProjectStarrersOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectStarrer, *gitlab.Response, error)) *MockProjectsServiceInterfaceListProjectStarrersCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProjectsServiceInterfaceListProjectStarrersCall) DoAndReturn(f func(any, *gitlab.ListProjectStarrersOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectStarrer, *gitlab.Response, error)) *MockProjectsServiceInterfaceListProjectStarrersCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + // ListProjects mocks base method. func (m *MockProjectsServiceInterface) ListProjects(opt *gitlab.ListProjectsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Project, *gitlab.Response, error) { m.ctrl.T.Helper() diff --git a/testing/protected_packages_mock.go b/testing/protected_packages_mock.go new file mode 100644 index 00000000..0da1cffb --- /dev/null +++ b/testing/protected_packages_mock.go @@ -0,0 +1,220 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: gitlab.com/gitlab-org/api/client-go (interfaces: ProtectedPackagesServiceInterface) +// +// Generated by this command: +// +// mockgen -typed -destination=protected_packages_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProtectedPackagesServiceInterface +// + +// Package testing is a generated GoMock package. +package testing + +import ( + reflect "reflect" + + gitlab "gitlab.com/gitlab-org/api/client-go" + gomock "go.uber.org/mock/gomock" +) + +// MockProtectedPackagesServiceInterface is a mock of ProtectedPackagesServiceInterface interface. +type MockProtectedPackagesServiceInterface struct { + ctrl *gomock.Controller + recorder *MockProtectedPackagesServiceInterfaceMockRecorder + isgomock struct{} +} + +// MockProtectedPackagesServiceInterfaceMockRecorder is the mock recorder for MockProtectedPackagesServiceInterface. +type MockProtectedPackagesServiceInterfaceMockRecorder struct { + mock *MockProtectedPackagesServiceInterface +} + +// NewMockProtectedPackagesServiceInterface creates a new mock instance. +func NewMockProtectedPackagesServiceInterface(ctrl *gomock.Controller) *MockProtectedPackagesServiceInterface { + mock := &MockProtectedPackagesServiceInterface{ctrl: ctrl} + mock.recorder = &MockProtectedPackagesServiceInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockProtectedPackagesServiceInterface) EXPECT() *MockProtectedPackagesServiceInterfaceMockRecorder { + return m.recorder +} + +// CreatePackageProtectionRules mocks base method. +func (m *MockProtectedPackagesServiceInterface) CreatePackageProtectionRules(pid any, opt *gitlab.CreatePackageProtectionRulesOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PackageProtectionRule, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{pid, opt} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreatePackageProtectionRules", varargs...) + ret0, _ := ret[0].(*gitlab.PackageProtectionRule) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// CreatePackageProtectionRules indicates an expected call of CreatePackageProtectionRules. +func (mr *MockProtectedPackagesServiceInterfaceMockRecorder) CreatePackageProtectionRules(pid, opt any, options ...any) *MockProtectedPackagesServiceInterfaceCreatePackageProtectionRulesCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{pid, opt}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePackageProtectionRules", reflect.TypeOf((*MockProtectedPackagesServiceInterface)(nil).CreatePackageProtectionRules), varargs...) + return &MockProtectedPackagesServiceInterfaceCreatePackageProtectionRulesCall{Call: call} +} + +// MockProtectedPackagesServiceInterfaceCreatePackageProtectionRulesCall wrap *gomock.Call +type MockProtectedPackagesServiceInterfaceCreatePackageProtectionRulesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProtectedPackagesServiceInterfaceCreatePackageProtectionRulesCall) Return(arg0 *gitlab.PackageProtectionRule, arg1 *gitlab.Response, arg2 error) *MockProtectedPackagesServiceInterfaceCreatePackageProtectionRulesCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProtectedPackagesServiceInterfaceCreatePackageProtectionRulesCall) Do(f func(any, *gitlab.CreatePackageProtectionRulesOptions, ...gitlab.RequestOptionFunc) (*gitlab.PackageProtectionRule, *gitlab.Response, error)) *MockProtectedPackagesServiceInterfaceCreatePackageProtectionRulesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProtectedPackagesServiceInterfaceCreatePackageProtectionRulesCall) DoAndReturn(f func(any, *gitlab.CreatePackageProtectionRulesOptions, ...gitlab.RequestOptionFunc) (*gitlab.PackageProtectionRule, *gitlab.Response, error)) *MockProtectedPackagesServiceInterfaceCreatePackageProtectionRulesCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// DeletePackageProtectionRules mocks base method. +func (m *MockProtectedPackagesServiceInterface) DeletePackageProtectionRules(pid any, packageProtectionRule int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{pid, packageProtectionRule} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeletePackageProtectionRules", varargs...) + ret0, _ := ret[0].(*gitlab.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeletePackageProtectionRules indicates an expected call of DeletePackageProtectionRules. +func (mr *MockProtectedPackagesServiceInterfaceMockRecorder) DeletePackageProtectionRules(pid, packageProtectionRule any, options ...any) *MockProtectedPackagesServiceInterfaceDeletePackageProtectionRulesCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{pid, packageProtectionRule}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePackageProtectionRules", reflect.TypeOf((*MockProtectedPackagesServiceInterface)(nil).DeletePackageProtectionRules), varargs...) + return &MockProtectedPackagesServiceInterfaceDeletePackageProtectionRulesCall{Call: call} +} + +// MockProtectedPackagesServiceInterfaceDeletePackageProtectionRulesCall wrap *gomock.Call +type MockProtectedPackagesServiceInterfaceDeletePackageProtectionRulesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProtectedPackagesServiceInterfaceDeletePackageProtectionRulesCall) Return(arg0 *gitlab.Response, arg1 error) *MockProtectedPackagesServiceInterfaceDeletePackageProtectionRulesCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProtectedPackagesServiceInterfaceDeletePackageProtectionRulesCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProtectedPackagesServiceInterfaceDeletePackageProtectionRulesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProtectedPackagesServiceInterfaceDeletePackageProtectionRulesCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProtectedPackagesServiceInterfaceDeletePackageProtectionRulesCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// ListPackageProtectionRules mocks base method. +func (m *MockProtectedPackagesServiceInterface) ListPackageProtectionRules(pid any, opt *gitlab.ListPackageProtectionRulesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.PackageProtectionRule, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{pid, opt} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListPackageProtectionRules", varargs...) + ret0, _ := ret[0].([]*gitlab.PackageProtectionRule) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// ListPackageProtectionRules indicates an expected call of ListPackageProtectionRules. +func (mr *MockProtectedPackagesServiceInterfaceMockRecorder) ListPackageProtectionRules(pid, opt any, options ...any) *MockProtectedPackagesServiceInterfaceListPackageProtectionRulesCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{pid, opt}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPackageProtectionRules", reflect.TypeOf((*MockProtectedPackagesServiceInterface)(nil).ListPackageProtectionRules), varargs...) + return &MockProtectedPackagesServiceInterfaceListPackageProtectionRulesCall{Call: call} +} + +// MockProtectedPackagesServiceInterfaceListPackageProtectionRulesCall wrap *gomock.Call +type MockProtectedPackagesServiceInterfaceListPackageProtectionRulesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProtectedPackagesServiceInterfaceListPackageProtectionRulesCall) Return(arg0 []*gitlab.PackageProtectionRule, arg1 *gitlab.Response, arg2 error) *MockProtectedPackagesServiceInterfaceListPackageProtectionRulesCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProtectedPackagesServiceInterfaceListPackageProtectionRulesCall) Do(f func(any, *gitlab.ListPackageProtectionRulesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.PackageProtectionRule, *gitlab.Response, error)) *MockProtectedPackagesServiceInterfaceListPackageProtectionRulesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProtectedPackagesServiceInterfaceListPackageProtectionRulesCall) DoAndReturn(f func(any, *gitlab.ListPackageProtectionRulesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.PackageProtectionRule, *gitlab.Response, error)) *MockProtectedPackagesServiceInterfaceListPackageProtectionRulesCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// UpdatePackageProtectionRules mocks base method. +func (m *MockProtectedPackagesServiceInterface) UpdatePackageProtectionRules(pid any, packageProtectionRule int64, opt *gitlab.UpdatePackageProtectionRulesOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PackageProtectionRule, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{pid, packageProtectionRule, opt} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePackageProtectionRules", varargs...) + ret0, _ := ret[0].(*gitlab.PackageProtectionRule) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// UpdatePackageProtectionRules indicates an expected call of UpdatePackageProtectionRules. +func (mr *MockProtectedPackagesServiceInterfaceMockRecorder) UpdatePackageProtectionRules(pid, packageProtectionRule, opt any, options ...any) *MockProtectedPackagesServiceInterfaceUpdatePackageProtectionRulesCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{pid, packageProtectionRule, opt}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePackageProtectionRules", reflect.TypeOf((*MockProtectedPackagesServiceInterface)(nil).UpdatePackageProtectionRules), varargs...) + return &MockProtectedPackagesServiceInterfaceUpdatePackageProtectionRulesCall{Call: call} +} + +// MockProtectedPackagesServiceInterfaceUpdatePackageProtectionRulesCall wrap *gomock.Call +type MockProtectedPackagesServiceInterfaceUpdatePackageProtectionRulesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProtectedPackagesServiceInterfaceUpdatePackageProtectionRulesCall) Return(arg0 *gitlab.PackageProtectionRule, arg1 *gitlab.Response, arg2 error) *MockProtectedPackagesServiceInterfaceUpdatePackageProtectionRulesCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProtectedPackagesServiceInterfaceUpdatePackageProtectionRulesCall) Do(f func(any, int64, *gitlab.UpdatePackageProtectionRulesOptions, ...gitlab.RequestOptionFunc) (*gitlab.PackageProtectionRule, *gitlab.Response, error)) *MockProtectedPackagesServiceInterfaceUpdatePackageProtectionRulesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProtectedPackagesServiceInterfaceUpdatePackageProtectionRulesCall) DoAndReturn(f func(any, int64, *gitlab.UpdatePackageProtectionRulesOptions, ...gitlab.RequestOptionFunc) (*gitlab.PackageProtectionRule, *gitlab.Response, error)) *MockProtectedPackagesServiceInterfaceUpdatePackageProtectionRulesCall { + c.Call = c.Call.DoAndReturn(f) + return c +} diff --git a/types.go b/types.go index 10c85300..c4ea7f01 100644 --- a/types.go +++ b/types.go @@ -718,9 +718,10 @@ type ResourceGroupProcessMode string // GitLab API docs: // https://docs.gitlab.com/ci/resource_groups/#process-modes const ( - Unordered ResourceGroupProcessMode = "unordered" - OldestFirst ResourceGroupProcessMode = "oldest_first" - NewestFirst ResourceGroupProcessMode = "newest_first" + Unordered ResourceGroupProcessMode = "unordered" + OldestFirst ResourceGroupProcessMode = "oldest_first" + NewestFirst ResourceGroupProcessMode = "newest_first" + NewestReadyFirst ResourceGroupProcessMode = "newest_ready_first" ) // SharedRunnersSettingValue determines whether shared runners are enabled for a diff --git a/types_test.go b/types_test.go index f6e14ddd..da44e05f 100644 --- a/types_test.go +++ b/types_test.go @@ -74,6 +74,8 @@ func TestBoolValue(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { + t.Parallel() + var b BoolValue if err := json.Unmarshal(testCase.data, &b); err != nil { t.Fatalf("Unexpected error: %v", err) diff --git a/validate_test.go b/validate_test.go index 082eb0e8..656dc69b 100644 --- a/validate_test.go +++ b/validate_test.go @@ -65,6 +65,8 @@ func TestValidateProject(t *testing.T) { for _, tc := range testCases { t.Run(tc.description, func(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/1/ci/lint", func(w http.ResponseWriter, r *http.Request) { @@ -161,6 +163,8 @@ func TestValidateProjectNamespace(t *testing.T) { for _, tc := range testCases { t.Run(tc.description, func(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/1/ci/lint", func(w http.ResponseWriter, r *http.Request) { @@ -236,6 +240,8 @@ func TestValidateProjectLint(t *testing.T) { for _, tc := range testCases { t.Run(tc.description, func(t *testing.T) { + t.Parallel() + mux, client := setup(t) mux.HandleFunc("/api/v4/projects/1/ci/lint", func(w http.ResponseWriter, r *http.Request) { -- GitLab From fd1bbe96075f43d573c800d77dd578faa68ca4c9 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Wed, 8 Oct 2025 21:45:18 -0500 Subject: [PATCH 15/26] chore(no-release): Add integration test support using a real instance Changelog: Improvements --- .gitignore | 1 + .gitlab-ci.yml | 56 +++ .vscode/settings.json | 7 + Makefile | 15 + docker-compose.yml | 61 +++ gitlab_test/users_integration_test.go | 604 ++++++++++++++++++++++++++ gitlab_test/utils_test.go | 114 +++++ scripts/await_healthy.sh | 27 ++ scripts/gitlab.rb | 45 ++ scripts/healthcheck_and_setup.sh | 46 ++ 10 files changed, 976 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 docker-compose.yml create mode 100644 gitlab_test/users_integration_test.go create mode 100644 gitlab_test/utils_test.go create mode 100755 scripts/await_healthy.sh create mode 100644 scripts/gitlab.rb create mode 100755 scripts/healthcheck_and_setup.sh diff --git a/.gitignore b/.gitignore index 79e862f1..49b01759 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ scripts/commitlint/node_modules gl-code-quality-report.json .mise/ +Gitlab-license.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 28dba870..8cabd436 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -177,6 +177,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:28.3.1-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/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..f0b08b5f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "go.testEnvVars": { + "GITLAB_INTEGRATION_TESTS": "1", + "GITLAB_TOKEN": "glpat-ACCTEST1234567890123", + "GITLAB_BASE_URL": "http://127.0.0.1:8095/api/v4" + } +} \ No newline at end of file diff --git a/Makefile b/Makefile index 1ae79c88..28c0f607 100644 --- a/Makefile +++ b/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') \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..d5fdf197 --- /dev/null +++ b/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/gitlab_test/users_integration_test.go b/gitlab_test/users_integration_test.go new file mode 100644 index 00000000..6d72ee5f --- /dev/null +++ b/gitlab_test/users_integration_test.go @@ -0,0 +1,604 @@ +//go:build integration + +package gitlab_test + +import ( + "bytes" + "fmt" + "net/http" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + gitlab "gitlab.com/gitlab-org/api/client-go" +) + +// Integration tests for the Users API. +// These tests require a GitLab instance running on localhost:8095. +// They also require a valid admin token in GITLAB_TOKEN environment variable. + +// TestUsersListUsersIntegration tests the ListUsers function. +func Test_UsersListUsers_Integration(t *testing.T) { + // GIVEN a GitLab instance running on localhost:8095 + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the ListUsers function is called + users, _, err := client.Users.ListUsers(&gitlab.ListUsersOptions{ + Username: &user.Username, + }) + require.NoError(t, err, "Failed to list users") + + // THEN it should return a list of users + assert.Len(t, users, 1) // Usernames are unique + assert.Equal(t, users[0].ID, user.ID) +} + +// Test_UsersGetUser_Integration tests the GetUser function with a regular user. +func Test_UsersGetUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the GetUser function is called with the user ID + retrievedUser, _, err := client.Users.GetUser(user.ID, gitlab.GetUsersOptions{}) + require.NoError(t, err, "Failed to get user") + + // THEN it should return the user details + assert.Equal(t, user.ID, retrievedUser.ID) + assert.Equal(t, user.Username, retrievedUser.Username) + assert.Equal(t, user.Name, retrievedUser.Name) + assert.Equal(t, user.Email, retrievedUser.Email) +} + +// Test_UsersBlockUser_Integration tests the BlockUser function. +func Test_UsersBlockUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the BlockUser function is called + err = client.Users.BlockUser(user.ID) + assert.NoError(t, err) + + // THEN the user should be blocked successfully + // Verify user is blocked by checking their state + retrievedUser, _, err := client.Users.GetUser(user.ID, gitlab.GetUsersOptions{}) + require.NoError(t, err, "Failed to get user after blocking") + + assert.Equal(t, "blocked", retrievedUser.State) +} + +// Test_UsersUnblockUser_Integration tests the UnblockUser function. +func Test_UsersUnblockUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a blocked test user + client := SetupIntegrationClient(t) + + // Create and block a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + err = client.Users.BlockUser(user.ID) + require.NoError(t, err, "Failed to block test user") + + // WHEN the UnblockUser function is called + err = client.Users.UnblockUser(user.ID) + assert.NoError(t, err) + + // THEN the user should be unblocked successfully + // Verify user is unblocked by checking their state + retrievedUser, _, err := client.Users.GetUser(user.ID, gitlab.GetUsersOptions{}) + require.NoError(t, err, "Failed to get user after unblocking") + assert.Equal(t, "active", retrievedUser.State) +} + +// Test_UsersBanUser_Integration tests the BanUser function. +func Test_UsersBanUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the BanUser function is called + err = client.Users.BanUser(user.ID) + assert.NoError(t, err) + + // THEN the user should be banned successfully + // Verify user is banned by checking their state + retrievedUser, _, err := client.Users.GetUser(user.ID, gitlab.GetUsersOptions{}) + require.NoError(t, err, "Failed to get user after banning") + assert.Equal(t, "banned", retrievedUser.State) +} + +// Test_UsersUnbanUser_Integration tests the UnbanUser function. +func Test_UsersUnbanUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a banned test user + client := SetupIntegrationClient(t) + + // Create and ban a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + err = client.Users.BanUser(user.ID) + require.NoError(t, err, "Failed to ban test user") + + // WHEN the UnbanUser function is called + err = client.Users.UnbanUser(user.ID) + assert.NoError(t, err) + + // THEN the user should be unbanned successfully + // Verify user is unbanned by checking their state + retrievedUser, _, err := client.Users.GetUser(user.ID, gitlab.GetUsersOptions{}) + require.NoError(t, err, "Failed to get user after unbanning") + assert.Equal(t, "active", retrievedUser.State) +} + +// Test_UsersDeactivateUser_Integration tests the DeactivateUser function. +func Test_UsersDeactivateUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the DeactivateUser function is called + err = client.Users.DeactivateUser(user.ID) + assert.NoError(t, err) + + // THEN the user should be deactivated successfully + // Verify user is deactivated by checking their state + retrievedUser, _, err := client.Users.GetUser(user.ID, gitlab.GetUsersOptions{}) + require.NoError(t, err, "Failed to get user after deactivating") + assert.Equal(t, "deactivated", retrievedUser.State) +} + +// Test_UsersActivateUser_Integration tests the ActivateUser function. +func Test_UsersActivateUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a deactivated test user + client := SetupIntegrationClient(t) + + // Create and deactivate a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + err = client.Users.DeactivateUser(user.ID) + require.NoError(t, err, "Failed to deactivate test user") + + // WHEN the ActivateUser function is called + err = client.Users.ActivateUser(user.ID) + assert.NoError(t, err) + + // THEN the user should be activated successfully + // Verify user is activated by checking their state + retrievedUser, _, err := client.Users.GetUser(user.ID, gitlab.GetUsersOptions{}) + require.NoError(t, err, "Failed to get user after activating") + assert.Equal(t, "active", retrievedUser.State) +} + +// Test_UsersCreateUser_Integration tests the CreateUser function. +func Test_UsersCreateUser_Integration(t *testing.T) { + // GIVEN a GitLab instance + client := SetupIntegrationClient(t) + + // WHEN the CreateUser function is called with valid user data + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // THEN a new user should be created successfully + // Verify the user was created with expected properties + assert.NotZero(t, user.ID) + assert.NotEmpty(t, user.Username) + assert.NotEmpty(t, user.Name) + assert.NotEmpty(t, user.Email) + assert.Equal(t, "active", user.State) +} + +// Test_UsersModifyUser_Integration tests the ModifyUser function. +func Test_UsersModifyUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the ModifyUser function is called with updated data + newName := "Modified Test User" + newBio := "This is a modified test user" + modifiedUser, _, err := client.Users.ModifyUser(user.ID, &gitlab.ModifyUserOptions{ + Name: &newName, + Bio: &newBio, + }) + assert.NoError(t, err) + + // THEN the user should be modified successfully + // Verify the modifications + assert.Equal(t, newName, modifiedUser.Name) + assert.Equal(t, newBio, modifiedUser.Bio) + assert.Equal(t, user.ID, modifiedUser.ID) + assert.Equal(t, user.Username, modifiedUser.Username) +} + +// Test_UsersDeleteUser_Integration tests the DeleteUser function. +func Test_UsersDeleteUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user (without cleanup since we're testing deletion) + suffix := time.Now().UnixNano() + username := fmt.Sprintf("testuser%d", suffix) + email := fmt.Sprintf("testuser%d@example.com", suffix) + name := fmt.Sprintf("Test User %d", suffix) + + user, _, err := client.Users.CreateUser(&gitlab.CreateUserOptions{ + Username: &username, + Email: &email, + Name: &name, + Password: gitlab.Ptr("f0hYXux#yy2CFypKq!aV"), + SkipConfirmation: gitlab.Ptr(true), + }) + require.NoError(t, err, "Failed to create test user") + + // WHEN the DeleteUser function is called + resp, err := client.Users.DeleteUser(user.ID) + assert.NoError(t, err) + + // THEN the user should be deleted successfully + // http 204 means the user is successfully deleted + assert.Equal(t, http.StatusNoContent, resp.StatusCode) + + // We cannot perform a "read after write" check to ensure the + // user is deleted, because the actual delete is async, so if we attempt + // to immediately read, it will succeed (which isn't what we would normally expect.) +} + +// Test_UsersGetUserAssociationsCount_Integration tests the GetUserAssociationsCount function. +func Test_UsersGetUserAssociationsCount_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the GetUserAssociationsCount function is called + associationsCount, _, err := client.Users.GetUserAssociationsCount(user.ID) + assert.NoError(t, err) + + // THEN it should return the user's association counts + // Verify the response structure + assert.NotNil(t, associationsCount) + assert.GreaterOrEqual(t, associationsCount.GroupsCount, 0) + assert.GreaterOrEqual(t, associationsCount.ProjectsCount, 0) + assert.GreaterOrEqual(t, associationsCount.IssuesCount, 0) + assert.GreaterOrEqual(t, associationsCount.MergeRequestsCount, 0) +} + +// Test_UsersGetUserMemberships_Integration tests the GetUserMemberships function. +func Test_UsersGetUserMemberships_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the GetUserMemberships function is called + memberships, _, err := client.Users.GetUserMemberships(user.ID, &gitlab.GetUserMembershipOptions{}) + assert.NoError(t, err) + + // THEN it should return the user's memberships + // Verify the response (should be empty for a new user) + assert.NotNil(t, memberships) + // New users typically have no memberships initially +} + +// Test_UsersGetUserStatus_Integration tests the GetUserStatus function. +func Test_UsersGetUserStatus_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the GetUserStatus function is called + status, _, err := client.Users.GetUserStatus(user.ID) + assert.NoError(t, err) + + // THEN it should return the user's status + // Verify the response structure (new users typically have empty status) + assert.NotNil(t, status) +} + +// Test_UsersSetUserStatus_Integration tests the SetUserStatus function. +func Test_UsersSetUserStatus_Integration(t *testing.T) { + // GIVEN a GitLab instance + client := SetupIntegrationClient(t) + + // WHEN the SetUserStatus function is called with status data + emoji := "coffee" + message := "Working on integration tests" + availability := gitlab.Busy + + status, _, err := client.Users.SetUserStatus(&gitlab.UserStatusOptions{ + Emoji: &emoji, + Message: &message, + Availability: &availability, + }) + assert.NoError(t, err) + + // THEN the current user's status should be updated + // Verify the status was set + assert.Equal(t, emoji, status.Emoji) + assert.Equal(t, message, status.Message) + assert.Equal(t, availability, status.Availability) + + // Clean up by clearing the status + _, _, err = client.Users.SetUserStatus(&gitlab.UserStatusOptions{ + Emoji: gitlab.Ptr(""), + Message: gitlab.Ptr(""), + }) + assert.NoError(t, err) +} + +// Test_UsersCreateServiceAccountUser_Integration tests the CreateServiceAccountUser function. +func Test_UsersCreateServiceAccountUser_Integration(t *testing.T) { + // GIVEN a GitLab instance + client := SetupIntegrationClient(t) + SkipIfRunningCE(t, client) + + // WHEN the CreateServiceAccountUser function is called + suffix := time.Now().UnixNano() + name := fmt.Sprintf("TestSA%d", suffix) + username := fmt.Sprintf("serviceaccount%d", suffix) + email := fmt.Sprintf("serviceaccount%d@test.com", suffix) + + serviceAccount, _, err := client.Users.CreateServiceAccountUser(&gitlab.CreateServiceAccountUserOptions{ + Name: &name, + Username: &username, + Email: &email, + }) + assert.NoError(t, err) + + // Clean up + t.Cleanup(func() { + _, err := client.Users.DeleteUser(serviceAccount.ID) + if err != nil { + t.Logf("Failed to delete service account user %d: %v", serviceAccount.ID, err) + } + }) + + // THEN a service account user should be created successfully + // Verify the service account was created + assert.NotZero(t, serviceAccount.ID) + assert.Equal(t, username, serviceAccount.Username) + assert.Equal(t, name, serviceAccount.Name) + assert.Equal(t, email, serviceAccount.Email) +} + +// Test_UsersListServiceAccounts_Integration tests the ListServiceAccounts function. +func Test_UsersListServiceAccounts_Integration(t *testing.T) { + // GIVEN a GitLab instance with service accounts + client := SetupIntegrationClient(t) + SkipIfRunningCE(t, client) + + // Create a service account first + suffix := time.Now().UnixNano() + name := fmt.Sprintf("Test Service Account %d", suffix) + username := fmt.Sprintf("serviceaccount%d", suffix) + email := fmt.Sprintf("serviceaccount%d@test.com", suffix) + + serviceAccount, _, err := client.Users.CreateServiceAccountUser(&gitlab.CreateServiceAccountUserOptions{ + Name: &name, + Username: &username, + Email: &email, + }) + require.NoError(t, err, "Failed to create service account user") + + // Clean up + t.Cleanup(func() { + _, err := client.Users.DeleteUser(serviceAccount.ID) + if err != nil { + t.Logf("Failed to delete service account user %d: %v", serviceAccount.ID, err) + } + }) + + // WHEN the ListServiceAccounts function is called + serviceAccounts, _, err := client.Users.ListServiceAccounts(&gitlab.ListServiceAccountsOptions{}) + assert.NoError(t, err) + + // THEN it should return a list of service accounts + // Verify the response contains our service account + assert.NotNil(t, serviceAccounts) + found := false + for _, sa := range serviceAccounts { + if sa.ID == serviceAccount.ID { + found = true + assert.Equal(t, username, sa.Username) + assert.Equal(t, name, sa.Name) + break + } + } + assert.True(t, found, "Created service account should be in the list") +} + +// Test_UsersDeleteUserIdentity_Integration tests the DeleteUserIdentity function. +func Test_UsersDeleteUserIdentity_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user that has an identity + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // Note: This test may not work in all GitLab instances as it requires + // external identity providers to be configured. We'll test the API call + // but expect it might return an error for users without external identities. + + // WHEN the DeleteUserIdentity function is called + _, err = client.Users.DeleteUserIdentity(user.ID, "github") + + // THEN the user's identity should be deleted successfully + // We don't assert NoError here because the user likely doesn't have + // a GitHub identity. The important thing is that the API call is made + // without causing a panic or unexpected error format. + assert.Error(t, err) // Expected to fail for users without external identities +} + +// Test_UsersGetSSHKeyForUser_Integration tests the GetSSHKeyForUser function. +func Test_UsersGetSSHKeyForUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user that has SSH keys + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the GetSSHKeyForUser function is called + // Test GetSSHKeyForUser function with a non-existent key ID + // This should return an error since the user has no SSH keys + _, _, err = client.Users.GetSSHKeyForUser(user.ID, 1) + + // THEN it should return the SSH key details or an appropriate error + assert.Error(t, err) // Expected to fail for non-existent SSH key +} + +// Test_UsersDisableTwoFactor_Integration tests the DisableTwoFactor function. +func Test_UsersDisableTwoFactor_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the DisableTwoFactor function is called + // This will likely return an error since the user doesn't have 2FA enabled + err = client.Users.DisableTwoFactor(user.ID) + + // THEN it should handle the request appropriately + // We expect this to fail since the user doesn't have 2FA enabled + // The important thing is that the API call doesn't panic + assert.Error(t, err) +} + +// Test_UsersCreateUserRunner_Integration tests the CreateUserRunner function. +func Test_UsersCreateUserRunner_Integration(t *testing.T) { + // GIVEN a GitLab instance + client := SetupIntegrationClient(t) + + // WHEN the CreateUserRunner function is called + runnerType := "instance_type" + description := "Test integration runner" + + runner, _, err := client.Users.CreateUserRunner(&gitlab.CreateUserRunnerOptions{ + RunnerType: &runnerType, + Description: &description, + }) + assert.NoError(t, err) + + // THEN it should create a user runner successfully + // Verify the runner was created + assert.NotZero(t, runner.ID) + assert.NotEmpty(t, runner.Token) +} + +// Test_UsersCreatePersonalAccessTokenForCurrentUser_Integration tests the CreatePersonalAccessTokenForCurrentUser function. +func Test_UsersCreatePersonalAccessTokenForCurrentUser_Integration(t *testing.T) { + // GIVEN a GitLab instance + client := SetupIntegrationClient(t) + + // WHEN the CreatePersonalAccessTokenForCurrentUser function is called + tokenName := "integration-test-token" + scopes := []string{"k8s_proxy"} + + token, _, err := client.Users.CreatePersonalAccessTokenForCurrentUser(&gitlab.CreatePersonalAccessTokenForCurrentUserOptions{ + Name: &tokenName, + Scopes: &scopes, + }) + assert.NoError(t, err) + + // THEN it should create a personal access token for the current user + assert.NotZero(t, token.ID) + assert.Equal(t, tokenName, token.Name) + assert.Equal(t, scopes, token.Scopes) + assert.NotEmpty(t, token.Token) +} + +// Test_UsersUploadAvatar_Integration tests the UploadAvatar function. +func Test_UsersUploadAvatar_Integration(t *testing.T) { + // GIVEN a GitLab instance + client := SetupIntegrationClient(t) + + // Create a simple test image (1x1 PNG) + pngData := []byte{ + 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53, 0xDE, 0x00, 0x00, 0x00, + 0x0C, 0x49, 0x44, 0x41, 0x54, 0x08, 0xD7, 0x63, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, + 0xAE, 0x42, 0x60, 0x82, + } + + // WHEN the UploadAvatar function is called with avatar data + avatar := bytes.NewReader(pngData) + user, _, err := client.Users.UploadAvatar(avatar, "test-avatar.png") + assert.NoError(t, err) + + // THEN it should upload the avatar for the current user + // Verify the avatar was uploaded + assert.NotNil(t, user) + assert.NotEmpty(t, user.AvatarURL) +} + +// Test_UsersApproveUser_Integration tests the ApproveUser function. +func Test_UsersApproveUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the ApproveUser function is called + // This will likely return an error since the user is already active/approved + err = client.Users.ApproveUser(user.ID) + + // THEN it should handle the request appropriately + // We expect this to fail since the user is already active + // The important thing is that the API call doesn't panic + assert.Error(t, err) +} + +// Test_UsersRejectUser_Integration tests the RejectUser function. +func Test_UsersRejectUser_Integration(t *testing.T) { + // GIVEN a GitLab instance with a test user + client := SetupIntegrationClient(t) + + // Create a test user + user, err := CreateTestUser(t, client) + require.NoError(t, err, "Failed to create test user") + + // WHEN the RejectUser function is called + // This will likely return an error since the user is already active + err = client.Users.RejectUser(user.ID) + + // THEN it should handle the request appropriately + // We expect this to fail since the user is already active + // The important thing is that the API call doesn't panic + assert.Error(t, err) +} diff --git a/gitlab_test/utils_test.go b/gitlab_test/utils_test.go new file mode 100644 index 00000000..2b00d2f3 --- /dev/null +++ b/gitlab_test/utils_test.go @@ -0,0 +1,114 @@ +//go:build integration + +package gitlab_test + +import ( + "fmt" + "os" + "testing" + "time" + + "github.com/stretchr/testify/require" + gitlab "gitlab.com/gitlab-org/api/client-go" +) + +// This file contains helper functions that are useful for +// writing tests. This includes a helper to create a client +// related to acceptance tests. +func SetupIntegrationClient(t *testing.T) *gitlab.Client { + t.Helper() + + // Get the token from environment + token := os.Getenv("GITLAB_TOKEN") + if token == "" { + t.Skip("GITLAB_TOKEN environment variable not set") + } + + // Get the baseUrl from environment. If it's not set, default + // to the local setup. + baseURL := os.Getenv("GITLAB_BASE_URL") + if baseURL == "" { + baseURL = "https://localhost:8095/api/v4" + } + + // Return a client with the base URL and the token. + client, err := gitlab.NewClient(token, gitlab.WithBaseURL(baseURL)) + require.NoError(t, err, "failed to create GitLab Client for BaseURL "+baseURL) + + return client +} + +// Skips the given test after the client is configured when running in CE +// This is required to ensure that integration testing functions that require +// an EE instance don't fail +func SkipIfRunningCE(t *testing.T, client *gitlab.Client) { + t.Helper() + + // Check if we're running in CE context + isEE, err := IsRunningInEEContext(t, client) + require.NoError(t, err, "Failed to determine GitLab edition") + + // Skip the test if running on CE + if !isEE { + t.Skip("Skipping test - requires GitLab Enterprise Edition") + } +} + +// Global variable to cache the result of EE evaluation for all the tests +var isEE *bool + +// function calls gitlab server metadata API once and caches the result +// to determine if license model is enterprise or not +func IsRunningInEEContext(t *testing.T, client *gitlab.Client) (bool, error) { + t.Helper() + + if isEE != nil { + return *isEE, nil + } + metadata, _, err := client.Metadata.GetMetadata() + if err != nil { + return false, err + } + + // Cache the results for later. + // Note - if run on versions earlier to 15.5, it will error since + // this key wasn't returned. With we're 3 major versions later, this + // seems like a safe assumption. + isEE = &metadata.Enterprise + return *isEE, err +} + +// CreateTestUser creates a test user with a random username and email. +// The user is automatically cleaned up when the test finishes. +func CreateTestUser(t *testing.T, client *gitlab.Client) (*gitlab.User, error) { + t.Helper() + + // Generate random username and email + suffix := time.Now().UnixNano() + + username := fmt.Sprintf("testuser%d", suffix) + email := fmt.Sprintf("testuser%d@example.com", suffix) + name := fmt.Sprintf("Test User %d", suffix) + + // Create the user + user, _, err := client.Users.CreateUser(&gitlab.CreateUserOptions{ + Username: &username, + Email: &email, + Name: &name, + // Required field - must be fairly random or GitLab won't allow it + // nosemgrep - testing password + Password: gitlab.Ptr("f0hYXux#yy2CFypKq!aV"), + SkipConfirmation: gitlab.Ptr(true), // Skip email confirmation + }) + if err != nil { + return nil, fmt.Errorf("failed to create user: %w", err) + } + + // Clean up the user when the test finishes + t.Cleanup(func() { + _, err := client.Users.DeleteUser(user.ID) + require.NoError(t, err, "Failed to delete test user") + }) + + return user, nil +} diff --git a/scripts/await_healthy.sh b/scripts/await_healthy.sh new file mode 100755 index 00000000..8b7d1cf4 --- /dev/null +++ b/scripts/await_healthy.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env sh + +CONTAINER_ENGINE="${CONTAINER_ENGINE:-docker}" + +set -e + +if [ "$CONTAINER_ENGINE" != "docker" ]; then + echo "Using container engine $CONTAINER_ENGINE" +fi + +printf 'Waiting for GitLab container to become healthy' + +until test -n "$($CONTAINER_ENGINE ps --quiet --filter label=client-go/owned --filter health=healthy)"; do + printf '.' + sleep 5 +done + +echo +echo "GitLab is healthy at $GITLAB_BASE_URL" + +# Print the version, since it is useful debugging information. +curl --silent --show-error --header "Authorization: Bearer $GITLAB_TOKEN" "$GITLAB_BASE_URL/version" +echo + +# We use git imports during integration tests, so the import sources need to have git enabled as of 16.0. Otherwise they're all disabled. +echo "Setting import sources to 'git' for testing purposes" +curl --silent --show-error --request PUT --header "Authorization: Bearer $GITLAB_TOKEN" "$GITLAB_BASE_URL/application/settings?import_sources=git,gitlab_project" \ No newline at end of file diff --git a/scripts/gitlab.rb b/scripts/gitlab.rb new file mode 100644 index 00000000..2e8d1834 --- /dev/null +++ b/scripts/gitlab.rb @@ -0,0 +1,45 @@ +pages_external_url 'http://127.0.0.1:5051' +pages_nginx['redirect_http_to_https'] = false +pages_nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab-registry.pem" +pages_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab-registry.key" + +registry_external_url 'http://127.0.0.1:5050' +registry['enable'] = true +registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab-registry.pem" +registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab-registry.key" + +gitlab_rails['initial_shared_runners_registration_token'] = "ACCTEST1234567890123_RUNNER_REG_TOKEN" + +# The new licenses issued are for the new Customer Portal. +# see https://docs.gitlab.com/omnibus/development/setup/#use-customers-portal-staging-in-gitlab +gitlab_rails['env'] = { + "GITLAB_LICENSE_MODE" => "test", + "CUSTOMER_PORTAL_URL" => "https://customers.staging.gitlab.com" +} + +# This setting is required to disable caching for application settings +# which is required to test different scenarios in the acceptance tests. +# see https://gitlab.com/gitlab-org/gitlab/-/issues/364812#note_986366898 +# see https://gitlab.com/gitlab-org/terraform-provider-gitlab/pull/1128 +gitlab_rails['application_settings_cache_seconds'] = 0 +gitlab_rails['env'].merge!({ + 'IN_MEMORY_APPLICATION_SETTINGS' => 'false' +}) + +# Enable SAML authentication for GitLab (required for SAML group links). +# see https://docs.gitlab.com/integration/saml/ +gitlab_rails['omniauth_allow_single_sign_on'] = ['saml'] +gitlab_rails['omniauth_block_auto_created_users'] = false +gitlab_rails['omniauth_providers'] = [ + { + name: "saml", + label: "Dummy Test Provider", + args: { + assertion_consumer_service_url: "https://gitlab.example.com/users/auth/saml/callback", + idp_cert_fingerprint: "aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa", + idp_sso_target_url: "https://saml.provider.example.com/sso/saml", + issuer: "https://gitlab.example.com", + name_identifier_format: "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" + } + } +] diff --git a/scripts/healthcheck_and_setup.sh b/scripts/healthcheck_and_setup.sh new file mode 100755 index 00000000..61ad2932 --- /dev/null +++ b/scripts/healthcheck_and_setup.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env sh + +# This script is intended to be used as a Docker HEALTHCHECK for the GitLab container. +# It prepares GitLab prior to running acceptance tests. +# +# This is a known workaround for docker-compose lacking lifecycle hooks. +# See: https://github.com/docker/compose/issues/1809#issuecomment-657815188 + +set -e + +# Check for a successful HTTP status code from GitLab. +curl --silent --show-error --fail --output /dev/null 127.0.0.1:80 + +# Because this script runs on a regular health check interval, +# this file functions as a marker that tells us if initialization already finished. +done=/var/gitlab-acctest-initialized + +test -f $done || { + echo 'Initializing GitLab for acceptance tests' + + echo 'Creating access token' + ( + cat < Date: Thu, 9 Oct 2025 10:42:18 +0300 Subject: [PATCH 16/26] fix!(projects): remove ListProjectInvidedGroupOptions in favor to ListProjectInvitedGroupOptions Changelog: Improvements --- projects.go | 9 ++------- testing/projects_mock.go | 6 +++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/projects.go b/projects.go index 662ba7e0..c8c6ee44 100644 --- a/projects.go +++ b/projects.go @@ -46,7 +46,7 @@ type ( 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) @@ -1168,16 +1168,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 diff --git a/testing/projects_mock.go b/testing/projects_mock.go index 7344fc5b..7fb800e9 100644 --- a/testing/projects_mock.go +++ b/testing/projects_mock.go @@ -1610,7 +1610,7 @@ func (c *MockProjectsServiceInterfaceListProjectsGroupsCall) DoAndReturn(f func( } // ListProjectsInvitedGroups mocks base method. -func (m *MockProjectsServiceInterface) ListProjectsInvitedGroups(pid any, opt *gitlab.ListProjectInvidedGroupOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectGroup, *gitlab.Response, error) { +func (m *MockProjectsServiceInterface) ListProjectsInvitedGroups(pid any, opt *gitlab.ListProjectInvitedGroupOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectGroup, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, opt} for _, a := range options { @@ -1643,13 +1643,13 @@ func (c *MockProjectsServiceInterfaceListProjectsInvitedGroupsCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceListProjectsInvitedGroupsCall) Do(f func(any, *gitlab.ListProjectInvidedGroupOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectGroup, *gitlab.Response, error)) *MockProjectsServiceInterfaceListProjectsInvitedGroupsCall { +func (c *MockProjectsServiceInterfaceListProjectsInvitedGroupsCall) Do(f func(any, *gitlab.ListProjectInvitedGroupOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectGroup, *gitlab.Response, error)) *MockProjectsServiceInterfaceListProjectsInvitedGroupsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceListProjectsInvitedGroupsCall) DoAndReturn(f func(any, *gitlab.ListProjectInvidedGroupOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectGroup, *gitlab.Response, error)) *MockProjectsServiceInterfaceListProjectsInvitedGroupsCall { +func (c *MockProjectsServiceInterfaceListProjectsInvitedGroupsCall) DoAndReturn(f func(any, *gitlab.ListProjectInvitedGroupOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectGroup, *gitlab.Response, error)) *MockProjectsServiceInterfaceListProjectsInvitedGroupsCall { c.Call = c.Call.DoAndReturn(f) return c } -- GitLab From b2d571c1001b9cb74960868bc7eef0b1f67fda97 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 9 Oct 2025 10:42:28 +0300 Subject: [PATCH 17/26] refactor!: Canonicalize request headers Changelog: Improvements --- .golangci.yml | 1 + gitlab.go | 12 +++++------ gitlab_test.go | 4 ++-- pagination_test.go | 2 +- projects_test.go | 2 +- request_options.go | 8 ++++---- request_options_test.go | 44 ++++++++++++++++++++--------------------- 7 files changed, 37 insertions(+), 36 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 850d7dff..2ba525c4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,6 +18,7 @@ output: linters: enable: - asciicheck + - canonicalheader - dogsled - dupword - errorlint diff --git a/gitlab.go b/gitlab.go index 0f86dd3e..b11d57ff 100644 --- a/gitlab.go +++ b/gitlab.go @@ -49,11 +49,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. @@ -623,7 +623,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 @@ -645,7 +645,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))) diff --git a/gitlab_test.go b/gitlab_test.go index 303c7f2e..6d574d41 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -673,7 +673,7 @@ func TestNewClient_auth(t *testing.T) { const token = "glpat-0123456789abcdefg" handler := func(w http.ResponseWriter, r *http.Request) { - if got, want := r.Header.Get("PRIVATE-TOKEN"), token; got != want { + if got, want := r.Header.Get("Private-Token"), token; got != want { w.WriteHeader(http.StatusUnauthorized) fmt.Fprintf(w, "Authorization = %q, want %q", got, want) return @@ -708,7 +708,7 @@ func TestNewJobClient_auth(t *testing.T) { const token = "glcbt-0123456789abcdefg" handler := func(w http.ResponseWriter, r *http.Request) { - if got, want := r.Header.Get("JOB-TOKEN"), token; got != want { + if got, want := r.Header.Get("Job-Token"), token; got != want { w.WriteHeader(http.StatusUnauthorized) fmt.Fprintf(w, "Authorization = %q, want %q", got, want) return diff --git a/pagination_test.go b/pagination_test.go index 7e40c7b0..22a56635 100644 --- a/pagination_test.go +++ b/pagination_test.go @@ -190,7 +190,7 @@ func handleTwoPagesSuccessfullyWithKeyset(t *testing.T, mux *http.ServeMux) { idBefore := r.URL.Query().Get("id_before") switch idBefore { case "": - w.Header().Add("link", `; rel="next"`) + w.Header().Add("Link", `; rel="next"`) fmt.Fprint(w, `[{"id":1}]`) case "2": fmt.Fprint(w, `[{"id":2}]`) diff --git a/projects_test.go b/projects_test.go index 63e586c9..8e07d269 100644 --- a/projects_test.go +++ b/projects_test.go @@ -593,7 +593,7 @@ func TestDownloadAvatar(t *testing.T) { mux.HandleFunc("/api/v4/projects/1/avatar", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) - w.Header().Add("Content-length", strconv.Itoa(len(ico))) + w.Header().Add("Content-Length", strconv.Itoa(len(ico))) w.WriteHeader(http.StatusOK) _, _ = w.Write(ico) }, diff --git a/request_options.go b/request_options.go index 166c1d92..78ded578 100644 --- a/request_options.go +++ b/request_options.go @@ -100,14 +100,14 @@ func WithOffsetPaginationParameters(page int) RequestOptionFunc { } } -// 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/request_options_test.go b/request_options_test.go index a17b7b32..e4fc98ac 100644 --- a/request_options_test.go +++ b/request_options_test.go @@ -143,29 +143,29 @@ func TestWithHeader(t *testing.T) { t.Parallel() mux, client := setup(t) mux.HandleFunc("/api/v4/without-header", func(w http.ResponseWriter, r *http.Request) { - assert.Empty(t, r.Header.Get("X-CUSTOM-HEADER")) + assert.Empty(t, r.Header.Get("X-Custom-Header")) w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, `{"X-CUSTOM-HEADER": %s`, r.Header.Get("X-CUSTOM-HEADER")) + fmt.Fprintf(w, `{"X-Custom-Header": %s`, r.Header.Get("X-Custom-Header")) }) mux.HandleFunc("/api/v4/with-header", func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, "randomtokenstring", r.Header.Get("X-CUSTOM-HEADER")) + assert.Equal(t, "randomtokenstring", r.Header.Get("X-Custom-Header")) w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, `{"X-CUSTOM-HEADER": %s`, r.Header.Get("X-CUSTOM-HEADER")) + fmt.Fprintf(w, `{"X-Custom-Header": %s`, r.Header.Get("X-Custom-Header")) }) - // ensure that X-CUSTOM-HEADER hasn't been set at all + // ensure that X-Custom-Header hasn't been set at all req, err := client.NewRequest(http.MethodGet, "/without-header", nil, nil) assert.NoError(t, err) _, err = client.Do(req, nil) assert.NoError(t, err) - // ensure that X-CUSTOM-HEADER is set for only one request + // ensure that X-Custom-Header is set for only one request req, err = client.NewRequest( http.MethodGet, "/with-header", nil, - []RequestOptionFunc{WithHeader("X-CUSTOM-HEADER", "randomtokenstring")}, + []RequestOptionFunc{WithHeader("X-Custom-Header", "randomtokenstring")}, ) assert.NoError(t, err) @@ -178,7 +178,7 @@ func TestWithHeader(t *testing.T) { _, err = client.Do(req, nil) assert.NoError(t, err) - // ensure that X-CUSTOM-HEADER is set for all client requests + // ensure that X-Custom-Header is set for all client requests addr := client.BaseURL().String() client, err = NewClient("", // same base options as setup @@ -188,20 +188,20 @@ func TestWithHeader(t *testing.T) { return 0 }), // add client headers - WithRequestOptions(WithHeader("X-CUSTOM-HEADER", "randomtokenstring"))) + WithRequestOptions(WithHeader("X-Custom-Header", "randomtokenstring"))) assert.NoError(t, err) assert.NotNil(t, client) req, err = client.NewRequest(http.MethodGet, "/with-header", nil, nil) assert.NoError(t, err) - assert.Equal(t, "randomtokenstring", req.Header.Get("X-CUSTOM-HEADER")) + assert.Equal(t, "randomtokenstring", req.Header.Get("X-Custom-Header")) _, err = client.Do(req, nil) assert.NoError(t, err) req, err = client.NewRequest(http.MethodGet, "/with-header", nil, nil) assert.NoError(t, err) - assert.Equal(t, "randomtokenstring", req.Header.Get("X-CUSTOM-HEADER")) + assert.Equal(t, "randomtokenstring", req.Header.Get("X-Custom-Header")) _, err = client.Do(req, nil) assert.NoError(t, err) @@ -211,29 +211,29 @@ func TestWithHeaders(t *testing.T) { t.Parallel() mux, client := setup(t) mux.HandleFunc("/api/v4/without-headers", func(w http.ResponseWriter, r *http.Request) { - assert.Empty(t, r.Header.Get("X-CUSTOM-HEADER-1")) - assert.Empty(t, r.Header.Get("X-CUSTOM-HEADER-2")) + assert.Empty(t, r.Header.Get("X-Custom-Header-1")) + assert.Empty(t, r.Header.Get("X-Custom-Header-2")) w.WriteHeader(http.StatusOK) }) mux.HandleFunc("/api/v4/with-headers", func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, "randomtokenstring", r.Header.Get("X-CUSTOM-HEADER-1")) - assert.Equal(t, "randomtokenstring2", r.Header.Get("X-CUSTOM-HEADER-2")) + assert.Equal(t, "randomtokenstring", r.Header.Get("X-Custom-Header-1")) + assert.Equal(t, "randomtokenstring2", r.Header.Get("X-Custom-Header-2")) w.WriteHeader(http.StatusOK) }) headers := map[string]string{ - "X-CUSTOM-HEADER-1": "randomtokenstring", - "X-CUSTOM-HEADER-2": "randomtokenstring2", + "X-Custom-Header-1": "randomtokenstring", + "X-Custom-Header-2": "randomtokenstring2", } - // ensure that X-CUSTOM-HEADER hasn't been set at all + // ensure that X-Custom-Header hasn't been set at all req, err := client.NewRequest(http.MethodGet, "/without-headers", nil, nil) assert.NoError(t, err) _, err = client.Do(req, nil) assert.NoError(t, err) - // ensure that X-CUSTOM-HEADER is set for only one request + // ensure that X-Custom-Header is set for only one request req, err = client.NewRequest( http.MethodGet, "/with-headers", @@ -251,7 +251,7 @@ func TestWithHeaders(t *testing.T) { _, err = client.Do(req, nil) assert.NoError(t, err) - // ensure that X-CUSTOM-HEADER is set for all client requests + // ensure that X-Custom-Header is set for all client requests addr := client.BaseURL().String() client, err = NewClient("", // same base options as setup @@ -268,14 +268,14 @@ func TestWithHeaders(t *testing.T) { req, err = client.NewRequest(http.MethodGet, "/with-headers", nil, nil) assert.NoError(t, err) - assert.Equal(t, "randomtokenstring", req.Header.Get("X-CUSTOM-HEADER-1")) + assert.Equal(t, "randomtokenstring", req.Header.Get("X-Custom-Header-1")) _, err = client.Do(req, nil) assert.NoError(t, err) req, err = client.NewRequest(http.MethodGet, "/with-headers", nil, nil) assert.NoError(t, err) - assert.Equal(t, "randomtokenstring", req.Header.Get("X-CUSTOM-HEADER-1")) + assert.Equal(t, "randomtokenstring", req.Header.Get("X-Custom-Header-1")) _, err = client.Do(req, nil) assert.NoError(t, err) -- GitLab From 027c4fae6e4b8fad1bdf755fde01b3d00cb173de Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 9 Oct 2025 11:40:57 +0300 Subject: [PATCH 18/26] fix!(epics): remove UpdateEpicIsssueAssignmentOptions in favor to UpdateEpicIssueAssignmentOptions Changelog: Improvements --- epic_issues.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/epic_issues.go b/epic_issues.go index 41c36d4f..7deb2158 100644 --- a/epic_issues.go +++ b/epic_issues.go @@ -149,10 +149,6 @@ type UpdateEpicIssueAssignmentOptions struct { 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 From 7360ac599b8c6713e6ad7316ff781c658d841c14 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Fri, 10 Oct 2025 11:22:25 -0500 Subject: [PATCH 19/26] chore: Batch 3 of int -> int64 conversations Changelog: Improvements --- feature_flag_user_lists.go | 18 +- freeze_periods.go | 14 +- generic_packages.go | 12 +- geo_nodes.go | 306 +++++++------- geo_nodes_test.go | 10 +- geo_sites.go | 392 +++++++++--------- geo_sites_test.go | 10 +- group_access_tokens.go | 12 +- group_activity_analytics.go | 6 +- group_badges.go | 14 +- group_boards.go | 44 +- group_clusters.go | 14 +- group_epic_boards.go | 6 +- group_hooks.go | 22 +- group_hooks_test.go | 2 +- group_import_export.go | 4 +- group_import_export_test.go | 2 +- group_iterations.go | 10 +- group_labels.go | 4 +- group_labels_test.go | 2 +- group_markdown_uploads.go | 8 +- group_members.go | 44 +- group_milestones.go | 34 +- group_milestones_test.go | 2 +- group_protected_environments.go | 56 +-- group_protected_environments_test.go | 22 +- group_repository_storage_move.go | 20 +- group_security_settings.go | 4 +- group_security_settings_test.go | 2 +- group_serviceaccounts.go | 16 +- group_ssh_certificates.go | 6 +- groups.go | 102 ++--- groups_test.go | 14 +- instance_clusters.go | 14 +- integrations.go | 2 +- invites.go | 2 +- issue_links.go | 28 +- issues.go | 160 +++---- issues_statistics.go | 24 +- issues_statistics_test.go | 12 +- issues_test.go | 28 +- markdown_uploads.go | 4 +- merge_requests.go | 20 +- project_markdown_uploads.go | 8 +- testing/feature_flag_user_lists_mock.go | 18 +- testing/freeze_periods_mock.go | 18 +- testing/geo_nodes_mock.go | 30 +- testing/geo_sites_mock.go | 30 +- testing/group_access_tokens_mock.go | 18 +- testing/group_badges_mock.go | 18 +- testing/group_boards_mock.go | 48 +-- testing/group_clusters_mock.go | 18 +- testing/group_epic_boards_mock.go | 6 +- testing/group_markdown_uploads_mock.go | 12 +- testing/group_members_mock.go | 30 +- testing/group_milestones_mock.go | 36 +- testing/group_repository_storage_move_mock.go | 24 +- testing/group_ssh_certificates_mock.go | 6 +- testing/groups_mock.go | 108 ++--- testing/instance_clusters_mock.go | 18 +- testing/issue_links_mock.go | 24 +- testing/issues_mock.go | 102 ++--- testing/merge_requests_mock.go | 30 +- testing/project_markdown_uploads_mock.go | 12 +- time_stats.go | 10 +- 65 files changed, 1076 insertions(+), 1076 deletions(-) diff --git a/feature_flag_user_lists.go b/feature_flag_user_lists.go index 6208158c..586dff71 100644 --- a/feature_flag_user_lists.go +++ b/feature_flag_user_lists.go @@ -24,9 +24,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 @@ -46,9 +46,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"` } @@ -128,7 +128,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -163,7 +163,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -188,7 +188,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) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/freeze_periods.go b/freeze_periods.go index ef599e87..ef12aca2 100644 --- a/freeze_periods.go +++ b/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"` @@ -98,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 @@ -170,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 @@ -197,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/generic_packages.go b/generic_packages.go index d51ccf77..aa64403f 100644 --- a/generic_packages.go +++ b/generic_packages.go @@ -49,12 +49,12 @@ 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"` + ID int64 `json:"id"` + PackageID int64 `json:"package_id"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` - Size int `json:"size"` - FileStore int `json:"file_store"` + Size int64 `json:"size"` + FileStore int64 `json:"file_store"` FileMD5 string `json:"file_md5"` FileSHA1 string `json:"file_sha1"` FileName string `json:"file_name"` @@ -63,9 +63,9 @@ type GenericPackagesFile struct { VerificationRetryAt *time.Time `json:"verification_retry_at"` VerifiedAt *time.Time `json:"verified_at"` VerificationFailure bool `json:"verification_failure"` - VerificationRetryCount int `json:"verification_retry_count"` + VerificationRetryCount int64 `json:"verification_retry_count"` VerificationChecksum string `json:"verification_checksum"` - VerificationState int `json:"verification_state"` + VerificationState int64 `json:"verification_state"` VerificationStartedAt *time.Time `json:"verification_started_at"` NewFilePath string `json:"new_file_path"` } diff --git a/geo_nodes.go b/geo_nodes.go index a51d9681..720731a9 100644 --- a/geo_nodes.go +++ b/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. @@ -168,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) @@ -191,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. @@ -212,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) @@ -234,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) @@ -250,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) @@ -273,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"` } @@ -457,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/geo_nodes_test.go b/geo_nodes_test.go index d1dac714..a699662b 100644 --- a/geo_nodes_test.go +++ b/geo_nodes_test.go @@ -57,7 +57,7 @@ func TestGeoNodesService_CreateGeoNode(t *testing.T) { VerificationMaxCapacity: 100, SelectiveSyncType: "namespaces", SelectiveSyncShards: nil, - SelectiveSyncNamespaceIDs: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int64{1, 25}, MinimumReverificationInterval: 7, ContainerRepositoriesMaxCapacity: 10, SyncObjectStorage: false, @@ -149,7 +149,7 @@ func TestGeoNodesService_ListGeoNodes(t *testing.T) { VerificationMaxCapacity: 100, SelectiveSyncType: "namespaces", SelectiveSyncShards: nil, - SelectiveSyncNamespaceIDs: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int64{1, 25}, MinimumReverificationInterval: 7, ContainerRepositoriesMaxCapacity: 10, SyncObjectStorage: false, @@ -239,7 +239,7 @@ func TestGeoNodesService_GetGeoNode(t *testing.T) { VerificationMaxCapacity: 100, SelectiveSyncType: "namespaces", SelectiveSyncShards: nil, - SelectiveSyncNamespaceIDs: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int64{1, 25}, MinimumReverificationInterval: 7, ContainerRepositoriesMaxCapacity: 10, SyncObjectStorage: false, @@ -318,7 +318,7 @@ func TestGeoNodesService_EditGeoNode(t *testing.T) { VerificationMaxCapacity: 100, SelectiveSyncType: "namespaces", SelectiveSyncShards: nil, - SelectiveSyncNamespaceIDs: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int64{1, 25}, MinimumReverificationInterval: 7, ContainerRepositoriesMaxCapacity: 10, SyncObjectStorage: false, @@ -418,7 +418,7 @@ func TestGeoNodesService_RepairGeoNode(t *testing.T) { VerificationMaxCapacity: 100, SelectiveSyncType: "namespaces", SelectiveSyncShards: nil, - SelectiveSyncNamespaceIDs: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int64{1, 25}, MinimumReverificationInterval: 7, ContainerRepositoriesMaxCapacity: 10, SyncObjectStorage: false, diff --git a/geo_sites.go b/geo_sites.go index 9b5cac3f..fe15c520 100644 --- a/geo_sites.go +++ b/geo_sites.go @@ -24,12 +24,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 @@ -47,21 +47,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"` @@ -87,15 +87,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. @@ -148,7 +148,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) { u := fmt.Sprintf("geo_sites/%d", id) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -174,21 +174,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) { u := fmt.Sprintf("geo_sites/%d", id) req, err := s.client.NewRequest(http.MethodPut, u, opt, options) @@ -209,7 +209,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) { u := fmt.Sprintf("geo_sites/%d", id) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -224,7 +224,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) { u := fmt.Sprintf("geo_sites/%d/repair", id) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) @@ -246,163 +246,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"` @@ -435,21 +435,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"` @@ -499,7 +499,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) { u := fmt.Sprintf("geo_sites/%d/status", id) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) diff --git a/geo_sites_test.go b/geo_sites_test.go index 10ac90e4..4bf5b522 100644 --- a/geo_sites_test.go +++ b/geo_sites_test.go @@ -55,7 +55,7 @@ func TestGeoSites_CreateGeoSite(t *testing.T) { ContainerRepositoriesMaxCapacity: 10, SelectiveSyncType: "namespaces", SelectiveSyncShards: []string{}, - SelectiveSyncNamespaceIDs: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int64{1, 25}, MinimumReverificationInterval: 7, SyncObjectStorage: false, WebEditURL: "https://primary.example.com/admin/geo/sites/3/edit", @@ -120,7 +120,7 @@ func TestGeoSites_ListGeoSite(t *testing.T) { ContainerRepositoriesMaxCapacity: 10, SelectiveSyncType: "namespaces", SelectiveSyncShards: []string{}, - SelectiveSyncNamespaceIDs: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int64{1, 25}, MinimumReverificationInterval: 7, SyncObjectStorage: false, WebEditURL: "https://primary.example.com/admin/geo/sites/3/edit", @@ -185,7 +185,7 @@ func TestGeoSites_GetGeoSite(t *testing.T) { ContainerRepositoriesMaxCapacity: 10, SelectiveSyncType: "namespaces", SelectiveSyncShards: []string{}, - SelectiveSyncNamespaceIDs: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int64{1, 25}, MinimumReverificationInterval: 7, SyncObjectStorage: false, WebEditURL: "https://primary.example.com/admin/geo/sites/3/edit", @@ -250,7 +250,7 @@ func TestGeoSites_EditGeoSite(t *testing.T) { ContainerRepositoriesMaxCapacity: 10, SelectiveSyncType: "namespaces", SelectiveSyncShards: []string{}, - SelectiveSyncNamespaceIDs: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int64{1, 25}, MinimumReverificationInterval: 7, SyncObjectStorage: false, WebEditURL: "https://primary.example.com/admin/geo/sites/3/edit", @@ -328,7 +328,7 @@ func TestGeoSites_RepairGeoSite(t *testing.T) { ContainerRepositoriesMaxCapacity: 10, SelectiveSyncType: "namespaces", SelectiveSyncShards: []string{}, - SelectiveSyncNamespaceIDs: []int{1, 25}, + SelectiveSyncNamespaceIDs: []int64{1, 25}, MinimumReverificationInterval: 7, SyncObjectStorage: false, WebEditURL: "https://primary.example.com/admin/geo/sites/3/edit", diff --git a/group_access_tokens.go b/group_access_tokens.go index 08946643..b9aee419 100644 --- a/group_access_tokens.go +++ b/group_access_tokens.go @@ -25,11 +25,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 @@ -99,7 +99,7 @@ func (s *GroupAccessTokensService) ListGroupAccessTokens(gid any, opt *ListGroup // // 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) { +func (s *GroupAccessTokensService) GetGroupAccessToken(gid any, id int64, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) { groups, err := parseID(gid) if err != nil { return nil, nil, err @@ -172,7 +172,7 @@ 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) { +func (s *GroupAccessTokensService) RotateGroupAccessToken(gid any, id int64, opt *RotateGroupAccessTokenOptions, options ...RequestOptionFunc) (*GroupAccessToken, *Response, error) { groups, err := parseID(gid) if err != nil { return nil, nil, err @@ -221,7 +221,7 @@ func (s *GroupAccessTokensService) RotateGroupAccessTokenSelf(gid any, opt *Rota // // 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) { +func (s *GroupAccessTokensService) RevokeGroupAccessToken(gid any, id int64, options ...RequestOptionFunc) (*Response, error) { groups, err := parseID(gid) if err != nil { return nil, err diff --git a/group_activity_analytics.go b/group_activity_analytics.go index 9824f4d6..6149369f 100644 --- a/group_activity_analytics.go +++ b/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 @@ -77,7 +77,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 @@ -115,7 +115,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 diff --git a/group_badges.go b/group_badges.go index b56c5826..39d639ce 100644 --- a/group_badges.go +++ b/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/group_boards.go b/group_boards.go index 855697b1..b1a1a28e 100644 --- a/group_boards.go +++ b/group_boards.go @@ -25,14 +25,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 +52,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"` @@ -136,7 +136,7 @@ func (s *GroupIssueBoardsService) CreateGroupIssueBoard(gid any, opt *CreateGrou // // 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) { +func (s *GroupIssueBoardsService) GetGroupIssueBoard(gid any, board int64, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -163,17 +163,17 @@ 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) { +func (s *GroupIssueBoardsService) UpdateIssueBoard(gid any, board int64, opt *UpdateGroupIssueBoardOptions, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -198,7 +198,7 @@ func (s *GroupIssueBoardsService) UpdateIssueBoard(gid any, board int, opt *Upda // // 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) { +func (s *GroupIssueBoardsService) DeleteIssueBoard(gid any, board int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -226,7 +226,7 @@ type ListGroupIssueBoardListsOptions struct { // 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) { +func (s *GroupIssueBoardsService) ListGroupIssueBoardLists(gid any, board int64, opt *ListGroupIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -251,7 +251,7 @@ func (s *GroupIssueBoardsService) ListGroupIssueBoardLists(gid any, board int, o // // 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) { +func (s *GroupIssueBoardsService) GetGroupIssueBoardList(gid any, board, list int64, options ...RequestOptionFunc) (*BoardList, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -282,14 +282,14 @@ 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) { +func (s *GroupIssueBoardsService) CreateGroupIssueBoardList(gid any, board int64, opt *CreateGroupIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -316,7 +316,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 @@ -324,7 +324,7 @@ 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) { +func (s *GroupIssueBoardsService) UpdateIssueBoardList(gid any, board, list int64, opt *UpdateGroupIssueBoardListOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -354,7 +354,7 @@ func (s *GroupIssueBoardsService) UpdateIssueBoardList(gid any, board, list int, // // 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) { +func (s *GroupIssueBoardsService) DeleteGroupIssueBoardList(gid any, board, list int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/group_clusters.go b/group_clusters.go index 145f56ea..5ec29914 100644 --- a/group_clusters.go +++ b/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/group_epic_boards.go b/group_epic_boards.go index 679dae6a..d79cfe2e 100644 --- a/group_epic_boards.go +++ b/group_epic_boards.go @@ -24,7 +24,7 @@ import ( 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 +44,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"` @@ -93,7 +93,7 @@ func (s *GroupEpicBoardsService) ListGroupEpicBoards(gid any, opt *ListGroupEpic // // 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) { +func (s *GroupEpicBoardsService) GetGroupEpicBoard(gid any, board int64, options ...RequestOptionFunc) (*GroupEpicBoard, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err diff --git a/group_hooks.go b/group_hooks.go index b95b4990..8662b8ac 100644 --- a/group_hooks.go +++ b/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"` @@ -95,7 +95,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 @@ -120,7 +120,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 @@ -231,7 +231,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 @@ -257,7 +257,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 @@ -276,7 +276,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 @@ -295,7 +295,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 @@ -314,7 +314,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 @@ -342,7 +342,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 @@ -361,7 +361,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/group_hooks_test.go b/group_hooks_test.go index 83e1dc8e..8ae6b336 100644 --- a/group_hooks_test.go +++ b/group_hooks_test.go @@ -413,7 +413,7 @@ func TestTriggerTestGroupHook(t *testing.T) { tests := []struct { name string groupID any - hookID int + hookID int64 trigger GroupHookTrigger wantErr bool wantStatus int diff --git a/group_import_export.go b/group_import_export.go index 40648004..8d538acf 100644 --- a/group_import_export.go +++ b/group_import_export.go @@ -97,7 +97,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 +163,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/group_import_export_test.go b/group_import_export_test.go index 09671738..665598ea 100644 --- a/group_import_export_test.go +++ b/group_import_export_test.go @@ -67,7 +67,7 @@ func TestGroupImport(t *testing.T) { Name: Ptr("test"), Path: Ptr("path"), File: Ptr(tmpfile), - ParentID: Ptr(1), + ParentID: Ptr(int64(1)), } resp, err := client.GroupImportExport.ImportFile(opt) diff --git a/group_iterations.go b/group_iterations.go index 0a5e235e..7f7b84a2 100644 --- a/group_iterations.go +++ b/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/group_labels.go b/group_labels.go index 0291d0ae..44118489 100644 --- a/group_labels.go +++ b/group_labels.go @@ -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/group_labels_test.go b/group_labels_test.go index 169efd55..7a3436c4 100644 --- a/group_labels_test.go +++ b/group_labels_test.go @@ -155,7 +155,7 @@ func TestListGroupLabels(t *testing.T) { } label, _, err := client.GroupLabels.ListGroupLabels("1", o) if err != nil { - t.Log(err.Error() == "invalid ID type 1.1, the ID must be an int or a string") + t.Log(err.Error() == "invalid ID type 1.1, the ID must be an int64 or a string") } want := []*GroupLabel{{ID: 5, Name: "kind/bug", Color: "#d9534f", Description: "Bug reported by user", OpenIssuesCount: 1, ClosedIssuesCount: 0, OpenMergeRequestsCount: 1, Subscribed: true}} if !reflect.DeepEqual(want, label) { diff --git a/group_markdown_uploads.go b/group_markdown_uploads.go index 5c0afc84..ac0d74b2 100644 --- a/group_markdown_uploads.go +++ b/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) } @@ -58,7 +58,7 @@ func (s *GroupMarkdownUploadsService) ListGroupMarkdownUploads(gid any, opt *Lis // // 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) { +func (s *GroupMarkdownUploadsService) DownloadGroupMarkdownUploadByID(gid any, uploadID int64, options ...RequestOptionFunc) (io.Reader, *Response, error) { buffer, resp, err := downloadMarkdownUploadByID(s.client, GroupResource, gid, uploadID, options) if err != nil { return nil, resp, err @@ -83,7 +83,7 @@ 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) { +func (s *GroupMarkdownUploadsService) DeleteGroupMarkdownUploadByID(gid any, uploadID int64, options ...RequestOptionFunc) (*Response, error) { return deleteMarkdownUploadByID(s.client, GroupResource, gid, uploadID, options) } diff --git a/group_members.go b/group_members.go index a7fcbe95..c5d13e78 100644 --- a/group_members.go +++ b/group_members.go @@ -24,13 +24,13 @@ import ( 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 +48,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"` @@ -71,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. @@ -79,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"` @@ -99,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"` @@ -115,8 +115,8 @@ 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"` + Query *string `url:"query,omitempty" json:"query,omitempty"` + UserIDs *[]int64 `url:"user_ids[],omitempty" json:"user_ids,omitempty"` } // ListGroupMembers get a list of group members viewable by the authenticated @@ -176,18 +176,18 @@ 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) { +func (s *GroupMembersService) GetGroupMember(gid any, user int64, options ...RequestOptionFunc) (*GroupMember, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -213,7 +213,7 @@ 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) { +func (s *GroupMembersService) GetInheritedGroupMember(gid any, user int64, options ...RequestOptionFunc) (*GroupMember, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -285,7 +285,7 @@ type ListMembershipsForBillableGroupMemberOptions struct { // // 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) { +func (s *GroupsService) ListMembershipsForBillableGroupMember(gid any, user int64, opt *ListMembershipsForBillableGroupMemberOptions, options ...RequestOptionFunc) ([]*BillableUserMembership, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -310,7 +310,7 @@ func (s *GroupsService) ListMembershipsForBillableGroupMember(gid any, user int, // // 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) { +func (s *GroupsService) RemoveBillableGroupMember(gid any, user int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -379,7 +379,7 @@ func (s *GroupMembersService) ShareWithGroup(gid any, opt *ShareWithGroupOptions // // 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) { +func (s *GroupMembersService) DeleteShareWithGroup(gid any, groupID int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -402,14 +402,14 @@ 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) { +func (s *GroupMembersService) EditGroupMember(gid any, user int64, opt *EditGroupMemberOptions, options ...RequestOptionFunc) (*GroupMember, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -443,7 +443,7 @@ 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) { +func (s *GroupMembersService) RemoveGroupMember(gid any, user int64, opt *RemoveGroupMemberOptions, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/group_milestones.go b/group_milestones.go index 15129e6f..2a687ab1 100644 --- a/group_milestones.go +++ b/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 @@ -243,7 +243,7 @@ type GetGroupMilestoneIssuesOptions struct { // // 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 @@ -278,7 +278,7 @@ type GetGroupMilestoneMergeRequestsOptions struct { // // 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 @@ -305,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"` } @@ -323,7 +323,7 @@ type GetGroupMilestoneBurndownChartEventsOptions struct { // // 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/group_milestones_test.go b/group_milestones_test.go index 776e0422..64473bc6 100644 --- a/group_milestones_test.go +++ b/group_milestones_test.go @@ -583,7 +583,7 @@ func TestGroupMilestonesService_GetGroupMilestoneBurndownChartEvents(t *testing. }) want := []*BurndownChartEvent{{ - Weight: Ptr(10), + Weight: Ptr(int64(10)), Action: Ptr("update"), }} diff --git a/group_protected_environments.go b/group_protected_environments.go index ecf8874b..6e7d7f62 100644 --- a/group_protected_environments.go +++ b/group_protected_environments.go @@ -49,7 +49,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 +59,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 +73,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 @@ -151,7 +151,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"` } @@ -162,9 +162,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 @@ -173,12 +173,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. @@ -214,7 +214,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"` } @@ -225,10 +225,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"` } @@ -238,13 +238,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"` } diff --git a/group_protected_environments_test.go b/group_protected_environments_test.go index c68dc0a2..e6baa741 100644 --- a/group_protected_environments_test.go +++ b/group_protected_environments_test.go @@ -262,10 +262,10 @@ func TestGroupProtectEnvironments(t *testing.T) { DeployAccessLevels: &[]*GroupEnvironmentAccessOptions{ {AccessLevel: Ptr(AccessLevelValue(30))}, }, - RequiredApprovalCount: Ptr(2), + RequiredApprovalCount: Ptr(int64(2)), ApprovalRules: &[]*GroupEnvironmentApprovalRuleOptions{ { - GroupID: Ptr(10), + GroupID: Ptr(int64(10)), AccessLevel: Ptr(AccessLevelValue(0)), AccessLevelDescription: Ptr("devops"), }, @@ -373,13 +373,13 @@ func TestGroupUpdateProtectedEnvironments(t *testing.T) { DeployAccessLevels: &[]*UpdateGroupEnvironmentAccessOptions{ { AccessLevel: Ptr(AccessLevelValue(30)), - GroupInheritanceType: Ptr(1), + GroupInheritanceType: Ptr(int64(1)), }, }, - RequiredApprovalCount: Ptr(2), + RequiredApprovalCount: Ptr(int64(2)), ApprovalRules: &[]*UpdateGroupEnvironmentApprovalRuleOptions{ { - GroupID: Ptr(10), + GroupID: Ptr(int64(10)), AccessLevel: Ptr(AccessLevelValue(5)), AccessLevelDescription: Ptr("devops"), }, @@ -460,9 +460,9 @@ func TestGroupUpdateProtectedEnvironments(t *testing.T) { Name: Ptr(environmentName), DeployAccessLevels: &[]*UpdateGroupEnvironmentAccessOptions{ { - ID: Ptr(42), + ID: Ptr(int64(42)), AccessLevel: Ptr(AccessLevelValue(30)), - GroupInheritanceType: Ptr(0), + GroupInheritanceType: Ptr(int64(0)), }, }, } @@ -521,8 +521,8 @@ func TestGroupUpdateProtectedEnvironments(t *testing.T) { Name: Ptr(environmentName), ApprovalRules: &[]*UpdateGroupEnvironmentApprovalRuleOptions{ { - ID: Ptr(1), - GroupID: Ptr(10), + ID: Ptr(int64(1)), + GroupID: Ptr(int64(10)), AccessLevel: Ptr(AccessLevelValue(5)), AccessLevelDescription: Ptr("devops"), }, @@ -567,11 +567,11 @@ func TestGroupUpdateProtectedEnvironments(t *testing.T) { Name: Ptr(environmentName), ApprovalRules: &[]*UpdateGroupEnvironmentApprovalRuleOptions{ { - ID: Ptr(1), + ID: Ptr(int64(1)), Destroy: Ptr(true), }, }, - RequiredApprovalCount: Ptr(0), + RequiredApprovalCount: Ptr(int64(0)), } environment, _, err = client.GroupProtectedEnvironments.UpdateGroupProtectedEnvironment(5, environmentName, opt) diff --git a/group_repository_storage_move.go b/group_repository_storage_move.go index 7aa3f597..3be69efe 100644 --- a/group_repository_storage_move.go +++ b/group_repository_storage_move.go @@ -25,10 +25,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 +47,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 +56,7 @@ type GroupRepositoryStorageMove struct { } type RepositoryGroup struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` WebURL string `json:"web_url"` } @@ -95,7 +95,7 @@ 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) { +func (g GroupRepositoryStorageMoveService) RetrieveAllStorageMovesForGroup(group int64, 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) @@ -116,7 +116,7 @@ func (g GroupRepositoryStorageMoveService) RetrieveAllStorageMovesForGroup(group // // 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) { +func (g GroupRepositoryStorageMoveService) GetStorageMove(repositoryStorage int64, options ...RequestOptionFunc) (*GroupRepositoryStorageMove, *Response, error) { u := fmt.Sprintf("group_repository_storage_moves/%d", repositoryStorage) req, err := g.client.NewRequest(http.MethodGet, u, nil, options) @@ -137,7 +137,7 @@ func (g GroupRepositoryStorageMoveService) GetStorageMove(repositoryStorage int, // // 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) { +func (g GroupRepositoryStorageMoveService) GetStorageMoveForGroup(group int64, repositoryStorage int64, 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) @@ -167,7 +167,7 @@ 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) { +func (g GroupRepositoryStorageMoveService) ScheduleStorageMoveForGroup(group int64, 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) diff --git a/group_security_settings.go b/group_security_settings.go index cab9c6a1..988d0337 100644 --- a/group_security_settings.go +++ b/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/group_security_settings_test.go b/group_security_settings_test.go index 2d76288f..eb2e6578 100644 --- a/group_security_settings_test.go +++ b/group_security_settings_test.go @@ -27,7 +27,7 @@ func TestGroupSecuritySettings_UpdateSecretPushProtectionEnabledSetting(t *testi d, resp, err := client.GroupSecuritySettings.UpdateSecretPushProtectionEnabledSetting(1, UpdateGroupSecuritySettingsOptions{ SecretPushProtectionEnabled: Ptr(true), - ProjectsToExclude: Ptr([]int{1, 2}), + ProjectsToExclude: Ptr([]int64{1, 2}), }) require.NoError(t, err) require.NotNil(t, resp) diff --git a/group_serviceaccounts.go b/group_serviceaccounts.go index 8021b56d..cef0b07d 100644 --- a/group_serviceaccounts.go +++ b/group_serviceaccounts.go @@ -27,7 +27,7 @@ import ( // GitLab API docs: // https://docs.gitlab.com/api/group_service_accounts/#create-a-service-account-user type GroupServiceAccount struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` UserName string `json:"username"` Email string `json:"email"` @@ -120,7 +120,7 @@ type UpdateServiceAccountOptions struct { // // 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) { +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 @@ -155,7 +155,7 @@ type DeleteServiceAccountOptions struct { // // 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) { +func (s *GroupsService) DeleteServiceAccount(gid any, serviceAccount int64, opt *DeleteServiceAccountOptions, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -184,7 +184,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"` @@ -195,7 +195,7 @@ type ListServiceAccountPersonalAccessTokensOptions struct { // // 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) { +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 @@ -233,7 +233,7 @@ type CreateServiceAccountPersonalAccessTokenOptions struct { // // 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) { +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 @@ -259,7 +259,7 @@ func (s *GroupsService) CreateServiceAccountPersonalAccessToken(gid any, service // // 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) { +func (s *GroupsService) RevokeServiceAccountPersonalAccessToken(gid any, serviceAccount, token int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err @@ -288,7 +288,7 @@ type RotateServiceAccountPersonalAccessTokenOptions struct { // // 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) { +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/group_ssh_certificates.go b/group_ssh_certificates.go index 62774048..942697c5 100644 --- a/group_ssh_certificates.go +++ b/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/groups.go b/groups.go index a4531342..0ccc504b 100644 --- a/groups.go +++ b/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"` @@ -162,19 +162,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 +231,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 +239,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"` @@ -456,7 +456,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 +465,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 +503,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 +513,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 +600,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 +642,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 +651,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"` @@ -665,7 +665,7 @@ type UpdateGroupOptions struct { 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 +1108,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 +1162,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 +1197,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 +1217,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 +1227,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 +1273,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 +1319,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/groups_test.go b/groups_test.go index 333bd9d8..093eed27 100644 --- a/groups_test.go +++ b/groups_test.go @@ -274,7 +274,7 @@ func TestTransferSubGroup(t *testing.T) { }) opt := &TransferSubGroupOptions{ - GroupID: Ptr(2), + GroupID: Ptr(int64(2)), } group, _, err := client.Groups.TransferSubGroup(1, opt) @@ -783,7 +783,7 @@ func TestAddGroupSAMLLinkCustomRole(t *testing.T) { opt := &AddGroupSAMLLinkOptions{ SAMLGroupName: Ptr("gitlab_group_example_developer"), AccessLevel: Ptr(DeveloperPermissions), - MemberRoleID: Ptr(123), + MemberRoleID: Ptr(int64(123)), } link, _, err := client.Groups.AddGroupSAMLLink(1, opt) @@ -903,9 +903,9 @@ func TestShareGroupWithGroup(t *testing.T) { }) group, _, err := client.Groups.ShareGroupWithGroup(1, &ShareGroupWithGroupOptions{ - GroupID: Ptr(1), + GroupID: Ptr(int64(1)), GroupAccess: Ptr(DeveloperPermissions), - MemberRoleID: Ptr(1), + MemberRoleID: Ptr(int64(1)), }) if err != nil { t.Errorf("Groups.ShareGroupWithGroup returned error: %v", err) @@ -916,7 +916,7 @@ func TestShareGroupWithGroup(t *testing.T) { t.Errorf("Groups.ShareGroupWithGroup returned %+v, want %+v", group, want) } - assert.Equal(t, 1, *input.MemberRoleID) + assert.Equal(t, int64(1), *input.MemberRoleID) } func TestUnshareGroupFromGroup(t *testing.T) { @@ -1176,7 +1176,7 @@ func TestAddGroupPushRules(t *testing.T) { PreventSecrets: Ptr(false), AuthorEmailRegex: Ptr("@company.com$"), FileNameRegex: Ptr("(jar|exe)$"), - MaxFileSize: Ptr(5), + MaxFileSize: Ptr(int64(5)), CommitCommitterCheck: Ptr(false), CommitCommitterNameCheck: Ptr(false), RejectUnsignedCommits: Ptr(false), @@ -1243,7 +1243,7 @@ func TestEditGroupPushRules(t *testing.T) { PreventSecrets: Ptr(false), AuthorEmailRegex: Ptr("@company.com$"), FileNameRegex: Ptr("(jar|exe)$"), - MaxFileSize: Ptr(5), + MaxFileSize: Ptr(int64(5)), CommitCommitterCheck: Ptr(false), CommitCommitterNameCheck: Ptr(false), RejectUnsignedCommits: Ptr(false), diff --git a/instance_clusters.go b/instance_clusters.go index fd4bce6b..ae143e20 100644 --- a/instance_clusters.go +++ b/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/integrations.go b/integrations.go index 2e4357ad..60dd871f 100644 --- a/integrations.go +++ b/integrations.go @@ -47,7 +47,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"` diff --git a/invites.go b/invites.go index 71b64e07..e8ef7bde 100644 --- a/invites.go +++ b/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/issue_links.go b/issue_links.go index 78b3877b..493c2ed5 100644 --- a/issue_links.go +++ b/issue_links.go @@ -24,10 +24,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 @@ -55,14 +55,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"` @@ -72,9 +72,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"` @@ -87,7 +87,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -112,7 +112,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -147,7 +147,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -172,7 +172,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) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/issues.go b/issues.go index ef1e9116..5fa58773 100644 --- a/issues.go +++ b/issues.go @@ -30,24 +30,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 @@ -64,7 +64,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"` @@ -74,7 +74,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"` @@ -91,7 +91,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"` @@ -111,40 +111,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"` @@ -198,7 +198,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"` @@ -218,17 +218,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"` @@ -242,7 +242,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 @@ -273,20 +273,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"` @@ -304,7 +304,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 @@ -337,7 +337,7 @@ 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"` + 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"` @@ -345,12 +345,12 @@ type ListProjectIssuesOptions 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"` - AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` - NotAssigneeID *int `url:"not[assignee_id],omitempty" json:"not[assignee_id],omitempty"` + NotAuthorID *int64 `url:"not[author_id],omitempty" json:"not[author_id],omitempty"` + AssigneeID *int64 `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"` @@ -367,7 +367,7 @@ type ListProjectIssuesOptions 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"` } // ListProjectIssues gets a list of project issues. This function accepts @@ -398,7 +398,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) { u := fmt.Sprintf("issues/%d", issue) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -418,7 +418,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -443,19 +443,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"` } @@ -493,16 +493,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"` @@ -568,7 +568,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -592,7 +592,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) { project, err := parseID(pid) if err != nil { return nil, err @@ -611,14 +611,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -643,14 +643,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -677,7 +677,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -704,7 +704,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -731,7 +731,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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -766,7 +766,7 @@ type ListMergeRequestsClosingIssueOptions struct { // // 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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -801,7 +801,7 @@ type ListMergeRequestsRelatedToIssueOptions struct { // // 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) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -829,7 +829,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...) } @@ -837,7 +837,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...) } @@ -845,7 +845,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...) } @@ -853,7 +853,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...) } @@ -861,7 +861,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...) } @@ -869,7 +869,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) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/issues_statistics.go b/issues_statistics.go index 2ffa4081..02cf37eb 100644 --- a/issues_statistics.go +++ b/issues_statistics.go @@ -62,9 +62,9 @@ type IssuesStatisticsStatistics struct { // // GitLab API docs: https://docs.gitlab.com/api/issues_statistics/ type IssuesStatisticsCounts struct { - All int `json:"all"` - Closed int `json:"closed"` - Opened int `json:"opened"` + All int64 `json:"all"` + Closed int64 `json:"closed"` + Opened int64 `json:"opened"` } // GetIssuesStatisticsOptions represents the available GetIssuesStatistics() options. @@ -75,12 +75,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"` @@ -117,12 +117,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"` @@ -164,13 +164,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/issues_statistics_test.go b/issues_statistics_test.go index 81b2f06c..9502f16d 100644 --- a/issues_statistics_test.go +++ b/issues_statistics_test.go @@ -34,8 +34,8 @@ func TestGetIssuesStatistics(t *testing.T) { }) opt := &GetIssuesStatisticsOptions{ - AssigneeID: Ptr(1), - AuthorID: Ptr(1), + AssigneeID: Ptr(int64(1)), + AuthorID: Ptr(int64(1)), } issue, _, err := client.IssuesStatistics.GetIssuesStatistics(opt) @@ -67,8 +67,8 @@ func TestGetGroupIssuesStatistics(t *testing.T) { }) opt := &GetGroupIssuesStatisticsOptions{ - AssigneeID: Ptr(1), - AuthorID: Ptr(1), + AssigneeID: Ptr(int64(1)), + AuthorID: Ptr(int64(1)), } issue, _, err := client.IssuesStatistics.GetGroupIssuesStatistics(1, opt) @@ -100,8 +100,8 @@ func TestGetProjectIssuesStatistics(t *testing.T) { }) opt := &GetProjectIssuesStatisticsOptions{ - AssigneeID: Ptr(1), - AuthorID: Ptr(1), + AssigneeID: Ptr(int64(1)), + AuthorID: Ptr(int64(1)), } issue, _, err := client.IssuesStatistics.GetProjectIssuesStatistics(1, opt) diff --git a/issues_test.go b/issues_test.go index 9d7e92fb..abaa9be0 100644 --- a/issues_test.go +++ b/issues_test.go @@ -105,7 +105,7 @@ func TestReorderIssue(t *testing.T) { fmt.Fprint(w, `{"id":1, "title" : "Reordered issue", "description": "This is the description of a reordered issue", "author" : {"id" : 1, "name": "corrie"}, "assignees":[{"id":1}]}`) }) - afterID := 100 + afterID := int64(100) opt := ReorderIssueOptions{MoveAfterID: &afterID} issue, _, err := client.Issues.ReorderIssue("1", 5, &opt) @@ -135,7 +135,7 @@ func TestMoveIssue(t *testing.T) { mustWriteHTTPResponse(t, w, "testdata/issue_move.json") }) - issue, _, err := client.Issues.MoveIssue("1", 11, &MoveIssueOptions{ToProjectID: Ptr(5)}) + issue, _, err := client.Issues.MoveIssue("1", 11, &MoveIssueOptions{ToProjectID: Ptr(int64(5))}) if err != nil { t.Fatal(err) } @@ -209,7 +209,7 @@ func TestListIssues(t *testing.T) { }) listProjectIssue := &ListIssuesOptions{ - AuthorID: Ptr(0o1), + AuthorID: Ptr(int64(0o1)), AssigneeID: AssigneeID(0o2), } @@ -276,7 +276,7 @@ func TestListIssuesWithLabelDetails(t *testing.T) { }) listProjectIssue := &ListIssuesOptions{ - AuthorID: Ptr(0o1), + AuthorID: Ptr(int64(0o1)), AssigneeID: AssigneeID(0o2), } @@ -407,7 +407,7 @@ func TestListIssuesSearchByIterationID(t *testing.T) { }) listProjectIssue := &ListIssuesOptions{ - IterationID: Ptr(90), + IterationID: Ptr(int64(90)), } issues, _, err := client.Issues.ListIssues(listProjectIssue) @@ -445,8 +445,8 @@ func TestListProjectIssues(t *testing.T) { }) listProjectIssue := &ListProjectIssuesOptions{ - AuthorID: Ptr(0o1), - AssigneeID: Ptr(0o2), + AuthorID: Ptr(int64(0o1)), + AssigneeID: Ptr(int64(0o2)), } issues, _, err := client.Issues.ListProjectIssues("1", listProjectIssue) if err != nil { @@ -492,7 +492,7 @@ func TestListProjectIssuesSearchByIterationID(t *testing.T) { }) listProjectIssue := &ListProjectIssuesOptions{ - IterationID: Ptr(90), + IterationID: Ptr(int64(90)), } issues, _, err := client.Issues.ListProjectIssues(1, listProjectIssue) @@ -531,7 +531,7 @@ func TestListGroupIssues(t *testing.T) { listGroupIssue := &ListGroupIssuesOptions{ State: Ptr("Open"), - AuthorID: Ptr(0o1), + AuthorID: Ptr(int64(0o1)), AssigneeID: AssigneeID(0o2), Confidential: Ptr(false), } @@ -580,7 +580,7 @@ func TestListGroupIssuesSearchByIterationID(t *testing.T) { }) listProjectIssue := &ListGroupIssuesOptions{ - IterationID: Ptr(90), + IterationID: Ptr(int64(90)), } issues, _, err := client.Issues.ListGroupIssues(1, listProjectIssue) @@ -705,7 +705,7 @@ func TestUpdateIssue_ResetFields(t *testing.T) { }, { name: "set epic", - opts: UpdateIssueOptions{EpicID: Ptr(42)}, + opts: UpdateIssueOptions{EpicID: Ptr(int64(42))}, wantBody: map[string]any{"epic_id": float64(42)}, }, { @@ -715,7 +715,7 @@ func TestUpdateIssue_ResetFields(t *testing.T) { }, { name: "set milestone", - opts: UpdateIssueOptions{MilestoneID: Ptr(42)}, + opts: UpdateIssueOptions{MilestoneID: Ptr(int64(42))}, wantBody: map[string]any{"milestone_id": float64(42)}, }, { @@ -725,7 +725,7 @@ func TestUpdateIssue_ResetFields(t *testing.T) { }, { name: "set weight", - opts: UpdateIssueOptions{Weight: Ptr(42)}, + opts: UpdateIssueOptions{Weight: Ptr(int64(42))}, wantBody: map[string]any{"weight": float64(42)}, }, { @@ -749,7 +749,7 @@ func TestUpdateIssue_ResetFields(t *testing.T) { issue, _, err := client.Issues.UpdateIssue(1, 5, &tt.opts) require.NoError(t, err) - assert.Equal(t, 5, issue.ID) + assert.Equal(t, int64(5), issue.ID) }) } } diff --git a/markdown_uploads.go b/markdown_uploads.go index 9acfe237..8f6e08d8 100644 --- a/markdown_uploads.go +++ b/markdown_uploads.go @@ -92,7 +92,7 @@ func listMarkdownUploads[T any](client *Client, resourceType ResourceType, id an } // downloadMarkdownUploadByID downloads a specific upload by ID -func downloadMarkdownUploadByID(client *Client, resourceType ResourceType, id any, uploadID int, options []RequestOptionFunc) (*bytes.Buffer, *Response, error) { +func downloadMarkdownUploadByID(client *Client, resourceType ResourceType, id any, uploadID int64, options []RequestOptionFunc) (*bytes.Buffer, *Response, error) { resourceID, err := parseID(id) if err != nil { return nil, nil, err @@ -136,7 +136,7 @@ func downloadMarkdownUploadBySecretAndFilename(client *Client, resourceType Reso } // deleteMarkdownUploadByID deletes an upload by ID -func deleteMarkdownUploadByID(client *Client, resourceType ResourceType, id any, uploadID int, options []RequestOptionFunc) (*Response, error) { +func deleteMarkdownUploadByID(client *Client, resourceType ResourceType, id any, uploadID int64, options []RequestOptionFunc) (*Response, error) { resourceID, err := parseID(id) if err != nil { return nil, err diff --git a/merge_requests.go b/merge_requests.go index 053c4f89..d7d3859a 100644 --- a/merge_requests.go +++ b/merge_requests.go @@ -52,11 +52,11 @@ type ( 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) + 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 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) @@ -1206,7 +1206,7 @@ func (s *MergeRequestsService) CreateTodo(pid any, mergeRequest int, options ... // // 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...) } @@ -1214,7 +1214,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...) } @@ -1222,7 +1222,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...) } @@ -1230,7 +1230,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...) } @@ -1238,7 +1238,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...) } diff --git a/project_markdown_uploads.go b/project_markdown_uploads.go index 88a39320..92f5b0d5 100644 --- a/project_markdown_uploads.go +++ b/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) } @@ -95,7 +95,7 @@ func (s *ProjectMarkdownUploadsService) ListProjectMarkdownUploads(pid any, opti // // 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) { +func (s *ProjectMarkdownUploadsService) DownloadProjectMarkdownUploadByID(pid any, uploadID int64, options ...RequestOptionFunc) ([]byte, *Response, error) { buffer, resp, err := downloadMarkdownUploadByID(s.client, ProjectResource, pid, uploadID, options) if err != nil { return nil, resp, err @@ -120,7 +120,7 @@ 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) { +func (s *ProjectMarkdownUploadsService) DeleteProjectMarkdownUploadByID(pid any, uploadID int64, options ...RequestOptionFunc) (*Response, error) { return deleteMarkdownUploadByID(s.client, ProjectResource, pid, uploadID, options) } diff --git a/testing/feature_flag_user_lists_mock.go b/testing/feature_flag_user_lists_mock.go index 93af5930..5c186df1 100644 --- a/testing/feature_flag_user_lists_mock.go +++ b/testing/feature_flag_user_lists_mock.go @@ -86,7 +86,7 @@ func (c *MockFeatureFlagUserListsServiceInterfaceCreateFeatureFlagUserListCall) } // DeleteFeatureFlagUserList mocks base method. -func (m *MockFeatureFlagUserListsServiceInterface) DeleteFeatureFlagUserList(pid any, iid int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockFeatureFlagUserListsServiceInterface) DeleteFeatureFlagUserList(pid any, iid int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, iid} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockFeatureFlagUserListsServiceInterfaceDeleteFeatureFlagUserListCall) } // Do rewrite *gomock.Call.Do -func (c *MockFeatureFlagUserListsServiceInterfaceDeleteFeatureFlagUserListCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceDeleteFeatureFlagUserListCall { +func (c *MockFeatureFlagUserListsServiceInterfaceDeleteFeatureFlagUserListCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceDeleteFeatureFlagUserListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockFeatureFlagUserListsServiceInterfaceDeleteFeatureFlagUserListCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceDeleteFeatureFlagUserListCall { +func (c *MockFeatureFlagUserListsServiceInterfaceDeleteFeatureFlagUserListCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceDeleteFeatureFlagUserListCall { c.Call = c.Call.DoAndReturn(f) return c } // GetFeatureFlagUserList mocks base method. -func (m *MockFeatureFlagUserListsServiceInterface) GetFeatureFlagUserList(pid any, iid int, options ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error) { +func (m *MockFeatureFlagUserListsServiceInterface) GetFeatureFlagUserList(pid any, iid int64, options ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, iid} for _, a := range options { @@ -163,13 +163,13 @@ func (c *MockFeatureFlagUserListsServiceInterfaceGetFeatureFlagUserListCall) Ret } // Do rewrite *gomock.Call.Do -func (c *MockFeatureFlagUserListsServiceInterfaceGetFeatureFlagUserListCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceGetFeatureFlagUserListCall { +func (c *MockFeatureFlagUserListsServiceInterfaceGetFeatureFlagUserListCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceGetFeatureFlagUserListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockFeatureFlagUserListsServiceInterfaceGetFeatureFlagUserListCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceGetFeatureFlagUserListCall { +func (c *MockFeatureFlagUserListsServiceInterfaceGetFeatureFlagUserListCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceGetFeatureFlagUserListCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -220,7 +220,7 @@ func (c *MockFeatureFlagUserListsServiceInterfaceListFeatureFlagUserListsCall) D } // UpdateFeatureFlagUserList mocks base method. -func (m *MockFeatureFlagUserListsServiceInterface) UpdateFeatureFlagUserList(pid any, iid int, opt *gitlab.UpdateFeatureFlagUserListOptions, options ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error) { +func (m *MockFeatureFlagUserListsServiceInterface) UpdateFeatureFlagUserList(pid any, iid int64, opt *gitlab.UpdateFeatureFlagUserListOptions, options ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, iid, opt} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockFeatureFlagUserListsServiceInterfaceUpdateFeatureFlagUserListCall) } // Do rewrite *gomock.Call.Do -func (c *MockFeatureFlagUserListsServiceInterfaceUpdateFeatureFlagUserListCall) Do(f func(any, int, *gitlab.UpdateFeatureFlagUserListOptions, ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceUpdateFeatureFlagUserListCall { +func (c *MockFeatureFlagUserListsServiceInterfaceUpdateFeatureFlagUserListCall) Do(f func(any, int64, *gitlab.UpdateFeatureFlagUserListOptions, ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceUpdateFeatureFlagUserListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockFeatureFlagUserListsServiceInterfaceUpdateFeatureFlagUserListCall) DoAndReturn(f func(any, int, *gitlab.UpdateFeatureFlagUserListOptions, ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceUpdateFeatureFlagUserListCall { +func (c *MockFeatureFlagUserListsServiceInterfaceUpdateFeatureFlagUserListCall) DoAndReturn(f func(any, int64, *gitlab.UpdateFeatureFlagUserListOptions, ...gitlab.RequestOptionFunc) (*gitlab.FeatureFlagUserList, *gitlab.Response, error)) *MockFeatureFlagUserListsServiceInterfaceUpdateFeatureFlagUserListCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/freeze_periods_mock.go b/testing/freeze_periods_mock.go index eec49580..9622cf42 100644 --- a/testing/freeze_periods_mock.go +++ b/testing/freeze_periods_mock.go @@ -86,7 +86,7 @@ func (c *MockFreezePeriodsServiceInterfaceCreateFreezePeriodOptionsCall) DoAndRe } // DeleteFreezePeriod mocks base method. -func (m *MockFreezePeriodsServiceInterface) DeleteFreezePeriod(pid any, freezePeriod int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockFreezePeriodsServiceInterface) DeleteFreezePeriod(pid any, freezePeriod int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, freezePeriod} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockFreezePeriodsServiceInterfaceDeleteFreezePeriodCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockFreezePeriodsServiceInterfaceDeleteFreezePeriodCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceDeleteFreezePeriodCall { +func (c *MockFreezePeriodsServiceInterfaceDeleteFreezePeriodCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceDeleteFreezePeriodCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockFreezePeriodsServiceInterfaceDeleteFreezePeriodCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceDeleteFreezePeriodCall { +func (c *MockFreezePeriodsServiceInterfaceDeleteFreezePeriodCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceDeleteFreezePeriodCall { c.Call = c.Call.DoAndReturn(f) return c } // GetFreezePeriod mocks base method. -func (m *MockFreezePeriodsServiceInterface) GetFreezePeriod(pid any, freezePeriod int, options ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error) { +func (m *MockFreezePeriodsServiceInterface) GetFreezePeriod(pid any, freezePeriod int64, options ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, freezePeriod} for _, a := range options { @@ -163,13 +163,13 @@ func (c *MockFreezePeriodsServiceInterfaceGetFreezePeriodCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockFreezePeriodsServiceInterfaceGetFreezePeriodCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceGetFreezePeriodCall { +func (c *MockFreezePeriodsServiceInterfaceGetFreezePeriodCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceGetFreezePeriodCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockFreezePeriodsServiceInterfaceGetFreezePeriodCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceGetFreezePeriodCall { +func (c *MockFreezePeriodsServiceInterfaceGetFreezePeriodCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceGetFreezePeriodCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -220,7 +220,7 @@ func (c *MockFreezePeriodsServiceInterfaceListFreezePeriodsCall) DoAndReturn(f f } // UpdateFreezePeriodOptions mocks base method. -func (m *MockFreezePeriodsServiceInterface) UpdateFreezePeriodOptions(pid any, freezePeriod int, opt *gitlab.UpdateFreezePeriodOptions, options ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error) { +func (m *MockFreezePeriodsServiceInterface) UpdateFreezePeriodOptions(pid any, freezePeriod int64, opt *gitlab.UpdateFreezePeriodOptions, options ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, freezePeriod, opt} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockFreezePeriodsServiceInterfaceUpdateFreezePeriodOptionsCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockFreezePeriodsServiceInterfaceUpdateFreezePeriodOptionsCall) Do(f func(any, int, *gitlab.UpdateFreezePeriodOptions, ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceUpdateFreezePeriodOptionsCall { +func (c *MockFreezePeriodsServiceInterfaceUpdateFreezePeriodOptionsCall) Do(f func(any, int64, *gitlab.UpdateFreezePeriodOptions, ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceUpdateFreezePeriodOptionsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockFreezePeriodsServiceInterfaceUpdateFreezePeriodOptionsCall) DoAndReturn(f func(any, int, *gitlab.UpdateFreezePeriodOptions, ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceUpdateFreezePeriodOptionsCall { +func (c *MockFreezePeriodsServiceInterfaceUpdateFreezePeriodOptionsCall) DoAndReturn(f func(any, int64, *gitlab.UpdateFreezePeriodOptions, ...gitlab.RequestOptionFunc) (*gitlab.FreezePeriod, *gitlab.Response, error)) *MockFreezePeriodsServiceInterfaceUpdateFreezePeriodOptionsCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/geo_nodes_mock.go b/testing/geo_nodes_mock.go index 8e360357..f8d04397 100644 --- a/testing/geo_nodes_mock.go +++ b/testing/geo_nodes_mock.go @@ -86,7 +86,7 @@ func (c *MockGeoNodesServiceInterfaceCreateGeoNodeCall) DoAndReturn(f func(*gitl } // DeleteGeoNode mocks base method. -func (m *MockGeoNodesServiceInterface) DeleteGeoNode(arg0 int, arg1 ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGeoNodesServiceInterface) DeleteGeoNode(arg0 int64, arg1 ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{arg0} for _, a := range arg1 { @@ -118,19 +118,19 @@ func (c *MockGeoNodesServiceInterfaceDeleteGeoNodeCall) Return(arg0 *gitlab.Resp } // Do rewrite *gomock.Call.Do -func (c *MockGeoNodesServiceInterfaceDeleteGeoNodeCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGeoNodesServiceInterfaceDeleteGeoNodeCall { +func (c *MockGeoNodesServiceInterfaceDeleteGeoNodeCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGeoNodesServiceInterfaceDeleteGeoNodeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGeoNodesServiceInterfaceDeleteGeoNodeCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGeoNodesServiceInterfaceDeleteGeoNodeCall { +func (c *MockGeoNodesServiceInterfaceDeleteGeoNodeCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGeoNodesServiceInterfaceDeleteGeoNodeCall { c.Call = c.Call.DoAndReturn(f) return c } // EditGeoNode mocks base method. -func (m *MockGeoNodesServiceInterface) EditGeoNode(arg0 int, arg1 *gitlab.UpdateGeoNodesOptions, arg2 ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error) { +func (m *MockGeoNodesServiceInterface) EditGeoNode(arg0 int64, arg1 *gitlab.UpdateGeoNodesOptions, arg2 ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{arg0, arg1} for _, a := range arg2 { @@ -163,19 +163,19 @@ func (c *MockGeoNodesServiceInterfaceEditGeoNodeCall) Return(arg0 *gitlab.GeoNod } // Do rewrite *gomock.Call.Do -func (c *MockGeoNodesServiceInterfaceEditGeoNodeCall) Do(f func(int, *gitlab.UpdateGeoNodesOptions, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceEditGeoNodeCall { +func (c *MockGeoNodesServiceInterfaceEditGeoNodeCall) Do(f func(int64, *gitlab.UpdateGeoNodesOptions, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceEditGeoNodeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGeoNodesServiceInterfaceEditGeoNodeCall) DoAndReturn(f func(int, *gitlab.UpdateGeoNodesOptions, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceEditGeoNodeCall { +func (c *MockGeoNodesServiceInterfaceEditGeoNodeCall) DoAndReturn(f func(int64, *gitlab.UpdateGeoNodesOptions, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceEditGeoNodeCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGeoNode mocks base method. -func (m *MockGeoNodesServiceInterface) GetGeoNode(arg0 int, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error) { +func (m *MockGeoNodesServiceInterface) GetGeoNode(arg0 int64, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{arg0} for _, a := range arg1 { @@ -208,13 +208,13 @@ func (c *MockGeoNodesServiceInterfaceGetGeoNodeCall) Return(arg0 *gitlab.GeoNode } // Do rewrite *gomock.Call.Do -func (c *MockGeoNodesServiceInterfaceGetGeoNodeCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceGetGeoNodeCall { +func (c *MockGeoNodesServiceInterfaceGetGeoNodeCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceGetGeoNodeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGeoNodesServiceInterfaceGetGeoNodeCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceGetGeoNodeCall { +func (c *MockGeoNodesServiceInterfaceGetGeoNodeCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceGetGeoNodeCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -265,7 +265,7 @@ func (c *MockGeoNodesServiceInterfaceListGeoNodesCall) DoAndReturn(f func(*gitla } // RepairGeoNode mocks base method. -func (m *MockGeoNodesServiceInterface) RepairGeoNode(arg0 int, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error) { +func (m *MockGeoNodesServiceInterface) RepairGeoNode(arg0 int64, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{arg0} for _, a := range arg1 { @@ -298,13 +298,13 @@ func (c *MockGeoNodesServiceInterfaceRepairGeoNodeCall) Return(arg0 *gitlab.GeoN } // Do rewrite *gomock.Call.Do -func (c *MockGeoNodesServiceInterfaceRepairGeoNodeCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceRepairGeoNodeCall { +func (c *MockGeoNodesServiceInterfaceRepairGeoNodeCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceRepairGeoNodeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGeoNodesServiceInterfaceRepairGeoNodeCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceRepairGeoNodeCall { +func (c *MockGeoNodesServiceInterfaceRepairGeoNodeCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoNode, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceRepairGeoNodeCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -354,7 +354,7 @@ func (c *MockGeoNodesServiceInterfaceRetrieveStatusOfAllGeoNodesCall) DoAndRetur } // RetrieveStatusOfGeoNode mocks base method. -func (m *MockGeoNodesServiceInterface) RetrieveStatusOfGeoNode(arg0 int, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoNodeStatus, *gitlab.Response, error) { +func (m *MockGeoNodesServiceInterface) RetrieveStatusOfGeoNode(arg0 int64, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoNodeStatus, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{arg0} for _, a := range arg1 { @@ -387,13 +387,13 @@ func (c *MockGeoNodesServiceInterfaceRetrieveStatusOfGeoNodeCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockGeoNodesServiceInterfaceRetrieveStatusOfGeoNodeCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoNodeStatus, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceRetrieveStatusOfGeoNodeCall { +func (c *MockGeoNodesServiceInterfaceRetrieveStatusOfGeoNodeCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoNodeStatus, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceRetrieveStatusOfGeoNodeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGeoNodesServiceInterfaceRetrieveStatusOfGeoNodeCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoNodeStatus, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceRetrieveStatusOfGeoNodeCall { +func (c *MockGeoNodesServiceInterfaceRetrieveStatusOfGeoNodeCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoNodeStatus, *gitlab.Response, error)) *MockGeoNodesServiceInterfaceRetrieveStatusOfGeoNodeCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/geo_sites_mock.go b/testing/geo_sites_mock.go index 58debcc7..785f6f55 100644 --- a/testing/geo_sites_mock.go +++ b/testing/geo_sites_mock.go @@ -86,7 +86,7 @@ func (c *MockGeoSitesServiceInterfaceCreateGeoSiteCall) DoAndReturn(f func(*gitl } // DeleteGeoSite mocks base method. -func (m *MockGeoSitesServiceInterface) DeleteGeoSite(arg0 int, arg1 ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGeoSitesServiceInterface) DeleteGeoSite(arg0 int64, arg1 ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{arg0} for _, a := range arg1 { @@ -118,19 +118,19 @@ func (c *MockGeoSitesServiceInterfaceDeleteGeoSiteCall) Return(arg0 *gitlab.Resp } // Do rewrite *gomock.Call.Do -func (c *MockGeoSitesServiceInterfaceDeleteGeoSiteCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGeoSitesServiceInterfaceDeleteGeoSiteCall { +func (c *MockGeoSitesServiceInterfaceDeleteGeoSiteCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGeoSitesServiceInterfaceDeleteGeoSiteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGeoSitesServiceInterfaceDeleteGeoSiteCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGeoSitesServiceInterfaceDeleteGeoSiteCall { +func (c *MockGeoSitesServiceInterfaceDeleteGeoSiteCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGeoSitesServiceInterfaceDeleteGeoSiteCall { c.Call = c.Call.DoAndReturn(f) return c } // EditGeoSite mocks base method. -func (m *MockGeoSitesServiceInterface) EditGeoSite(arg0 int, arg1 *gitlab.EditGeoSiteOptions, arg2 ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error) { +func (m *MockGeoSitesServiceInterface) EditGeoSite(arg0 int64, arg1 *gitlab.EditGeoSiteOptions, arg2 ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{arg0, arg1} for _, a := range arg2 { @@ -163,19 +163,19 @@ func (c *MockGeoSitesServiceInterfaceEditGeoSiteCall) Return(arg0 *gitlab.GeoSit } // Do rewrite *gomock.Call.Do -func (c *MockGeoSitesServiceInterfaceEditGeoSiteCall) Do(f func(int, *gitlab.EditGeoSiteOptions, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceEditGeoSiteCall { +func (c *MockGeoSitesServiceInterfaceEditGeoSiteCall) Do(f func(int64, *gitlab.EditGeoSiteOptions, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceEditGeoSiteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGeoSitesServiceInterfaceEditGeoSiteCall) DoAndReturn(f func(int, *gitlab.EditGeoSiteOptions, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceEditGeoSiteCall { +func (c *MockGeoSitesServiceInterfaceEditGeoSiteCall) DoAndReturn(f func(int64, *gitlab.EditGeoSiteOptions, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceEditGeoSiteCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGeoSite mocks base method. -func (m *MockGeoSitesServiceInterface) GetGeoSite(arg0 int, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error) { +func (m *MockGeoSitesServiceInterface) GetGeoSite(arg0 int64, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{arg0} for _, a := range arg1 { @@ -208,19 +208,19 @@ func (c *MockGeoSitesServiceInterfaceGetGeoSiteCall) Return(arg0 *gitlab.GeoSite } // Do rewrite *gomock.Call.Do -func (c *MockGeoSitesServiceInterfaceGetGeoSiteCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceGetGeoSiteCall { +func (c *MockGeoSitesServiceInterfaceGetGeoSiteCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceGetGeoSiteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGeoSitesServiceInterfaceGetGeoSiteCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceGetGeoSiteCall { +func (c *MockGeoSitesServiceInterfaceGetGeoSiteCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceGetGeoSiteCall { c.Call = c.Call.DoAndReturn(f) return c } // GetStatusOfGeoSite mocks base method. -func (m *MockGeoSitesServiceInterface) GetStatusOfGeoSite(arg0 int, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoSiteStatus, *gitlab.Response, error) { +func (m *MockGeoSitesServiceInterface) GetStatusOfGeoSite(arg0 int64, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoSiteStatus, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{arg0} for _, a := range arg1 { @@ -253,13 +253,13 @@ func (c *MockGeoSitesServiceInterfaceGetStatusOfGeoSiteCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockGeoSitesServiceInterfaceGetStatusOfGeoSiteCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoSiteStatus, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceGetStatusOfGeoSiteCall { +func (c *MockGeoSitesServiceInterfaceGetStatusOfGeoSiteCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoSiteStatus, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceGetStatusOfGeoSiteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGeoSitesServiceInterfaceGetStatusOfGeoSiteCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoSiteStatus, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceGetStatusOfGeoSiteCall { +func (c *MockGeoSitesServiceInterfaceGetStatusOfGeoSiteCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoSiteStatus, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceGetStatusOfGeoSiteCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -355,7 +355,7 @@ func (c *MockGeoSitesServiceInterfaceListStatusOfAllGeoSitesCall) DoAndReturn(f } // RepairGeoSite mocks base method. -func (m *MockGeoSitesServiceInterface) RepairGeoSite(arg0 int, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error) { +func (m *MockGeoSitesServiceInterface) RepairGeoSite(arg0 int64, arg1 ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{arg0} for _, a := range arg1 { @@ -388,13 +388,13 @@ func (c *MockGeoSitesServiceInterfaceRepairGeoSiteCall) Return(arg0 *gitlab.GeoS } // Do rewrite *gomock.Call.Do -func (c *MockGeoSitesServiceInterfaceRepairGeoSiteCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceRepairGeoSiteCall { +func (c *MockGeoSitesServiceInterfaceRepairGeoSiteCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceRepairGeoSiteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGeoSitesServiceInterfaceRepairGeoSiteCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceRepairGeoSiteCall { +func (c *MockGeoSitesServiceInterfaceRepairGeoSiteCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GeoSite, *gitlab.Response, error)) *MockGeoSitesServiceInterfaceRepairGeoSiteCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/group_access_tokens_mock.go b/testing/group_access_tokens_mock.go index 0d9eef36..98b74405 100644 --- a/testing/group_access_tokens_mock.go +++ b/testing/group_access_tokens_mock.go @@ -86,7 +86,7 @@ func (c *MockGroupAccessTokensServiceInterfaceCreateGroupAccessTokenCall) DoAndR } // GetGroupAccessToken mocks base method. -func (m *MockGroupAccessTokensServiceInterface) GetGroupAccessToken(gid any, id int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error) { +func (m *MockGroupAccessTokensServiceInterface) GetGroupAccessToken(gid any, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, id} for _, a := range options { @@ -119,13 +119,13 @@ func (c *MockGroupAccessTokensServiceInterfaceGetGroupAccessTokenCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockGroupAccessTokensServiceInterfaceGetGroupAccessTokenCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceGetGroupAccessTokenCall { +func (c *MockGroupAccessTokensServiceInterfaceGetGroupAccessTokenCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceGetGroupAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupAccessTokensServiceInterfaceGetGroupAccessTokenCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceGetGroupAccessTokenCall { +func (c *MockGroupAccessTokensServiceInterfaceGetGroupAccessTokenCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceGetGroupAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -176,7 +176,7 @@ func (c *MockGroupAccessTokensServiceInterfaceListGroupAccessTokensCall) DoAndRe } // RevokeGroupAccessToken mocks base method. -func (m *MockGroupAccessTokensServiceInterface) RevokeGroupAccessToken(gid any, id int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupAccessTokensServiceInterface) RevokeGroupAccessToken(gid any, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, id} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockGroupAccessTokensServiceInterfaceRevokeGroupAccessTokenCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockGroupAccessTokensServiceInterfaceRevokeGroupAccessTokenCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceRevokeGroupAccessTokenCall { +func (c *MockGroupAccessTokensServiceInterfaceRevokeGroupAccessTokenCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceRevokeGroupAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupAccessTokensServiceInterfaceRevokeGroupAccessTokenCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceRevokeGroupAccessTokenCall { +func (c *MockGroupAccessTokensServiceInterfaceRevokeGroupAccessTokenCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceRevokeGroupAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // RotateGroupAccessToken mocks base method. -func (m *MockGroupAccessTokensServiceInterface) RotateGroupAccessToken(gid any, id int, opt *gitlab.RotateGroupAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error) { +func (m *MockGroupAccessTokensServiceInterface) RotateGroupAccessToken(gid any, id int64, opt *gitlab.RotateGroupAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, id, opt} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockGroupAccessTokensServiceInterfaceRotateGroupAccessTokenCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockGroupAccessTokensServiceInterfaceRotateGroupAccessTokenCall) Do(f func(any, int, *gitlab.RotateGroupAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceRotateGroupAccessTokenCall { +func (c *MockGroupAccessTokensServiceInterfaceRotateGroupAccessTokenCall) Do(f func(any, int64, *gitlab.RotateGroupAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceRotateGroupAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupAccessTokensServiceInterfaceRotateGroupAccessTokenCall) DoAndReturn(f func(any, int, *gitlab.RotateGroupAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceRotateGroupAccessTokenCall { +func (c *MockGroupAccessTokensServiceInterfaceRotateGroupAccessTokenCall) DoAndReturn(f func(any, int64, *gitlab.RotateGroupAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupAccessToken, *gitlab.Response, error)) *MockGroupAccessTokensServiceInterfaceRotateGroupAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/group_badges_mock.go b/testing/group_badges_mock.go index 7cc3b286..61dc7e8a 100644 --- a/testing/group_badges_mock.go +++ b/testing/group_badges_mock.go @@ -86,7 +86,7 @@ func (c *MockGroupBadgesServiceInterfaceAddGroupBadgeCall) DoAndReturn(f func(an } // DeleteGroupBadge mocks base method. -func (m *MockGroupBadgesServiceInterface) DeleteGroupBadge(gid any, badge int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupBadgesServiceInterface) DeleteGroupBadge(gid any, badge int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, badge} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockGroupBadgesServiceInterfaceDeleteGroupBadgeCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockGroupBadgesServiceInterfaceDeleteGroupBadgeCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupBadgesServiceInterfaceDeleteGroupBadgeCall { +func (c *MockGroupBadgesServiceInterfaceDeleteGroupBadgeCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupBadgesServiceInterfaceDeleteGroupBadgeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupBadgesServiceInterfaceDeleteGroupBadgeCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupBadgesServiceInterfaceDeleteGroupBadgeCall { +func (c *MockGroupBadgesServiceInterfaceDeleteGroupBadgeCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupBadgesServiceInterfaceDeleteGroupBadgeCall { c.Call = c.Call.DoAndReturn(f) return c } // EditGroupBadge mocks base method. -func (m *MockGroupBadgesServiceInterface) EditGroupBadge(gid any, badge int, opt *gitlab.EditGroupBadgeOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error) { +func (m *MockGroupBadgesServiceInterface) EditGroupBadge(gid any, badge int64, opt *gitlab.EditGroupBadgeOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, badge, opt} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockGroupBadgesServiceInterfaceEditGroupBadgeCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockGroupBadgesServiceInterfaceEditGroupBadgeCall) Do(f func(any, int, *gitlab.EditGroupBadgeOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error)) *MockGroupBadgesServiceInterfaceEditGroupBadgeCall { +func (c *MockGroupBadgesServiceInterfaceEditGroupBadgeCall) Do(f func(any, int64, *gitlab.EditGroupBadgeOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error)) *MockGroupBadgesServiceInterfaceEditGroupBadgeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupBadgesServiceInterfaceEditGroupBadgeCall) DoAndReturn(f func(any, int, *gitlab.EditGroupBadgeOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error)) *MockGroupBadgesServiceInterfaceEditGroupBadgeCall { +func (c *MockGroupBadgesServiceInterfaceEditGroupBadgeCall) DoAndReturn(f func(any, int64, *gitlab.EditGroupBadgeOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error)) *MockGroupBadgesServiceInterfaceEditGroupBadgeCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGroupBadge mocks base method. -func (m *MockGroupBadgesServiceInterface) GetGroupBadge(gid any, badge int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error) { +func (m *MockGroupBadgesServiceInterface) GetGroupBadge(gid any, badge int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, badge} for _, a := range options { @@ -208,13 +208,13 @@ func (c *MockGroupBadgesServiceInterfaceGetGroupBadgeCall) Return(arg0 *gitlab.G } // Do rewrite *gomock.Call.Do -func (c *MockGroupBadgesServiceInterfaceGetGroupBadgeCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error)) *MockGroupBadgesServiceInterfaceGetGroupBadgeCall { +func (c *MockGroupBadgesServiceInterfaceGetGroupBadgeCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error)) *MockGroupBadgesServiceInterfaceGetGroupBadgeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupBadgesServiceInterfaceGetGroupBadgeCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error)) *MockGroupBadgesServiceInterfaceGetGroupBadgeCall { +func (c *MockGroupBadgesServiceInterfaceGetGroupBadgeCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupBadge, *gitlab.Response, error)) *MockGroupBadgesServiceInterfaceGetGroupBadgeCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/group_boards_mock.go b/testing/group_boards_mock.go index bce9b099..cdf24e83 100644 --- a/testing/group_boards_mock.go +++ b/testing/group_boards_mock.go @@ -86,7 +86,7 @@ func (c *MockGroupIssueBoardsServiceInterfaceCreateGroupIssueBoardCall) DoAndRet } // CreateGroupIssueBoardList mocks base method. -func (m *MockGroupIssueBoardsServiceInterface) CreateGroupIssueBoardList(gid any, board int, opt *gitlab.CreateGroupIssueBoardListOptions, options ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error) { +func (m *MockGroupIssueBoardsServiceInterface) CreateGroupIssueBoardList(gid any, board int64, opt *gitlab.CreateGroupIssueBoardListOptions, options ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, board, opt} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockGroupIssueBoardsServiceInterfaceCreateGroupIssueBoardListCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockGroupIssueBoardsServiceInterfaceCreateGroupIssueBoardListCall) Do(f func(any, int, *gitlab.CreateGroupIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceCreateGroupIssueBoardListCall { +func (c *MockGroupIssueBoardsServiceInterfaceCreateGroupIssueBoardListCall) Do(f func(any, int64, *gitlab.CreateGroupIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceCreateGroupIssueBoardListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupIssueBoardsServiceInterfaceCreateGroupIssueBoardListCall) DoAndReturn(f func(any, int, *gitlab.CreateGroupIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceCreateGroupIssueBoardListCall { +func (c *MockGroupIssueBoardsServiceInterfaceCreateGroupIssueBoardListCall) DoAndReturn(f func(any, int64, *gitlab.CreateGroupIssueBoardListOptions, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceCreateGroupIssueBoardListCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteGroupIssueBoardList mocks base method. -func (m *MockGroupIssueBoardsServiceInterface) DeleteGroupIssueBoardList(gid any, board, list int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupIssueBoardsServiceInterface) DeleteGroupIssueBoardList(gid any, board, list int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, board, list} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockGroupIssueBoardsServiceInterfaceDeleteGroupIssueBoardListCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockGroupIssueBoardsServiceInterfaceDeleteGroupIssueBoardListCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceDeleteGroupIssueBoardListCall { +func (c *MockGroupIssueBoardsServiceInterfaceDeleteGroupIssueBoardListCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceDeleteGroupIssueBoardListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupIssueBoardsServiceInterfaceDeleteGroupIssueBoardListCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceDeleteGroupIssueBoardListCall { +func (c *MockGroupIssueBoardsServiceInterfaceDeleteGroupIssueBoardListCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceDeleteGroupIssueBoardListCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteIssueBoard mocks base method. -func (m *MockGroupIssueBoardsServiceInterface) DeleteIssueBoard(gid any, board int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupIssueBoardsServiceInterface) DeleteIssueBoard(gid any, board int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, board} for _, a := range options { @@ -207,19 +207,19 @@ func (c *MockGroupIssueBoardsServiceInterfaceDeleteIssueBoardCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockGroupIssueBoardsServiceInterfaceDeleteIssueBoardCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceDeleteIssueBoardCall { +func (c *MockGroupIssueBoardsServiceInterfaceDeleteIssueBoardCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceDeleteIssueBoardCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupIssueBoardsServiceInterfaceDeleteIssueBoardCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceDeleteIssueBoardCall { +func (c *MockGroupIssueBoardsServiceInterfaceDeleteIssueBoardCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceDeleteIssueBoardCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGroupIssueBoard mocks base method. -func (m *MockGroupIssueBoardsServiceInterface) GetGroupIssueBoard(gid any, board int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error) { +func (m *MockGroupIssueBoardsServiceInterface) GetGroupIssueBoard(gid any, board int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, board} for _, a := range options { @@ -252,19 +252,19 @@ func (c *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardCall { +func (c *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardCall { +func (c *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGroupIssueBoardList mocks base method. -func (m *MockGroupIssueBoardsServiceInterface) GetGroupIssueBoardList(gid any, board, list int, options ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error) { +func (m *MockGroupIssueBoardsServiceInterface) GetGroupIssueBoardList(gid any, board, list int64, options ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, board, list} for _, a := range options { @@ -297,19 +297,19 @@ func (c *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardListCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardListCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardListCall { +func (c *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardListCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardListCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardListCall { +func (c *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardListCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceGetGroupIssueBoardListCall { c.Call = c.Call.DoAndReturn(f) return c } // ListGroupIssueBoardLists mocks base method. -func (m *MockGroupIssueBoardsServiceInterface) ListGroupIssueBoardLists(gid any, board int, opt *gitlab.ListGroupIssueBoardListsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error) { +func (m *MockGroupIssueBoardsServiceInterface) ListGroupIssueBoardLists(gid any, board int64, opt *gitlab.ListGroupIssueBoardListsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, board, opt} for _, a := range options { @@ -342,13 +342,13 @@ func (c *MockGroupIssueBoardsServiceInterfaceListGroupIssueBoardListsCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockGroupIssueBoardsServiceInterfaceListGroupIssueBoardListsCall) Do(f func(any, int, *gitlab.ListGroupIssueBoardListsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceListGroupIssueBoardListsCall { +func (c *MockGroupIssueBoardsServiceInterfaceListGroupIssueBoardListsCall) Do(f func(any, int64, *gitlab.ListGroupIssueBoardListsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceListGroupIssueBoardListsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupIssueBoardsServiceInterfaceListGroupIssueBoardListsCall) DoAndReturn(f func(any, int, *gitlab.ListGroupIssueBoardListsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceListGroupIssueBoardListsCall { +func (c *MockGroupIssueBoardsServiceInterfaceListGroupIssueBoardListsCall) DoAndReturn(f func(any, int64, *gitlab.ListGroupIssueBoardListsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceListGroupIssueBoardListsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -399,7 +399,7 @@ func (c *MockGroupIssueBoardsServiceInterfaceListGroupIssueBoardsCall) DoAndRetu } // UpdateIssueBoard mocks base method. -func (m *MockGroupIssueBoardsServiceInterface) UpdateIssueBoard(gid any, board int, opt *gitlab.UpdateGroupIssueBoardOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error) { +func (m *MockGroupIssueBoardsServiceInterface) UpdateIssueBoard(gid any, board int64, opt *gitlab.UpdateGroupIssueBoardOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, board, opt} for _, a := range options { @@ -432,19 +432,19 @@ func (c *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardCall) Do(f func(any, int, *gitlab.UpdateGroupIssueBoardOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardCall { +func (c *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardCall) Do(f func(any, int64, *gitlab.UpdateGroupIssueBoardOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardCall) DoAndReturn(f func(any, int, *gitlab.UpdateGroupIssueBoardOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardCall { +func (c *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardCall) DoAndReturn(f func(any, int64, *gitlab.UpdateGroupIssueBoardOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupIssueBoard, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateIssueBoardList mocks base method. -func (m *MockGroupIssueBoardsServiceInterface) UpdateIssueBoardList(gid any, board, list int, opt *gitlab.UpdateGroupIssueBoardListOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error) { +func (m *MockGroupIssueBoardsServiceInterface) UpdateIssueBoardList(gid any, board, list int64, opt *gitlab.UpdateGroupIssueBoardListOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, board, list, opt} for _, a := range options { @@ -477,13 +477,13 @@ func (c *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardListCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardListCall) Do(f func(any, int, int, *gitlab.UpdateGroupIssueBoardListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardListCall { +func (c *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardListCall) Do(f func(any, int64, int64, *gitlab.UpdateGroupIssueBoardListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardListCall) DoAndReturn(f func(any, int, int, *gitlab.UpdateGroupIssueBoardListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardListCall { +func (c *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardListCall) DoAndReturn(f func(any, int64, int64, *gitlab.UpdateGroupIssueBoardListOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BoardList, *gitlab.Response, error)) *MockGroupIssueBoardsServiceInterfaceUpdateIssueBoardListCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/group_clusters_mock.go b/testing/group_clusters_mock.go index 4c88685c..336bb958 100644 --- a/testing/group_clusters_mock.go +++ b/testing/group_clusters_mock.go @@ -86,7 +86,7 @@ func (c *MockGroupClustersServiceInterfaceAddClusterCall) DoAndReturn(f func(any } // DeleteCluster mocks base method. -func (m *MockGroupClustersServiceInterface) DeleteCluster(pid any, cluster int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupClustersServiceInterface) DeleteCluster(pid any, cluster int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, cluster} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockGroupClustersServiceInterfaceDeleteClusterCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockGroupClustersServiceInterfaceDeleteClusterCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupClustersServiceInterfaceDeleteClusterCall { +func (c *MockGroupClustersServiceInterfaceDeleteClusterCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupClustersServiceInterfaceDeleteClusterCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupClustersServiceInterfaceDeleteClusterCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupClustersServiceInterfaceDeleteClusterCall { +func (c *MockGroupClustersServiceInterfaceDeleteClusterCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupClustersServiceInterfaceDeleteClusterCall { c.Call = c.Call.DoAndReturn(f) return c } // EditCluster mocks base method. -func (m *MockGroupClustersServiceInterface) EditCluster(pid any, cluster int, opt *gitlab.EditGroupClusterOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error) { +func (m *MockGroupClustersServiceInterface) EditCluster(pid any, cluster int64, opt *gitlab.EditGroupClusterOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, cluster, opt} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockGroupClustersServiceInterfaceEditClusterCall) Return(arg0 *gitlab.G } // Do rewrite *gomock.Call.Do -func (c *MockGroupClustersServiceInterfaceEditClusterCall) Do(f func(any, int, *gitlab.EditGroupClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error)) *MockGroupClustersServiceInterfaceEditClusterCall { +func (c *MockGroupClustersServiceInterfaceEditClusterCall) Do(f func(any, int64, *gitlab.EditGroupClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error)) *MockGroupClustersServiceInterfaceEditClusterCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupClustersServiceInterfaceEditClusterCall) DoAndReturn(f func(any, int, *gitlab.EditGroupClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error)) *MockGroupClustersServiceInterfaceEditClusterCall { +func (c *MockGroupClustersServiceInterfaceEditClusterCall) DoAndReturn(f func(any, int64, *gitlab.EditGroupClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error)) *MockGroupClustersServiceInterfaceEditClusterCall { c.Call = c.Call.DoAndReturn(f) return c } // GetCluster mocks base method. -func (m *MockGroupClustersServiceInterface) GetCluster(pid any, cluster int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error) { +func (m *MockGroupClustersServiceInterface) GetCluster(pid any, cluster int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, cluster} for _, a := range options { @@ -208,13 +208,13 @@ func (c *MockGroupClustersServiceInterfaceGetClusterCall) Return(arg0 *gitlab.Gr } // Do rewrite *gomock.Call.Do -func (c *MockGroupClustersServiceInterfaceGetClusterCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error)) *MockGroupClustersServiceInterfaceGetClusterCall { +func (c *MockGroupClustersServiceInterfaceGetClusterCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error)) *MockGroupClustersServiceInterfaceGetClusterCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupClustersServiceInterfaceGetClusterCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error)) *MockGroupClustersServiceInterfaceGetClusterCall { +func (c *MockGroupClustersServiceInterfaceGetClusterCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupCluster, *gitlab.Response, error)) *MockGroupClustersServiceInterfaceGetClusterCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/group_epic_boards_mock.go b/testing/group_epic_boards_mock.go index e838fddf..eb4e80dc 100644 --- a/testing/group_epic_boards_mock.go +++ b/testing/group_epic_boards_mock.go @@ -41,7 +41,7 @@ func (m *MockGroupEpicBoardsServiceInterface) EXPECT() *MockGroupEpicBoardsServi } // GetGroupEpicBoard mocks base method. -func (m *MockGroupEpicBoardsServiceInterface) GetGroupEpicBoard(gid any, board int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupEpicBoard, *gitlab.Response, error) { +func (m *MockGroupEpicBoardsServiceInterface) GetGroupEpicBoard(gid any, board int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupEpicBoard, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, board} for _, a := range options { @@ -74,13 +74,13 @@ func (c *MockGroupEpicBoardsServiceInterfaceGetGroupEpicBoardCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockGroupEpicBoardsServiceInterfaceGetGroupEpicBoardCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupEpicBoard, *gitlab.Response, error)) *MockGroupEpicBoardsServiceInterfaceGetGroupEpicBoardCall { +func (c *MockGroupEpicBoardsServiceInterfaceGetGroupEpicBoardCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupEpicBoard, *gitlab.Response, error)) *MockGroupEpicBoardsServiceInterfaceGetGroupEpicBoardCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupEpicBoardsServiceInterfaceGetGroupEpicBoardCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupEpicBoard, *gitlab.Response, error)) *MockGroupEpicBoardsServiceInterfaceGetGroupEpicBoardCall { +func (c *MockGroupEpicBoardsServiceInterfaceGetGroupEpicBoardCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupEpicBoard, *gitlab.Response, error)) *MockGroupEpicBoardsServiceInterfaceGetGroupEpicBoardCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/group_markdown_uploads_mock.go b/testing/group_markdown_uploads_mock.go index 71837766..3795524f 100644 --- a/testing/group_markdown_uploads_mock.go +++ b/testing/group_markdown_uploads_mock.go @@ -42,7 +42,7 @@ func (m *MockGroupMarkdownUploadsServiceInterface) EXPECT() *MockGroupMarkdownUp } // DeleteGroupMarkdownUploadByID mocks base method. -func (m *MockGroupMarkdownUploadsServiceInterface) DeleteGroupMarkdownUploadByID(gid any, uploadID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupMarkdownUploadsServiceInterface) DeleteGroupMarkdownUploadByID(gid any, uploadID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, uploadID} for _, a := range options { @@ -74,13 +74,13 @@ func (c *MockGroupMarkdownUploadsServiceInterfaceDeleteGroupMarkdownUploadByIDCa } // Do rewrite *gomock.Call.Do -func (c *MockGroupMarkdownUploadsServiceInterfaceDeleteGroupMarkdownUploadByIDCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMarkdownUploadsServiceInterfaceDeleteGroupMarkdownUploadByIDCall { +func (c *MockGroupMarkdownUploadsServiceInterfaceDeleteGroupMarkdownUploadByIDCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMarkdownUploadsServiceInterfaceDeleteGroupMarkdownUploadByIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMarkdownUploadsServiceInterfaceDeleteGroupMarkdownUploadByIDCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMarkdownUploadsServiceInterfaceDeleteGroupMarkdownUploadByIDCall { +func (c *MockGroupMarkdownUploadsServiceInterfaceDeleteGroupMarkdownUploadByIDCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMarkdownUploadsServiceInterfaceDeleteGroupMarkdownUploadByIDCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -130,7 +130,7 @@ func (c *MockGroupMarkdownUploadsServiceInterfaceDeleteGroupMarkdownUploadBySecr } // DownloadGroupMarkdownUploadByID mocks base method. -func (m *MockGroupMarkdownUploadsServiceInterface) DownloadGroupMarkdownUploadByID(gid any, uploadID int, options ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error) { +func (m *MockGroupMarkdownUploadsServiceInterface) DownloadGroupMarkdownUploadByID(gid any, uploadID int64, options ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, uploadID} for _, a := range options { @@ -163,13 +163,13 @@ func (c *MockGroupMarkdownUploadsServiceInterfaceDownloadGroupMarkdownUploadByID } // Do rewrite *gomock.Call.Do -func (c *MockGroupMarkdownUploadsServiceInterfaceDownloadGroupMarkdownUploadByIDCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockGroupMarkdownUploadsServiceInterfaceDownloadGroupMarkdownUploadByIDCall { +func (c *MockGroupMarkdownUploadsServiceInterfaceDownloadGroupMarkdownUploadByIDCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockGroupMarkdownUploadsServiceInterfaceDownloadGroupMarkdownUploadByIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMarkdownUploadsServiceInterfaceDownloadGroupMarkdownUploadByIDCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockGroupMarkdownUploadsServiceInterfaceDownloadGroupMarkdownUploadByIDCall { +func (c *MockGroupMarkdownUploadsServiceInterfaceDownloadGroupMarkdownUploadByIDCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockGroupMarkdownUploadsServiceInterfaceDownloadGroupMarkdownUploadByIDCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/group_members_mock.go b/testing/group_members_mock.go index 61c8a156..1fad3682 100644 --- a/testing/group_members_mock.go +++ b/testing/group_members_mock.go @@ -86,7 +86,7 @@ func (c *MockGroupMembersServiceInterfaceAddGroupMemberCall) DoAndReturn(f func( } // DeleteShareWithGroup mocks base method. -func (m *MockGroupMembersServiceInterface) DeleteShareWithGroup(gid any, groupID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupMembersServiceInterface) DeleteShareWithGroup(gid any, groupID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, groupID} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockGroupMembersServiceInterfaceDeleteShareWithGroupCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockGroupMembersServiceInterfaceDeleteShareWithGroupCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMembersServiceInterfaceDeleteShareWithGroupCall { +func (c *MockGroupMembersServiceInterfaceDeleteShareWithGroupCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMembersServiceInterfaceDeleteShareWithGroupCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMembersServiceInterfaceDeleteShareWithGroupCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMembersServiceInterfaceDeleteShareWithGroupCall { +func (c *MockGroupMembersServiceInterfaceDeleteShareWithGroupCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMembersServiceInterfaceDeleteShareWithGroupCall { c.Call = c.Call.DoAndReturn(f) return c } // EditGroupMember mocks base method. -func (m *MockGroupMembersServiceInterface) EditGroupMember(gid any, user int, opt *gitlab.EditGroupMemberOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error) { +func (m *MockGroupMembersServiceInterface) EditGroupMember(gid any, user int64, opt *gitlab.EditGroupMemberOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, user, opt} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockGroupMembersServiceInterfaceEditGroupMemberCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockGroupMembersServiceInterfaceEditGroupMemberCall) Do(f func(any, int, *gitlab.EditGroupMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceEditGroupMemberCall { +func (c *MockGroupMembersServiceInterfaceEditGroupMemberCall) Do(f func(any, int64, *gitlab.EditGroupMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceEditGroupMemberCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMembersServiceInterfaceEditGroupMemberCall) DoAndReturn(f func(any, int, *gitlab.EditGroupMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceEditGroupMemberCall { +func (c *MockGroupMembersServiceInterfaceEditGroupMemberCall) DoAndReturn(f func(any, int64, *gitlab.EditGroupMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceEditGroupMemberCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGroupMember mocks base method. -func (m *MockGroupMembersServiceInterface) GetGroupMember(gid any, user int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error) { +func (m *MockGroupMembersServiceInterface) GetGroupMember(gid any, user int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, user} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockGroupMembersServiceInterfaceGetGroupMemberCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockGroupMembersServiceInterfaceGetGroupMemberCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceGetGroupMemberCall { +func (c *MockGroupMembersServiceInterfaceGetGroupMemberCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceGetGroupMemberCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMembersServiceInterfaceGetGroupMemberCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceGetGroupMemberCall { +func (c *MockGroupMembersServiceInterfaceGetGroupMemberCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceGetGroupMemberCall { c.Call = c.Call.DoAndReturn(f) return c } // GetInheritedGroupMember mocks base method. -func (m *MockGroupMembersServiceInterface) GetInheritedGroupMember(gid any, user int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error) { +func (m *MockGroupMembersServiceInterface) GetInheritedGroupMember(gid any, user int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, user} for _, a := range options { @@ -253,19 +253,19 @@ func (c *MockGroupMembersServiceInterfaceGetInheritedGroupMemberCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockGroupMembersServiceInterfaceGetInheritedGroupMemberCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceGetInheritedGroupMemberCall { +func (c *MockGroupMembersServiceInterfaceGetInheritedGroupMemberCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceGetInheritedGroupMemberCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMembersServiceInterfaceGetInheritedGroupMemberCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceGetInheritedGroupMemberCall { +func (c *MockGroupMembersServiceInterfaceGetInheritedGroupMemberCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupMember, *gitlab.Response, error)) *MockGroupMembersServiceInterfaceGetInheritedGroupMemberCall { c.Call = c.Call.DoAndReturn(f) return c } // RemoveGroupMember mocks base method. -func (m *MockGroupMembersServiceInterface) RemoveGroupMember(gid any, user int, opt *gitlab.RemoveGroupMemberOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupMembersServiceInterface) RemoveGroupMember(gid any, user int64, opt *gitlab.RemoveGroupMemberOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, user, opt} for _, a := range options { @@ -297,13 +297,13 @@ func (c *MockGroupMembersServiceInterfaceRemoveGroupMemberCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockGroupMembersServiceInterfaceRemoveGroupMemberCall) Do(f func(any, int, *gitlab.RemoveGroupMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMembersServiceInterfaceRemoveGroupMemberCall { +func (c *MockGroupMembersServiceInterfaceRemoveGroupMemberCall) Do(f func(any, int64, *gitlab.RemoveGroupMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMembersServiceInterfaceRemoveGroupMemberCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMembersServiceInterfaceRemoveGroupMemberCall) DoAndReturn(f func(any, int, *gitlab.RemoveGroupMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMembersServiceInterfaceRemoveGroupMemberCall { +func (c *MockGroupMembersServiceInterfaceRemoveGroupMemberCall) DoAndReturn(f func(any, int64, *gitlab.RemoveGroupMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMembersServiceInterfaceRemoveGroupMemberCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/group_milestones_mock.go b/testing/group_milestones_mock.go index c137f522..01cc74fe 100644 --- a/testing/group_milestones_mock.go +++ b/testing/group_milestones_mock.go @@ -86,7 +86,7 @@ func (c *MockGroupMilestonesServiceInterfaceCreateGroupMilestoneCall) DoAndRetur } // DeleteGroupMilestone mocks base method. -func (m *MockGroupMilestonesServiceInterface) DeleteGroupMilestone(pid any, milestone int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupMilestonesServiceInterface) DeleteGroupMilestone(pid any, milestone int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, milestone} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockGroupMilestonesServiceInterfaceDeleteGroupMilestoneCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockGroupMilestonesServiceInterfaceDeleteGroupMilestoneCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceDeleteGroupMilestoneCall { +func (c *MockGroupMilestonesServiceInterfaceDeleteGroupMilestoneCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceDeleteGroupMilestoneCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMilestonesServiceInterfaceDeleteGroupMilestoneCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceDeleteGroupMilestoneCall { +func (c *MockGroupMilestonesServiceInterfaceDeleteGroupMilestoneCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceDeleteGroupMilestoneCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGroupMilestone mocks base method. -func (m *MockGroupMilestonesServiceInterface) GetGroupMilestone(gid any, milestone int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error) { +func (m *MockGroupMilestonesServiceInterface) GetGroupMilestone(gid any, milestone int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, milestone} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneCall { +func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneCall { +func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGroupMilestoneBurndownChartEvents mocks base method. -func (m *MockGroupMilestonesServiceInterface) GetGroupMilestoneBurndownChartEvents(gid any, milestone int, opt *gitlab.GetGroupMilestoneBurndownChartEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BurndownChartEvent, *gitlab.Response, error) { +func (m *MockGroupMilestonesServiceInterface) GetGroupMilestoneBurndownChartEvents(gid any, milestone int64, opt *gitlab.GetGroupMilestoneBurndownChartEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BurndownChartEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, milestone, opt} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneBurndownChartEvents } // Do rewrite *gomock.Call.Do -func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneBurndownChartEventsCall) Do(f func(any, int, *gitlab.GetGroupMilestoneBurndownChartEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BurndownChartEvent, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneBurndownChartEventsCall { +func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneBurndownChartEventsCall) Do(f func(any, int64, *gitlab.GetGroupMilestoneBurndownChartEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BurndownChartEvent, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneBurndownChartEventsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneBurndownChartEventsCall) DoAndReturn(f func(any, int, *gitlab.GetGroupMilestoneBurndownChartEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BurndownChartEvent, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneBurndownChartEventsCall { +func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneBurndownChartEventsCall) DoAndReturn(f func(any, int64, *gitlab.GetGroupMilestoneBurndownChartEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BurndownChartEvent, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneBurndownChartEventsCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGroupMilestoneIssues mocks base method. -func (m *MockGroupMilestonesServiceInterface) GetGroupMilestoneIssues(gid any, milestone int, opt *gitlab.GetGroupMilestoneIssuesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { +func (m *MockGroupMilestonesServiceInterface) GetGroupMilestoneIssues(gid any, milestone int64, opt *gitlab.GetGroupMilestoneIssuesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, milestone, opt} for _, a := range options { @@ -253,19 +253,19 @@ func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneIssuesCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneIssuesCall) Do(f func(any, int, *gitlab.GetGroupMilestoneIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneIssuesCall { +func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneIssuesCall) Do(f func(any, int64, *gitlab.GetGroupMilestoneIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneIssuesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneIssuesCall) DoAndReturn(f func(any, int, *gitlab.GetGroupMilestoneIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneIssuesCall { +func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneIssuesCall) DoAndReturn(f func(any, int64, *gitlab.GetGroupMilestoneIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneIssuesCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGroupMilestoneMergeRequests mocks base method. -func (m *MockGroupMilestonesServiceInterface) GetGroupMilestoneMergeRequests(gid any, milestone int, opt *gitlab.GetGroupMilestoneMergeRequestsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error) { +func (m *MockGroupMilestonesServiceInterface) GetGroupMilestoneMergeRequests(gid any, milestone int64, opt *gitlab.GetGroupMilestoneMergeRequestsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, milestone, opt} for _, a := range options { @@ -298,13 +298,13 @@ func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneMergeRequestsCall) } // Do rewrite *gomock.Call.Do -func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneMergeRequestsCall) Do(f func(any, int, *gitlab.GetGroupMilestoneMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneMergeRequestsCall { +func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneMergeRequestsCall) Do(f func(any, int64, *gitlab.GetGroupMilestoneMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneMergeRequestsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneMergeRequestsCall) DoAndReturn(f func(any, int, *gitlab.GetGroupMilestoneMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneMergeRequestsCall { +func (c *MockGroupMilestonesServiceInterfaceGetGroupMilestoneMergeRequestsCall) DoAndReturn(f func(any, int64, *gitlab.GetGroupMilestoneMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceGetGroupMilestoneMergeRequestsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -355,7 +355,7 @@ func (c *MockGroupMilestonesServiceInterfaceListGroupMilestonesCall) DoAndReturn } // UpdateGroupMilestone mocks base method. -func (m *MockGroupMilestonesServiceInterface) UpdateGroupMilestone(gid any, milestone int, opt *gitlab.UpdateGroupMilestoneOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error) { +func (m *MockGroupMilestonesServiceInterface) UpdateGroupMilestone(gid any, milestone int64, opt *gitlab.UpdateGroupMilestoneOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, milestone, opt} for _, a := range options { @@ -388,13 +388,13 @@ func (c *MockGroupMilestonesServiceInterfaceUpdateGroupMilestoneCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockGroupMilestonesServiceInterfaceUpdateGroupMilestoneCall) Do(f func(any, int, *gitlab.UpdateGroupMilestoneOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceUpdateGroupMilestoneCall { +func (c *MockGroupMilestonesServiceInterfaceUpdateGroupMilestoneCall) Do(f func(any, int64, *gitlab.UpdateGroupMilestoneOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceUpdateGroupMilestoneCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupMilestonesServiceInterfaceUpdateGroupMilestoneCall) DoAndReturn(f func(any, int, *gitlab.UpdateGroupMilestoneOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceUpdateGroupMilestoneCall { +func (c *MockGroupMilestonesServiceInterfaceUpdateGroupMilestoneCall) DoAndReturn(f func(any, int64, *gitlab.UpdateGroupMilestoneOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupMilestone, *gitlab.Response, error)) *MockGroupMilestonesServiceInterfaceUpdateGroupMilestoneCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/group_repository_storage_move_mock.go b/testing/group_repository_storage_move_mock.go index e505bc75..0191878f 100644 --- a/testing/group_repository_storage_move_mock.go +++ b/testing/group_repository_storage_move_mock.go @@ -41,7 +41,7 @@ func (m *MockGroupRepositoryStorageMoveServiceInterface) EXPECT() *MockGroupRepo } // GetStorageMove mocks base method. -func (m *MockGroupRepositoryStorageMoveServiceInterface) GetStorageMove(repositoryStorage int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockGroupRepositoryStorageMoveServiceInterface) GetStorageMove(repositoryStorage int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{repositoryStorage} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { +func (c *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { +func (c *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { c.Call = c.Call.DoAndReturn(f) return c } // GetStorageMoveForGroup mocks base method. -func (m *MockGroupRepositoryStorageMoveServiceInterface) GetStorageMoveForGroup(group, repositoryStorage int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockGroupRepositoryStorageMoveServiceInterface) GetStorageMoveForGroup(group, repositoryStorage int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{group, repositoryStorage} for _, a := range options { @@ -119,13 +119,13 @@ func (c *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveForGroupCal } // Do rewrite *gomock.Call.Do -func (c *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveForGroupCall) Do(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveForGroupCall { +func (c *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveForGroupCall) Do(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveForGroupCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveForGroupCall) DoAndReturn(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveForGroupCall { +func (c *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveForGroupCall) DoAndReturn(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceGetStorageMoveForGroupCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -176,7 +176,7 @@ func (c *MockGroupRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesCa } // RetrieveAllStorageMovesForGroup mocks base method. -func (m *MockGroupRepositoryStorageMoveServiceInterface) RetrieveAllStorageMovesForGroup(group int, opts gitlab.RetrieveAllGroupStorageMovesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockGroupRepositoryStorageMoveServiceInterface) RetrieveAllStorageMovesForGroup(group int64, opts gitlab.RetrieveAllGroupStorageMovesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{group, opts} for _, a := range options { @@ -209,13 +209,13 @@ func (c *MockGroupRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesFo } // Do rewrite *gomock.Call.Do -func (c *MockGroupRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForGroupCall) Do(f func(int, gitlab.RetrieveAllGroupStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForGroupCall { +func (c *MockGroupRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForGroupCall) Do(f func(int64, gitlab.RetrieveAllGroupStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForGroupCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForGroupCall) DoAndReturn(f func(int, gitlab.RetrieveAllGroupStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForGroupCall { +func (c *MockGroupRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForGroupCall) DoAndReturn(f func(int64, gitlab.RetrieveAllGroupStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForGroupCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -265,7 +265,7 @@ func (c *MockGroupRepositoryStorageMoveServiceInterfaceScheduleAllStorageMovesCa } // ScheduleStorageMoveForGroup mocks base method. -func (m *MockGroupRepositoryStorageMoveServiceInterface) ScheduleStorageMoveForGroup(group int, opts gitlab.ScheduleStorageMoveForGroupOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockGroupRepositoryStorageMoveServiceInterface) ScheduleStorageMoveForGroup(group int64, opts gitlab.ScheduleStorageMoveForGroupOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{group, opts} for _, a := range options { @@ -298,13 +298,13 @@ func (c *MockGroupRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForGro } // Do rewrite *gomock.Call.Do -func (c *MockGroupRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForGroupCall) Do(f func(int, gitlab.ScheduleStorageMoveForGroupOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForGroupCall { +func (c *MockGroupRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForGroupCall) Do(f func(int64, gitlab.ScheduleStorageMoveForGroupOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForGroupCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForGroupCall) DoAndReturn(f func(int, gitlab.ScheduleStorageMoveForGroupOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForGroupCall { +func (c *MockGroupRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForGroupCall) DoAndReturn(f func(int64, gitlab.ScheduleStorageMoveForGroupOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupRepositoryStorageMove, *gitlab.Response, error)) *MockGroupRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForGroupCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/group_ssh_certificates_mock.go b/testing/group_ssh_certificates_mock.go index 3fa3ad7f..7dfd8a7e 100644 --- a/testing/group_ssh_certificates_mock.go +++ b/testing/group_ssh_certificates_mock.go @@ -86,7 +86,7 @@ func (c *MockGroupSSHCertificatesServiceInterfaceCreateGroupSSHCertificateCall) } // DeleteGroupSSHCertificate mocks base method. -func (m *MockGroupSSHCertificatesServiceInterface) DeleteGroupSSHCertificate(gid any, cert int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupSSHCertificatesServiceInterface) DeleteGroupSSHCertificate(gid any, cert int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, cert} for _, a := range options { @@ -118,13 +118,13 @@ func (c *MockGroupSSHCertificatesServiceInterfaceDeleteGroupSSHCertificateCall) } // Do rewrite *gomock.Call.Do -func (c *MockGroupSSHCertificatesServiceInterfaceDeleteGroupSSHCertificateCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupSSHCertificatesServiceInterfaceDeleteGroupSSHCertificateCall { +func (c *MockGroupSSHCertificatesServiceInterfaceDeleteGroupSSHCertificateCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupSSHCertificatesServiceInterfaceDeleteGroupSSHCertificateCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupSSHCertificatesServiceInterfaceDeleteGroupSSHCertificateCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupSSHCertificatesServiceInterfaceDeleteGroupSSHCertificateCall { +func (c *MockGroupSSHCertificatesServiceInterfaceDeleteGroupSSHCertificateCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupSSHCertificatesServiceInterfaceDeleteGroupSSHCertificateCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/groups_mock.go b/testing/groups_mock.go index 6ac176b9..afd88c4a 100644 --- a/testing/groups_mock.go +++ b/testing/groups_mock.go @@ -313,7 +313,7 @@ func (c *MockGroupsServiceInterfaceCreateServiceAccountCall) DoAndReturn(f func( } // CreateServiceAccountPersonalAccessToken mocks base method. -func (m *MockGroupsServiceInterface) CreateServiceAccountPersonalAccessToken(gid any, serviceAccount int, opt *gitlab.CreateServiceAccountPersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { +func (m *MockGroupsServiceInterface) CreateServiceAccountPersonalAccessToken(gid any, serviceAccount int64, opt *gitlab.CreateServiceAccountPersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, serviceAccount, opt} for _, a := range options { @@ -346,13 +346,13 @@ func (c *MockGroupsServiceInterfaceCreateServiceAccountPersonalAccessTokenCall) } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceCreateServiceAccountPersonalAccessTokenCall) Do(f func(any, int, *gitlab.CreateServiceAccountPersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceCreateServiceAccountPersonalAccessTokenCall { +func (c *MockGroupsServiceInterfaceCreateServiceAccountPersonalAccessTokenCall) Do(f func(any, int64, *gitlab.CreateServiceAccountPersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceCreateServiceAccountPersonalAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceCreateServiceAccountPersonalAccessTokenCall) DoAndReturn(f func(any, int, *gitlab.CreateServiceAccountPersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceCreateServiceAccountPersonalAccessTokenCall { +func (c *MockGroupsServiceInterfaceCreateServiceAccountPersonalAccessTokenCall) DoAndReturn(f func(any, int64, *gitlab.CreateServiceAccountPersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceCreateServiceAccountPersonalAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -402,7 +402,7 @@ func (c *MockGroupsServiceInterfaceDeleteGroupCall) DoAndReturn(f func(any, *git } // DeleteGroupCustomHeader mocks base method. -func (m *MockGroupsServiceInterface) DeleteGroupCustomHeader(gid any, hook int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) DeleteGroupCustomHeader(gid any, hook int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, hook, key} for _, a := range options { @@ -434,19 +434,19 @@ func (c *MockGroupsServiceInterfaceDeleteGroupCustomHeaderCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceDeleteGroupCustomHeaderCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupCustomHeaderCall { +func (c *MockGroupsServiceInterfaceDeleteGroupCustomHeaderCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupCustomHeaderCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceDeleteGroupCustomHeaderCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupCustomHeaderCall { +func (c *MockGroupsServiceInterfaceDeleteGroupCustomHeaderCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupCustomHeaderCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteGroupHook mocks base method. -func (m *MockGroupsServiceInterface) DeleteGroupHook(gid any, hook int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) DeleteGroupHook(gid any, hook int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, hook} for _, a := range options { @@ -478,19 +478,19 @@ func (c *MockGroupsServiceInterfaceDeleteGroupHookCall) Return(arg0 *gitlab.Resp } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceDeleteGroupHookCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupHookCall { +func (c *MockGroupsServiceInterfaceDeleteGroupHookCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceDeleteGroupHookCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupHookCall { +func (c *MockGroupsServiceInterfaceDeleteGroupHookCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupHookCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteGroupHookURLVariable mocks base method. -func (m *MockGroupsServiceInterface) DeleteGroupHookURLVariable(gid any, hook int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) DeleteGroupHookURLVariable(gid any, hook int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, hook, key} for _, a := range options { @@ -522,13 +522,13 @@ func (c *MockGroupsServiceInterfaceDeleteGroupHookURLVariableCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceDeleteGroupHookURLVariableCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupHookURLVariableCall { +func (c *MockGroupsServiceInterfaceDeleteGroupHookURLVariableCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupHookURLVariableCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceDeleteGroupHookURLVariableCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupHookURLVariableCall { +func (c *MockGroupsServiceInterfaceDeleteGroupHookURLVariableCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteGroupHookURLVariableCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -754,7 +754,7 @@ func (c *MockGroupsServiceInterfaceDeleteGroupSAMLLinkCall) DoAndReturn(f func(a } // DeleteServiceAccount mocks base method. -func (m *MockGroupsServiceInterface) DeleteServiceAccount(gid any, serviceAccount int, opt *gitlab.DeleteServiceAccountOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) DeleteServiceAccount(gid any, serviceAccount int64, opt *gitlab.DeleteServiceAccountOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, serviceAccount, opt} for _, a := range options { @@ -786,13 +786,13 @@ func (c *MockGroupsServiceInterfaceDeleteServiceAccountCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceDeleteServiceAccountCall) Do(f func(any, int, *gitlab.DeleteServiceAccountOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteServiceAccountCall { +func (c *MockGroupsServiceInterfaceDeleteServiceAccountCall) Do(f func(any, int64, *gitlab.DeleteServiceAccountOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteServiceAccountCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceDeleteServiceAccountCall) DoAndReturn(f func(any, int, *gitlab.DeleteServiceAccountOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteServiceAccountCall { +func (c *MockGroupsServiceInterfaceDeleteServiceAccountCall) DoAndReturn(f func(any, int64, *gitlab.DeleteServiceAccountOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceDeleteServiceAccountCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -843,7 +843,7 @@ func (c *MockGroupsServiceInterfaceDownloadAvatarCall) DoAndReturn(f func(any, . } // EditGroupHook mocks base method. -func (m *MockGroupsServiceInterface) EditGroupHook(gid any, hook int, opt *gitlab.EditGroupHookOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error) { +func (m *MockGroupsServiceInterface) EditGroupHook(gid any, hook int64, opt *gitlab.EditGroupHookOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, hook, opt} for _, a := range options { @@ -876,13 +876,13 @@ func (c *MockGroupsServiceInterfaceEditGroupHookCall) Return(arg0 *gitlab.GroupH } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceEditGroupHookCall) Do(f func(any, int, *gitlab.EditGroupHookOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error)) *MockGroupsServiceInterfaceEditGroupHookCall { +func (c *MockGroupsServiceInterfaceEditGroupHookCall) Do(f func(any, int64, *gitlab.EditGroupHookOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error)) *MockGroupsServiceInterfaceEditGroupHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceEditGroupHookCall) DoAndReturn(f func(any, int, *gitlab.EditGroupHookOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error)) *MockGroupsServiceInterfaceEditGroupHookCall { +func (c *MockGroupsServiceInterfaceEditGroupHookCall) DoAndReturn(f func(any, int64, *gitlab.EditGroupHookOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error)) *MockGroupsServiceInterfaceEditGroupHookCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -978,7 +978,7 @@ func (c *MockGroupsServiceInterfaceGetGroupCall) DoAndReturn(f func(any, *gitlab } // GetGroupHook mocks base method. -func (m *MockGroupsServiceInterface) GetGroupHook(gid any, hook int, options ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error) { +func (m *MockGroupsServiceInterface) GetGroupHook(gid any, hook int64, options ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, hook} for _, a := range options { @@ -1011,13 +1011,13 @@ func (c *MockGroupsServiceInterfaceGetGroupHookCall) Return(arg0 *gitlab.GroupHo } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceGetGroupHookCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error)) *MockGroupsServiceInterfaceGetGroupHookCall { +func (c *MockGroupsServiceInterfaceGetGroupHookCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error)) *MockGroupsServiceInterfaceGetGroupHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceGetGroupHookCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error)) *MockGroupsServiceInterfaceGetGroupHookCall { +func (c *MockGroupsServiceInterfaceGetGroupHookCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.GroupHook, *gitlab.Response, error)) *MockGroupsServiceInterfaceGetGroupHookCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1563,7 +1563,7 @@ func (c *MockGroupsServiceInterfaceListGroupsCall) DoAndReturn(f func(*gitlab.Li } // ListMembershipsForBillableGroupMember mocks base method. -func (m *MockGroupsServiceInterface) ListMembershipsForBillableGroupMember(gid any, user int, opt *gitlab.ListMembershipsForBillableGroupMemberOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BillableUserMembership, *gitlab.Response, error) { +func (m *MockGroupsServiceInterface) ListMembershipsForBillableGroupMember(gid any, user int64, opt *gitlab.ListMembershipsForBillableGroupMemberOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BillableUserMembership, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, user, opt} for _, a := range options { @@ -1596,13 +1596,13 @@ func (c *MockGroupsServiceInterfaceListMembershipsForBillableGroupMemberCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceListMembershipsForBillableGroupMemberCall) Do(f func(any, int, *gitlab.ListMembershipsForBillableGroupMemberOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BillableUserMembership, *gitlab.Response, error)) *MockGroupsServiceInterfaceListMembershipsForBillableGroupMemberCall { +func (c *MockGroupsServiceInterfaceListMembershipsForBillableGroupMemberCall) Do(f func(any, int64, *gitlab.ListMembershipsForBillableGroupMemberOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BillableUserMembership, *gitlab.Response, error)) *MockGroupsServiceInterfaceListMembershipsForBillableGroupMemberCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceListMembershipsForBillableGroupMemberCall) DoAndReturn(f func(any, int, *gitlab.ListMembershipsForBillableGroupMemberOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BillableUserMembership, *gitlab.Response, error)) *MockGroupsServiceInterfaceListMembershipsForBillableGroupMemberCall { +func (c *MockGroupsServiceInterfaceListMembershipsForBillableGroupMemberCall) DoAndReturn(f func(any, int64, *gitlab.ListMembershipsForBillableGroupMemberOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BillableUserMembership, *gitlab.Response, error)) *MockGroupsServiceInterfaceListMembershipsForBillableGroupMemberCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1653,7 +1653,7 @@ func (c *MockGroupsServiceInterfaceListProvisionedUsersCall) DoAndReturn(f func( } // ListServiceAccountPersonalAccessTokens mocks base method. -func (m *MockGroupsServiceInterface) ListServiceAccountPersonalAccessTokens(gid any, serviceAccount int, opt *gitlab.ListServiceAccountPersonalAccessTokensOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.PersonalAccessToken, *gitlab.Response, error) { +func (m *MockGroupsServiceInterface) ListServiceAccountPersonalAccessTokens(gid any, serviceAccount int64, opt *gitlab.ListServiceAccountPersonalAccessTokensOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.PersonalAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, serviceAccount, opt} for _, a := range options { @@ -1686,13 +1686,13 @@ func (c *MockGroupsServiceInterfaceListServiceAccountPersonalAccessTokensCall) R } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceListServiceAccountPersonalAccessTokensCall) Do(f func(any, int, *gitlab.ListServiceAccountPersonalAccessTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceListServiceAccountPersonalAccessTokensCall { +func (c *MockGroupsServiceInterfaceListServiceAccountPersonalAccessTokensCall) Do(f func(any, int64, *gitlab.ListServiceAccountPersonalAccessTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceListServiceAccountPersonalAccessTokensCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceListServiceAccountPersonalAccessTokensCall) DoAndReturn(f func(any, int, *gitlab.ListServiceAccountPersonalAccessTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceListServiceAccountPersonalAccessTokensCall { +func (c *MockGroupsServiceInterfaceListServiceAccountPersonalAccessTokensCall) DoAndReturn(f func(any, int64, *gitlab.ListServiceAccountPersonalAccessTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceListServiceAccountPersonalAccessTokensCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1788,7 +1788,7 @@ func (c *MockGroupsServiceInterfaceListSubGroupsCall) DoAndReturn(f func(any, *g } // RemoveBillableGroupMember mocks base method. -func (m *MockGroupsServiceInterface) RemoveBillableGroupMember(gid any, user int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) RemoveBillableGroupMember(gid any, user int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, user} for _, a := range options { @@ -1820,19 +1820,19 @@ func (c *MockGroupsServiceInterfaceRemoveBillableGroupMemberCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceRemoveBillableGroupMemberCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceRemoveBillableGroupMemberCall { +func (c *MockGroupsServiceInterfaceRemoveBillableGroupMemberCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceRemoveBillableGroupMemberCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceRemoveBillableGroupMemberCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceRemoveBillableGroupMemberCall { +func (c *MockGroupsServiceInterfaceRemoveBillableGroupMemberCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceRemoveBillableGroupMemberCall { c.Call = c.Call.DoAndReturn(f) return c } // ResendGroupHookEvent mocks base method. -func (m *MockGroupsServiceInterface) ResendGroupHookEvent(gid any, hook, hookEventID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) ResendGroupHookEvent(gid any, hook, hookEventID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, hook, hookEventID} for _, a := range options { @@ -1864,13 +1864,13 @@ func (c *MockGroupsServiceInterfaceResendGroupHookEventCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceResendGroupHookEventCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceResendGroupHookEventCall { +func (c *MockGroupsServiceInterfaceResendGroupHookEventCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceResendGroupHookEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceResendGroupHookEventCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceResendGroupHookEventCall { +func (c *MockGroupsServiceInterfaceResendGroupHookEventCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceResendGroupHookEventCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1921,7 +1921,7 @@ func (c *MockGroupsServiceInterfaceRestoreGroupCall) DoAndReturn(f func(any, ... } // RevokeServiceAccountPersonalAccessToken mocks base method. -func (m *MockGroupsServiceInterface) RevokeServiceAccountPersonalAccessToken(gid any, serviceAccount, token int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) RevokeServiceAccountPersonalAccessToken(gid any, serviceAccount, token int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, serviceAccount, token} for _, a := range options { @@ -1953,19 +1953,19 @@ func (c *MockGroupsServiceInterfaceRevokeServiceAccountPersonalAccessTokenCall) } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceRevokeServiceAccountPersonalAccessTokenCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceRevokeServiceAccountPersonalAccessTokenCall { +func (c *MockGroupsServiceInterfaceRevokeServiceAccountPersonalAccessTokenCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceRevokeServiceAccountPersonalAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceRevokeServiceAccountPersonalAccessTokenCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceRevokeServiceAccountPersonalAccessTokenCall { +func (c *MockGroupsServiceInterfaceRevokeServiceAccountPersonalAccessTokenCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceRevokeServiceAccountPersonalAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // RotateServiceAccountPersonalAccessToken mocks base method. -func (m *MockGroupsServiceInterface) RotateServiceAccountPersonalAccessToken(gid any, serviceAccount, token int, opt *gitlab.RotateServiceAccountPersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { +func (m *MockGroupsServiceInterface) RotateServiceAccountPersonalAccessToken(gid any, serviceAccount, token int64, opt *gitlab.RotateServiceAccountPersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, serviceAccount, token, opt} for _, a := range options { @@ -1998,13 +1998,13 @@ func (c *MockGroupsServiceInterfaceRotateServiceAccountPersonalAccessTokenCall) } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceRotateServiceAccountPersonalAccessTokenCall) Do(f func(any, int, int, *gitlab.RotateServiceAccountPersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceRotateServiceAccountPersonalAccessTokenCall { +func (c *MockGroupsServiceInterfaceRotateServiceAccountPersonalAccessTokenCall) Do(f func(any, int64, int64, *gitlab.RotateServiceAccountPersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceRotateServiceAccountPersonalAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceRotateServiceAccountPersonalAccessTokenCall) DoAndReturn(f func(any, int, int, *gitlab.RotateServiceAccountPersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceRotateServiceAccountPersonalAccessTokenCall { +func (c *MockGroupsServiceInterfaceRotateServiceAccountPersonalAccessTokenCall) DoAndReturn(f func(any, int64, int64, *gitlab.RotateServiceAccountPersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockGroupsServiceInterfaceRotateServiceAccountPersonalAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -2055,7 +2055,7 @@ func (c *MockGroupsServiceInterfaceSearchGroupCall) DoAndReturn(f func(string, . } // SetGroupCustomHeader mocks base method. -func (m *MockGroupsServiceInterface) SetGroupCustomHeader(gid any, hook int, key string, opt *gitlab.SetHookCustomHeaderOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) SetGroupCustomHeader(gid any, hook int64, key string, opt *gitlab.SetHookCustomHeaderOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, hook, key, opt} for _, a := range options { @@ -2087,19 +2087,19 @@ func (c *MockGroupsServiceInterfaceSetGroupCustomHeaderCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceSetGroupCustomHeaderCall) Do(f func(any, int, string, *gitlab.SetHookCustomHeaderOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceSetGroupCustomHeaderCall { +func (c *MockGroupsServiceInterfaceSetGroupCustomHeaderCall) Do(f func(any, int64, string, *gitlab.SetHookCustomHeaderOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceSetGroupCustomHeaderCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceSetGroupCustomHeaderCall) DoAndReturn(f func(any, int, string, *gitlab.SetHookCustomHeaderOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceSetGroupCustomHeaderCall { +func (c *MockGroupsServiceInterfaceSetGroupCustomHeaderCall) DoAndReturn(f func(any, int64, string, *gitlab.SetHookCustomHeaderOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceSetGroupCustomHeaderCall { c.Call = c.Call.DoAndReturn(f) return c } // SetGroupHookURLVariable mocks base method. -func (m *MockGroupsServiceInterface) SetGroupHookURLVariable(gid any, hook int, key string, opt *gitlab.SetHookURLVariableOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) SetGroupHookURLVariable(gid any, hook int64, key string, opt *gitlab.SetHookURLVariableOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, hook, key, opt} for _, a := range options { @@ -2131,13 +2131,13 @@ func (c *MockGroupsServiceInterfaceSetGroupHookURLVariableCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceSetGroupHookURLVariableCall) Do(f func(any, int, string, *gitlab.SetHookURLVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceSetGroupHookURLVariableCall { +func (c *MockGroupsServiceInterfaceSetGroupHookURLVariableCall) Do(f func(any, int64, string, *gitlab.SetHookURLVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceSetGroupHookURLVariableCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceSetGroupHookURLVariableCall) DoAndReturn(f func(any, int, string, *gitlab.SetHookURLVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceSetGroupHookURLVariableCall { +func (c *MockGroupsServiceInterfaceSetGroupHookURLVariableCall) DoAndReturn(f func(any, int64, string, *gitlab.SetHookURLVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceSetGroupHookURLVariableCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -2278,7 +2278,7 @@ func (c *MockGroupsServiceInterfaceTransferSubGroupCall) DoAndReturn(f func(any, } // TriggerTestGroupHook mocks base method. -func (m *MockGroupsServiceInterface) TriggerTestGroupHook(pid any, hook int, trigger gitlab.GroupHookTrigger, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) TriggerTestGroupHook(pid any, hook int64, trigger gitlab.GroupHookTrigger, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, hook, trigger} for _, a := range options { @@ -2310,19 +2310,19 @@ func (c *MockGroupsServiceInterfaceTriggerTestGroupHookCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceTriggerTestGroupHookCall) Do(f func(any, int, gitlab.GroupHookTrigger, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceTriggerTestGroupHookCall { +func (c *MockGroupsServiceInterfaceTriggerTestGroupHookCall) Do(f func(any, int64, gitlab.GroupHookTrigger, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceTriggerTestGroupHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceTriggerTestGroupHookCall) DoAndReturn(f func(any, int, gitlab.GroupHookTrigger, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceTriggerTestGroupHookCall { +func (c *MockGroupsServiceInterfaceTriggerTestGroupHookCall) DoAndReturn(f func(any, int64, gitlab.GroupHookTrigger, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceTriggerTestGroupHookCall { c.Call = c.Call.DoAndReturn(f) return c } // UnshareGroupFromGroup mocks base method. -func (m *MockGroupsServiceInterface) UnshareGroupFromGroup(gid any, groupID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockGroupsServiceInterface) UnshareGroupFromGroup(gid any, groupID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, groupID} for _, a := range options { @@ -2354,13 +2354,13 @@ func (c *MockGroupsServiceInterfaceUnshareGroupFromGroupCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceUnshareGroupFromGroupCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceUnshareGroupFromGroupCall { +func (c *MockGroupsServiceInterfaceUnshareGroupFromGroupCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceUnshareGroupFromGroupCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceUnshareGroupFromGroupCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceUnshareGroupFromGroupCall { +func (c *MockGroupsServiceInterfaceUnshareGroupFromGroupCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockGroupsServiceInterfaceUnshareGroupFromGroupCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -2411,7 +2411,7 @@ func (c *MockGroupsServiceInterfaceUpdateGroupCall) DoAndReturn(f func(any, *git } // UpdateServiceAccount mocks base method. -func (m *MockGroupsServiceInterface) UpdateServiceAccount(gid any, serviceAccount int, opt *gitlab.UpdateServiceAccountOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupServiceAccount, *gitlab.Response, error) { +func (m *MockGroupsServiceInterface) UpdateServiceAccount(gid any, serviceAccount int64, opt *gitlab.UpdateServiceAccountOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GroupServiceAccount, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, serviceAccount, opt} for _, a := range options { @@ -2444,13 +2444,13 @@ func (c *MockGroupsServiceInterfaceUpdateServiceAccountCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockGroupsServiceInterfaceUpdateServiceAccountCall) Do(f func(any, int, *gitlab.UpdateServiceAccountOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupServiceAccount, *gitlab.Response, error)) *MockGroupsServiceInterfaceUpdateServiceAccountCall { +func (c *MockGroupsServiceInterfaceUpdateServiceAccountCall) Do(f func(any, int64, *gitlab.UpdateServiceAccountOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupServiceAccount, *gitlab.Response, error)) *MockGroupsServiceInterfaceUpdateServiceAccountCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockGroupsServiceInterfaceUpdateServiceAccountCall) DoAndReturn(f func(any, int, *gitlab.UpdateServiceAccountOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupServiceAccount, *gitlab.Response, error)) *MockGroupsServiceInterfaceUpdateServiceAccountCall { +func (c *MockGroupsServiceInterfaceUpdateServiceAccountCall) DoAndReturn(f func(any, int64, *gitlab.UpdateServiceAccountOptions, ...gitlab.RequestOptionFunc) (*gitlab.GroupServiceAccount, *gitlab.Response, error)) *MockGroupsServiceInterfaceUpdateServiceAccountCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/instance_clusters_mock.go b/testing/instance_clusters_mock.go index 097a79f6..fdfeabc4 100644 --- a/testing/instance_clusters_mock.go +++ b/testing/instance_clusters_mock.go @@ -86,7 +86,7 @@ func (c *MockInstanceClustersServiceInterfaceAddClusterCall) DoAndReturn(f func( } // DeleteCluster mocks base method. -func (m *MockInstanceClustersServiceInterface) DeleteCluster(cluster int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockInstanceClustersServiceInterface) DeleteCluster(cluster int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{cluster} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockInstanceClustersServiceInterfaceDeleteClusterCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockInstanceClustersServiceInterfaceDeleteClusterCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockInstanceClustersServiceInterfaceDeleteClusterCall { +func (c *MockInstanceClustersServiceInterfaceDeleteClusterCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockInstanceClustersServiceInterfaceDeleteClusterCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockInstanceClustersServiceInterfaceDeleteClusterCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockInstanceClustersServiceInterfaceDeleteClusterCall { +func (c *MockInstanceClustersServiceInterfaceDeleteClusterCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockInstanceClustersServiceInterfaceDeleteClusterCall { c.Call = c.Call.DoAndReturn(f) return c } // EditCluster mocks base method. -func (m *MockInstanceClustersServiceInterface) EditCluster(cluster int, opt *gitlab.EditClusterOptions, options ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error) { +func (m *MockInstanceClustersServiceInterface) EditCluster(cluster int64, opt *gitlab.EditClusterOptions, options ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{cluster, opt} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockInstanceClustersServiceInterfaceEditClusterCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockInstanceClustersServiceInterfaceEditClusterCall) Do(f func(int, *gitlab.EditClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error)) *MockInstanceClustersServiceInterfaceEditClusterCall { +func (c *MockInstanceClustersServiceInterfaceEditClusterCall) Do(f func(int64, *gitlab.EditClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error)) *MockInstanceClustersServiceInterfaceEditClusterCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockInstanceClustersServiceInterfaceEditClusterCall) DoAndReturn(f func(int, *gitlab.EditClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error)) *MockInstanceClustersServiceInterfaceEditClusterCall { +func (c *MockInstanceClustersServiceInterfaceEditClusterCall) DoAndReturn(f func(int64, *gitlab.EditClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error)) *MockInstanceClustersServiceInterfaceEditClusterCall { c.Call = c.Call.DoAndReturn(f) return c } // GetCluster mocks base method. -func (m *MockInstanceClustersServiceInterface) GetCluster(cluster int, options ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error) { +func (m *MockInstanceClustersServiceInterface) GetCluster(cluster int64, options ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{cluster} for _, a := range options { @@ -208,13 +208,13 @@ func (c *MockInstanceClustersServiceInterfaceGetClusterCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockInstanceClustersServiceInterfaceGetClusterCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error)) *MockInstanceClustersServiceInterfaceGetClusterCall { +func (c *MockInstanceClustersServiceInterfaceGetClusterCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error)) *MockInstanceClustersServiceInterfaceGetClusterCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockInstanceClustersServiceInterfaceGetClusterCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error)) *MockInstanceClustersServiceInterfaceGetClusterCall { +func (c *MockInstanceClustersServiceInterfaceGetClusterCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.InstanceCluster, *gitlab.Response, error)) *MockInstanceClustersServiceInterfaceGetClusterCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/issue_links_mock.go b/testing/issue_links_mock.go index 6b22ab0a..915a9426 100644 --- a/testing/issue_links_mock.go +++ b/testing/issue_links_mock.go @@ -41,7 +41,7 @@ func (m *MockIssueLinksServiceInterface) EXPECT() *MockIssueLinksServiceInterfac } // CreateIssueLink mocks base method. -func (m *MockIssueLinksServiceInterface) CreateIssueLink(pid any, issue int, opt *gitlab.CreateIssueLinkOptions, options ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error) { +func (m *MockIssueLinksServiceInterface) CreateIssueLink(pid any, issue int64, opt *gitlab.CreateIssueLinkOptions, options ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockIssueLinksServiceInterfaceCreateIssueLinkCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockIssueLinksServiceInterfaceCreateIssueLinkCall) Do(f func(any, int, *gitlab.CreateIssueLinkOptions, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceCreateIssueLinkCall { +func (c *MockIssueLinksServiceInterfaceCreateIssueLinkCall) Do(f func(any, int64, *gitlab.CreateIssueLinkOptions, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceCreateIssueLinkCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueLinksServiceInterfaceCreateIssueLinkCall) DoAndReturn(f func(any, int, *gitlab.CreateIssueLinkOptions, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceCreateIssueLinkCall { +func (c *MockIssueLinksServiceInterfaceCreateIssueLinkCall) DoAndReturn(f func(any, int64, *gitlab.CreateIssueLinkOptions, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceCreateIssueLinkCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteIssueLink mocks base method. -func (m *MockIssueLinksServiceInterface) DeleteIssueLink(pid any, issue, issueLink int, options ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error) { +func (m *MockIssueLinksServiceInterface) DeleteIssueLink(pid any, issue, issueLink int64, options ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, issueLink} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockIssueLinksServiceInterfaceDeleteIssueLinkCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockIssueLinksServiceInterfaceDeleteIssueLinkCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceDeleteIssueLinkCall { +func (c *MockIssueLinksServiceInterfaceDeleteIssueLinkCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceDeleteIssueLinkCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueLinksServiceInterfaceDeleteIssueLinkCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceDeleteIssueLinkCall { +func (c *MockIssueLinksServiceInterfaceDeleteIssueLinkCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceDeleteIssueLinkCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssueLink mocks base method. -func (m *MockIssueLinksServiceInterface) GetIssueLink(pid any, issue, issueLink int, options ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error) { +func (m *MockIssueLinksServiceInterface) GetIssueLink(pid any, issue, issueLink int64, options ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, issueLink} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockIssueLinksServiceInterfaceGetIssueLinkCall) Return(arg0 *gitlab.Iss } // Do rewrite *gomock.Call.Do -func (c *MockIssueLinksServiceInterfaceGetIssueLinkCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceGetIssueLinkCall { +func (c *MockIssueLinksServiceInterfaceGetIssueLinkCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceGetIssueLinkCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueLinksServiceInterfaceGetIssueLinkCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceGetIssueLinkCall { +func (c *MockIssueLinksServiceInterfaceGetIssueLinkCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.IssueLink, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceGetIssueLinkCall { c.Call = c.Call.DoAndReturn(f) return c } // ListIssueRelations mocks base method. -func (m *MockIssueLinksServiceInterface) ListIssueRelations(pid any, issue int, options ...gitlab.RequestOptionFunc) ([]*gitlab.IssueRelation, *gitlab.Response, error) { +func (m *MockIssueLinksServiceInterface) ListIssueRelations(pid any, issue int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.IssueRelation, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue} for _, a := range options { @@ -209,13 +209,13 @@ func (c *MockIssueLinksServiceInterfaceListIssueRelationsCall) Return(arg0 []*gi } // Do rewrite *gomock.Call.Do -func (c *MockIssueLinksServiceInterfaceListIssueRelationsCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.IssueRelation, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceListIssueRelationsCall { +func (c *MockIssueLinksServiceInterfaceListIssueRelationsCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.IssueRelation, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceListIssueRelationsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssueLinksServiceInterfaceListIssueRelationsCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.IssueRelation, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceListIssueRelationsCall { +func (c *MockIssueLinksServiceInterfaceListIssueRelationsCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.IssueRelation, *gitlab.Response, error)) *MockIssueLinksServiceInterfaceListIssueRelationsCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/issues_mock.go b/testing/issues_mock.go index ca1e62b7..d4bbf426 100644 --- a/testing/issues_mock.go +++ b/testing/issues_mock.go @@ -41,7 +41,7 @@ func (m *MockIssuesServiceInterface) EXPECT() *MockIssuesServiceInterfaceMockRec } // AddSpentTime mocks base method. -func (m *MockIssuesServiceInterface) AddSpentTime(pid any, issue int, opt *gitlab.AddSpentTimeOptions, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) AddSpentTime(pid any, issue int64, opt *gitlab.AddSpentTimeOptions, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -74,13 +74,13 @@ func (c *MockIssuesServiceInterfaceAddSpentTimeCall) Return(arg0 *gitlab.TimeSta } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceAddSpentTimeCall) Do(f func(any, int, *gitlab.AddSpentTimeOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceAddSpentTimeCall { +func (c *MockIssuesServiceInterfaceAddSpentTimeCall) Do(f func(any, int64, *gitlab.AddSpentTimeOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceAddSpentTimeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceAddSpentTimeCall) DoAndReturn(f func(any, int, *gitlab.AddSpentTimeOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceAddSpentTimeCall { +func (c *MockIssuesServiceInterfaceAddSpentTimeCall) DoAndReturn(f func(any, int64, *gitlab.AddSpentTimeOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceAddSpentTimeCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -131,7 +131,7 @@ func (c *MockIssuesServiceInterfaceCreateIssueCall) DoAndReturn(f func(any, *git } // CreateTodo mocks base method. -func (m *MockIssuesServiceInterface) CreateTodo(pid any, issue int, options ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) CreateTodo(pid any, issue int64, options ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockIssuesServiceInterfaceCreateTodoCall) Return(arg0 *gitlab.Todo, arg } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceCreateTodoCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error)) *MockIssuesServiceInterfaceCreateTodoCall { +func (c *MockIssuesServiceInterfaceCreateTodoCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error)) *MockIssuesServiceInterfaceCreateTodoCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceCreateTodoCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error)) *MockIssuesServiceInterfaceCreateTodoCall { +func (c *MockIssuesServiceInterfaceCreateTodoCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error)) *MockIssuesServiceInterfaceCreateTodoCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteIssue mocks base method. -func (m *MockIssuesServiceInterface) DeleteIssue(pid any, issue int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockIssuesServiceInterface) DeleteIssue(pid any, issue int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockIssuesServiceInterfaceDeleteIssueCall) Return(arg0 *gitlab.Response } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceDeleteIssueCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssuesServiceInterfaceDeleteIssueCall { +func (c *MockIssuesServiceInterfaceDeleteIssueCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssuesServiceInterfaceDeleteIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceDeleteIssueCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssuesServiceInterfaceDeleteIssueCall { +func (c *MockIssuesServiceInterfaceDeleteIssueCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIssuesServiceInterfaceDeleteIssueCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssue mocks base method. -func (m *MockIssuesServiceInterface) GetIssue(pid any, issue int, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) GetIssue(pid any, issue int64, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue} for _, a := range options { @@ -253,19 +253,19 @@ func (c *MockIssuesServiceInterfaceGetIssueCall) Return(arg0 *gitlab.Issue, arg1 } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceGetIssueCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetIssueCall { +func (c *MockIssuesServiceInterfaceGetIssueCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceGetIssueCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetIssueCall { +func (c *MockIssuesServiceInterfaceGetIssueCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetIssueCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssueByID mocks base method. -func (m *MockIssuesServiceInterface) GetIssueByID(issue int, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) GetIssueByID(issue int64, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{issue} for _, a := range options { @@ -298,19 +298,19 @@ func (c *MockIssuesServiceInterfaceGetIssueByIDCall) Return(arg0 *gitlab.Issue, } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceGetIssueByIDCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetIssueByIDCall { +func (c *MockIssuesServiceInterfaceGetIssueByIDCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetIssueByIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceGetIssueByIDCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetIssueByIDCall { +func (c *MockIssuesServiceInterfaceGetIssueByIDCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetIssueByIDCall { c.Call = c.Call.DoAndReturn(f) return c } // GetParticipants mocks base method. -func (m *MockIssuesServiceInterface) GetParticipants(pid any, issue int, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) GetParticipants(pid any, issue int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue} for _, a := range options { @@ -343,19 +343,19 @@ func (c *MockIssuesServiceInterfaceGetParticipantsCall) Return(arg0 []*gitlab.Ba } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceGetParticipantsCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetParticipantsCall { +func (c *MockIssuesServiceInterfaceGetParticipantsCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetParticipantsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceGetParticipantsCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetParticipantsCall { +func (c *MockIssuesServiceInterfaceGetParticipantsCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetParticipantsCall { c.Call = c.Call.DoAndReturn(f) return c } // GetTimeSpent mocks base method. -func (m *MockIssuesServiceInterface) GetTimeSpent(pid any, issue int, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) GetTimeSpent(pid any, issue int64, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue} for _, a := range options { @@ -388,13 +388,13 @@ func (c *MockIssuesServiceInterfaceGetTimeSpentCall) Return(arg0 *gitlab.TimeSta } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceGetTimeSpentCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetTimeSpentCall { +func (c *MockIssuesServiceInterfaceGetTimeSpentCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetTimeSpentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceGetTimeSpentCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetTimeSpentCall { +func (c *MockIssuesServiceInterfaceGetTimeSpentCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceGetTimeSpentCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -490,7 +490,7 @@ func (c *MockIssuesServiceInterfaceListIssuesCall) DoAndReturn(f func(*gitlab.Li } // ListMergeRequestsClosingIssue mocks base method. -func (m *MockIssuesServiceInterface) ListMergeRequestsClosingIssue(pid any, issue int, opt *gitlab.ListMergeRequestsClosingIssueOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) ListMergeRequestsClosingIssue(pid any, issue int64, opt *gitlab.ListMergeRequestsClosingIssueOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -523,19 +523,19 @@ func (c *MockIssuesServiceInterfaceListMergeRequestsClosingIssueCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceListMergeRequestsClosingIssueCall) Do(f func(any, int, *gitlab.ListMergeRequestsClosingIssueOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockIssuesServiceInterfaceListMergeRequestsClosingIssueCall { +func (c *MockIssuesServiceInterfaceListMergeRequestsClosingIssueCall) Do(f func(any, int64, *gitlab.ListMergeRequestsClosingIssueOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockIssuesServiceInterfaceListMergeRequestsClosingIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceListMergeRequestsClosingIssueCall) DoAndReturn(f func(any, int, *gitlab.ListMergeRequestsClosingIssueOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockIssuesServiceInterfaceListMergeRequestsClosingIssueCall { +func (c *MockIssuesServiceInterfaceListMergeRequestsClosingIssueCall) DoAndReturn(f func(any, int64, *gitlab.ListMergeRequestsClosingIssueOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockIssuesServiceInterfaceListMergeRequestsClosingIssueCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMergeRequestsRelatedToIssue mocks base method. -func (m *MockIssuesServiceInterface) ListMergeRequestsRelatedToIssue(pid any, issue int, opt *gitlab.ListMergeRequestsRelatedToIssueOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) ListMergeRequestsRelatedToIssue(pid any, issue int64, opt *gitlab.ListMergeRequestsRelatedToIssueOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -568,13 +568,13 @@ func (c *MockIssuesServiceInterfaceListMergeRequestsRelatedToIssueCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceListMergeRequestsRelatedToIssueCall) Do(f func(any, int, *gitlab.ListMergeRequestsRelatedToIssueOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockIssuesServiceInterfaceListMergeRequestsRelatedToIssueCall { +func (c *MockIssuesServiceInterfaceListMergeRequestsRelatedToIssueCall) Do(f func(any, int64, *gitlab.ListMergeRequestsRelatedToIssueOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockIssuesServiceInterfaceListMergeRequestsRelatedToIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceListMergeRequestsRelatedToIssueCall) DoAndReturn(f func(any, int, *gitlab.ListMergeRequestsRelatedToIssueOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockIssuesServiceInterfaceListMergeRequestsRelatedToIssueCall { +func (c *MockIssuesServiceInterfaceListMergeRequestsRelatedToIssueCall) DoAndReturn(f func(any, int64, *gitlab.ListMergeRequestsRelatedToIssueOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockIssuesServiceInterfaceListMergeRequestsRelatedToIssueCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -625,7 +625,7 @@ func (c *MockIssuesServiceInterfaceListProjectIssuesCall) DoAndReturn(f func(any } // MoveIssue mocks base method. -func (m *MockIssuesServiceInterface) MoveIssue(pid any, issue int, opt *gitlab.MoveIssueOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) MoveIssue(pid any, issue int64, opt *gitlab.MoveIssueOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -658,19 +658,19 @@ func (c *MockIssuesServiceInterfaceMoveIssueCall) Return(arg0 *gitlab.Issue, arg } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceMoveIssueCall) Do(f func(any, int, *gitlab.MoveIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceMoveIssueCall { +func (c *MockIssuesServiceInterfaceMoveIssueCall) Do(f func(any, int64, *gitlab.MoveIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceMoveIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceMoveIssueCall) DoAndReturn(f func(any, int, *gitlab.MoveIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceMoveIssueCall { +func (c *MockIssuesServiceInterfaceMoveIssueCall) DoAndReturn(f func(any, int64, *gitlab.MoveIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceMoveIssueCall { c.Call = c.Call.DoAndReturn(f) return c } // ReorderIssue mocks base method. -func (m *MockIssuesServiceInterface) ReorderIssue(pid any, issue int, opt *gitlab.ReorderIssueOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) ReorderIssue(pid any, issue int64, opt *gitlab.ReorderIssueOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -703,19 +703,19 @@ func (c *MockIssuesServiceInterfaceReorderIssueCall) Return(arg0 *gitlab.Issue, } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceReorderIssueCall) Do(f func(any, int, *gitlab.ReorderIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceReorderIssueCall { +func (c *MockIssuesServiceInterfaceReorderIssueCall) Do(f func(any, int64, *gitlab.ReorderIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceReorderIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceReorderIssueCall) DoAndReturn(f func(any, int, *gitlab.ReorderIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceReorderIssueCall { +func (c *MockIssuesServiceInterfaceReorderIssueCall) DoAndReturn(f func(any, int64, *gitlab.ReorderIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceReorderIssueCall { c.Call = c.Call.DoAndReturn(f) return c } // ResetSpentTime mocks base method. -func (m *MockIssuesServiceInterface) ResetSpentTime(pid any, issue int, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) ResetSpentTime(pid any, issue int64, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue} for _, a := range options { @@ -748,19 +748,19 @@ func (c *MockIssuesServiceInterfaceResetSpentTimeCall) Return(arg0 *gitlab.TimeS } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceResetSpentTimeCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceResetSpentTimeCall { +func (c *MockIssuesServiceInterfaceResetSpentTimeCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceResetSpentTimeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceResetSpentTimeCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceResetSpentTimeCall { +func (c *MockIssuesServiceInterfaceResetSpentTimeCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceResetSpentTimeCall { c.Call = c.Call.DoAndReturn(f) return c } // ResetTimeEstimate mocks base method. -func (m *MockIssuesServiceInterface) ResetTimeEstimate(pid any, issue int, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) ResetTimeEstimate(pid any, issue int64, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue} for _, a := range options { @@ -793,19 +793,19 @@ func (c *MockIssuesServiceInterfaceResetTimeEstimateCall) Return(arg0 *gitlab.Ti } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceResetTimeEstimateCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceResetTimeEstimateCall { +func (c *MockIssuesServiceInterfaceResetTimeEstimateCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceResetTimeEstimateCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceResetTimeEstimateCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceResetTimeEstimateCall { +func (c *MockIssuesServiceInterfaceResetTimeEstimateCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceResetTimeEstimateCall { c.Call = c.Call.DoAndReturn(f) return c } // SetTimeEstimate mocks base method. -func (m *MockIssuesServiceInterface) SetTimeEstimate(pid any, issue int, opt *gitlab.SetTimeEstimateOptions, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) SetTimeEstimate(pid any, issue int64, opt *gitlab.SetTimeEstimateOptions, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -838,19 +838,19 @@ func (c *MockIssuesServiceInterfaceSetTimeEstimateCall) Return(arg0 *gitlab.Time } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceSetTimeEstimateCall) Do(f func(any, int, *gitlab.SetTimeEstimateOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceSetTimeEstimateCall { +func (c *MockIssuesServiceInterfaceSetTimeEstimateCall) Do(f func(any, int64, *gitlab.SetTimeEstimateOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceSetTimeEstimateCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceSetTimeEstimateCall) DoAndReturn(f func(any, int, *gitlab.SetTimeEstimateOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceSetTimeEstimateCall { +func (c *MockIssuesServiceInterfaceSetTimeEstimateCall) DoAndReturn(f func(any, int64, *gitlab.SetTimeEstimateOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockIssuesServiceInterfaceSetTimeEstimateCall { c.Call = c.Call.DoAndReturn(f) return c } // SubscribeToIssue mocks base method. -func (m *MockIssuesServiceInterface) SubscribeToIssue(pid any, issue int, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) SubscribeToIssue(pid any, issue int64, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue} for _, a := range options { @@ -883,19 +883,19 @@ func (c *MockIssuesServiceInterfaceSubscribeToIssueCall) Return(arg0 *gitlab.Iss } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceSubscribeToIssueCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceSubscribeToIssueCall { +func (c *MockIssuesServiceInterfaceSubscribeToIssueCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceSubscribeToIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceSubscribeToIssueCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceSubscribeToIssueCall { +func (c *MockIssuesServiceInterfaceSubscribeToIssueCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceSubscribeToIssueCall { c.Call = c.Call.DoAndReturn(f) return c } // UnsubscribeFromIssue mocks base method. -func (m *MockIssuesServiceInterface) UnsubscribeFromIssue(pid any, issue int, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) UnsubscribeFromIssue(pid any, issue int64, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue} for _, a := range options { @@ -928,19 +928,19 @@ func (c *MockIssuesServiceInterfaceUnsubscribeFromIssueCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceUnsubscribeFromIssueCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceUnsubscribeFromIssueCall { +func (c *MockIssuesServiceInterfaceUnsubscribeFromIssueCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceUnsubscribeFromIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceUnsubscribeFromIssueCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceUnsubscribeFromIssueCall { +func (c *MockIssuesServiceInterfaceUnsubscribeFromIssueCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceUnsubscribeFromIssueCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateIssue mocks base method. -func (m *MockIssuesServiceInterface) UpdateIssue(pid any, issue int, opt *gitlab.UpdateIssueOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { +func (m *MockIssuesServiceInterface) UpdateIssue(pid any, issue int64, opt *gitlab.UpdateIssueOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -973,13 +973,13 @@ func (c *MockIssuesServiceInterfaceUpdateIssueCall) Return(arg0 *gitlab.Issue, a } // Do rewrite *gomock.Call.Do -func (c *MockIssuesServiceInterfaceUpdateIssueCall) Do(f func(any, int, *gitlab.UpdateIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceUpdateIssueCall { +func (c *MockIssuesServiceInterfaceUpdateIssueCall) Do(f func(any, int64, *gitlab.UpdateIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceUpdateIssueCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockIssuesServiceInterfaceUpdateIssueCall) DoAndReturn(f func(any, int, *gitlab.UpdateIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceUpdateIssueCall { +func (c *MockIssuesServiceInterfaceUpdateIssueCall) DoAndReturn(f func(any, int64, *gitlab.UpdateIssueOptions, ...gitlab.RequestOptionFunc) (*gitlab.Issue, *gitlab.Response, error)) *MockIssuesServiceInterfaceUpdateIssueCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/merge_requests_mock.go b/testing/merge_requests_mock.go index bf3d55b1..f84117b2 100644 --- a/testing/merge_requests_mock.go +++ b/testing/merge_requests_mock.go @@ -86,7 +86,7 @@ func (c *MockMergeRequestsServiceInterfaceAcceptMergeRequestCall) DoAndReturn(f } // AddSpentTime mocks base method. -func (m *MockMergeRequestsServiceInterface) AddSpentTime(pid any, mergeRequest int, opt *gitlab.AddSpentTimeOptions, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) AddSpentTime(pid any, mergeRequest int64, opt *gitlab.AddSpentTimeOptions, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -119,13 +119,13 @@ func (c *MockMergeRequestsServiceInterfaceAddSpentTimeCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceAddSpentTimeCall) Do(f func(any, int, *gitlab.AddSpentTimeOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceAddSpentTimeCall { +func (c *MockMergeRequestsServiceInterfaceAddSpentTimeCall) Do(f func(any, int64, *gitlab.AddSpentTimeOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceAddSpentTimeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceAddSpentTimeCall) DoAndReturn(f func(any, int, *gitlab.AddSpentTimeOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceAddSpentTimeCall { +func (c *MockMergeRequestsServiceInterfaceAddSpentTimeCall) DoAndReturn(f func(any, int64, *gitlab.AddSpentTimeOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceAddSpentTimeCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -894,7 +894,7 @@ func (c *MockMergeRequestsServiceInterfaceGetSingleMergeRequestDiffVersionCall) } // GetTimeSpent mocks base method. -func (m *MockMergeRequestsServiceInterface) GetTimeSpent(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetTimeSpent(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -927,13 +927,13 @@ func (c *MockMergeRequestsServiceInterfaceGetTimeSpentCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetTimeSpentCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetTimeSpentCall { +func (c *MockMergeRequestsServiceInterfaceGetTimeSpentCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetTimeSpentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetTimeSpentCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetTimeSpentCall { +func (c *MockMergeRequestsServiceInterfaceGetTimeSpentCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetTimeSpentCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1253,7 +1253,7 @@ func (c *MockMergeRequestsServiceInterfaceRebaseMergeRequestCall) DoAndReturn(f } // ResetSpentTime mocks base method. -func (m *MockMergeRequestsServiceInterface) ResetSpentTime(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) ResetSpentTime(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -1286,19 +1286,19 @@ func (c *MockMergeRequestsServiceInterfaceResetSpentTimeCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceResetSpentTimeCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceResetSpentTimeCall { +func (c *MockMergeRequestsServiceInterfaceResetSpentTimeCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceResetSpentTimeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceResetSpentTimeCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceResetSpentTimeCall { +func (c *MockMergeRequestsServiceInterfaceResetSpentTimeCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceResetSpentTimeCall { c.Call = c.Call.DoAndReturn(f) return c } // ResetTimeEstimate mocks base method. -func (m *MockMergeRequestsServiceInterface) ResetTimeEstimate(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) ResetTimeEstimate(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -1331,19 +1331,19 @@ func (c *MockMergeRequestsServiceInterfaceResetTimeEstimateCall) Return(arg0 *gi } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceResetTimeEstimateCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceResetTimeEstimateCall { +func (c *MockMergeRequestsServiceInterfaceResetTimeEstimateCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceResetTimeEstimateCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceResetTimeEstimateCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceResetTimeEstimateCall { +func (c *MockMergeRequestsServiceInterfaceResetTimeEstimateCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceResetTimeEstimateCall { c.Call = c.Call.DoAndReturn(f) return c } // SetTimeEstimate mocks base method. -func (m *MockMergeRequestsServiceInterface) SetTimeEstimate(pid any, mergeRequest int, opt *gitlab.SetTimeEstimateOptions, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) SetTimeEstimate(pid any, mergeRequest int64, opt *gitlab.SetTimeEstimateOptions, options ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -1376,13 +1376,13 @@ func (c *MockMergeRequestsServiceInterfaceSetTimeEstimateCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceSetTimeEstimateCall) Do(f func(any, int, *gitlab.SetTimeEstimateOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceSetTimeEstimateCall { +func (c *MockMergeRequestsServiceInterfaceSetTimeEstimateCall) Do(f func(any, int64, *gitlab.SetTimeEstimateOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceSetTimeEstimateCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceSetTimeEstimateCall) DoAndReturn(f func(any, int, *gitlab.SetTimeEstimateOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceSetTimeEstimateCall { +func (c *MockMergeRequestsServiceInterfaceSetTimeEstimateCall) DoAndReturn(f func(any, int64, *gitlab.SetTimeEstimateOptions, ...gitlab.RequestOptionFunc) (*gitlab.TimeStats, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceSetTimeEstimateCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/project_markdown_uploads_mock.go b/testing/project_markdown_uploads_mock.go index 66e4a6a7..85060e88 100644 --- a/testing/project_markdown_uploads_mock.go +++ b/testing/project_markdown_uploads_mock.go @@ -42,7 +42,7 @@ func (m *MockProjectMarkdownUploadsServiceInterface) EXPECT() *MockProjectMarkdo } // DeleteProjectMarkdownUploadByID mocks base method. -func (m *MockProjectMarkdownUploadsServiceInterface) DeleteProjectMarkdownUploadByID(pid any, uploadID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectMarkdownUploadsServiceInterface) DeleteProjectMarkdownUploadByID(pid any, uploadID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, uploadID} for _, a := range options { @@ -74,13 +74,13 @@ func (c *MockProjectMarkdownUploadsServiceInterfaceDeleteProjectMarkdownUploadBy } // Do rewrite *gomock.Call.Do -func (c *MockProjectMarkdownUploadsServiceInterfaceDeleteProjectMarkdownUploadByIDCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMarkdownUploadsServiceInterfaceDeleteProjectMarkdownUploadByIDCall { +func (c *MockProjectMarkdownUploadsServiceInterfaceDeleteProjectMarkdownUploadByIDCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMarkdownUploadsServiceInterfaceDeleteProjectMarkdownUploadByIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectMarkdownUploadsServiceInterfaceDeleteProjectMarkdownUploadByIDCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMarkdownUploadsServiceInterfaceDeleteProjectMarkdownUploadByIDCall { +func (c *MockProjectMarkdownUploadsServiceInterfaceDeleteProjectMarkdownUploadByIDCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMarkdownUploadsServiceInterfaceDeleteProjectMarkdownUploadByIDCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -130,7 +130,7 @@ func (c *MockProjectMarkdownUploadsServiceInterfaceDeleteProjectMarkdownUploadBy } // DownloadProjectMarkdownUploadByID mocks base method. -func (m *MockProjectMarkdownUploadsServiceInterface) DownloadProjectMarkdownUploadByID(pid any, uploadID int, options ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error) { +func (m *MockProjectMarkdownUploadsServiceInterface) DownloadProjectMarkdownUploadByID(pid any, uploadID int64, options ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, uploadID} for _, a := range options { @@ -163,13 +163,13 @@ func (c *MockProjectMarkdownUploadsServiceInterfaceDownloadProjectMarkdownUpload } // Do rewrite *gomock.Call.Do -func (c *MockProjectMarkdownUploadsServiceInterfaceDownloadProjectMarkdownUploadByIDCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockProjectMarkdownUploadsServiceInterfaceDownloadProjectMarkdownUploadByIDCall { +func (c *MockProjectMarkdownUploadsServiceInterfaceDownloadProjectMarkdownUploadByIDCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockProjectMarkdownUploadsServiceInterfaceDownloadProjectMarkdownUploadByIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectMarkdownUploadsServiceInterfaceDownloadProjectMarkdownUploadByIDCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockProjectMarkdownUploadsServiceInterfaceDownloadProjectMarkdownUploadByIDCall { +func (c *MockProjectMarkdownUploadsServiceInterfaceDownloadProjectMarkdownUploadByIDCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockProjectMarkdownUploadsServiceInterfaceDownloadProjectMarkdownUploadByIDCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/time_stats.go b/time_stats.go index 580acf1a..c89bbf7d 100644 --- a/time_stats.go +++ b/time_stats.go @@ -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 -- GitLab From a82865ee5bceba7fb0c4dc5898a544ba9fb4e4d2 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 17 Oct 2025 19:37:26 +0300 Subject: [PATCH 20/26] fix!: remove ProjectReposityStorage in favor to ProjectRepositoryStorage Changelog: Improvements --- projects.go | 11 +++-------- projects_test.go | 2 +- testing/projects_mock.go | 10 +++++----- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/projects.go b/projects.go index 9c33576c..4d6e3dfb 100644 --- a/projects.go +++ b/projects.go @@ -85,7 +85,7 @@ type ( 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) } @@ -2437,16 +2437,11 @@ type ProjectRepositoryStorage struct { 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 @@ -2458,7 +2453,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/projects_test.go b/projects_test.go index ff13ad47..bfa4b80f 100644 --- a/projects_test.go +++ b/projects_test.go @@ -2032,7 +2032,7 @@ func TestGetRepositoryStorage(t *testing.T) { storage, _, err := client.Projects.GetRepositoryStorage(1) assert.NoError(t, err) - assert.Equal(t, &ProjectReposityStorage{ + assert.Equal(t, &ProjectRepositoryStorage{ ProjectID: 1, DiskPath: "path/to/repo", CreatedAt: nil, diff --git a/testing/projects_mock.go b/testing/projects_mock.go index d83ce8d7..ef1e2769 100644 --- a/testing/projects_mock.go +++ b/testing/projects_mock.go @@ -1385,14 +1385,14 @@ func (c *MockProjectsServiceInterfaceGetProjectPushRulesCall) DoAndReturn(f func } // GetRepositoryStorage mocks base method. -func (m *MockProjectsServiceInterface) GetRepositoryStorage(pid any, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectReposityStorage, *gitlab.Response, error) { +func (m *MockProjectsServiceInterface) GetRepositoryStorage(pid any, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorage, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid} for _, a := range options { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "GetRepositoryStorage", varargs...) - ret0, _ := ret[0].(*gitlab.ProjectReposityStorage) + ret0, _ := ret[0].(*gitlab.ProjectRepositoryStorage) ret1, _ := ret[1].(*gitlab.Response) ret2, _ := ret[2].(error) return ret0, ret1, ret2 @@ -1412,19 +1412,19 @@ type MockProjectsServiceInterfaceGetRepositoryStorageCall struct { } // Return rewrite *gomock.Call.Return -func (c *MockProjectsServiceInterfaceGetRepositoryStorageCall) Return(arg0 *gitlab.ProjectReposityStorage, arg1 *gitlab.Response, arg2 error) *MockProjectsServiceInterfaceGetRepositoryStorageCall { +func (c *MockProjectsServiceInterfaceGetRepositoryStorageCall) Return(arg0 *gitlab.ProjectRepositoryStorage, arg1 *gitlab.Response, arg2 error) *MockProjectsServiceInterfaceGetRepositoryStorageCall { c.Call = c.Call.Return(arg0, arg1, arg2) return c } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceGetRepositoryStorageCall) Do(f func(any, ...gitlab.RequestOptionFunc) (*gitlab.ProjectReposityStorage, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetRepositoryStorageCall { +func (c *MockProjectsServiceInterfaceGetRepositoryStorageCall) Do(f func(any, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorage, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetRepositoryStorageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceGetRepositoryStorageCall) DoAndReturn(f func(any, ...gitlab.RequestOptionFunc) (*gitlab.ProjectReposityStorage, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetRepositoryStorageCall { +func (c *MockProjectsServiceInterfaceGetRepositoryStorageCall) DoAndReturn(f func(any, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorage, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetRepositoryStorageCall { c.Call = c.Call.DoAndReturn(f) return c } -- GitLab From 3276bd5330f81d0ff070bf4e52166c85467de360 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Mon, 27 Oct 2025 03:37:06 -0500 Subject: [PATCH 21/26] Finalize migration from int -> int64 Changelog: Improvements --- AGENTS.md | 40 +- application_statistics.go | 22 +- avatar.go | 2 +- bulk_imports.go | 2 +- cluster_agents.go | 6 +- commits.go | 22 +- commits_test.go | 2 +- container_registry.go | 2 +- dependencies.go | 2 +- deployments_merge_requests_test.go | 2 +- enterprise_users.go | 4 +- examples/impersonation.go | 2 +- examples/personal_access_tokens.go | 2 +- examples/pipelinestestreport.go | 2 +- external_status_checks.go | 32 +- gitlab.go | 30 +- gitlab_test.go | 71 +- gitlab_test/users_integration_test.go | 8 +- import.go | 12 +- import_test.go | 4 +- job_token_scope.go | 20 +- job_token_scope_test.go | 4 +- jobs.go | 62 +- keys.go | 6 +- labels.go | 14 +- labels_test.go | 4 +- license.go | 26 +- markdown_uploads.go | 6 +- member_roles.go | 12 +- merge_request_approvals.go | 78 +-- merge_request_approvals_test.go | 6 +- merge_requests.go | 174 ++--- merge_requests_test.go | 24 +- merge_trains.go | 18 +- milestones.go | 38 +- namespaces.go | 14 +- namespaces_test.go | 10 +- notes.go | 100 +-- packages.go | 26 +- pages_domains.go | 2 +- personal_access_tokens.go | 26 +- personal_access_tokens_test.go | 2 +- pipeline_schedules.go | 40 +- pipeline_triggers.go | 14 +- pipelines.go | 66 +- plan_limits.go | 32 +- plan_limits_test.go | 2 +- project_access_tokens.go | 12 +- project_aliases.go | 6 +- project_aliases_test.go | 24 +- project_badges.go | 14 +- project_clusters.go | 16 +- project_feature_flags.go | 8 +- project_import_export.go | 4 +- project_iterations.go | 10 +- project_members.go | 28 +- project_mirror.go | 18 +- project_repository_storage_move.go | 20 +- project_snippets.go | 16 +- project_templates.go | 2 +- project_vulnerabilities.go | 24 +- project_vulnerabilities_test.go | 2 +- projects.go | 176 ++--- projects_test.go | 24 +- protected_branches.go | 18 +- protected_environments.go | 56 +- protected_environments_test.go | 20 +- protected_tags.go | 10 +- protected_tags_test.go | 2 +- releaselinks.go | 14 +- releases.go | 12 +- repositories.go | 6 +- repository_files.go | 8 +- request_options.go | 4 +- resource_group.go | 2 +- resource_iteration_events.go | 22 +- resource_label_events.go | 30 +- resource_milestone_events.go | 20 +- resource_state_events.go | 20 +- resource_weight_events.go | 12 +- runners.go | 28 +- runners_test.go | 4 +- search.go | 4 +- search_test.go | 2 +- secure_files.go | 14 +- services.go | 6 +- services_test.go | 4 +- settings.go | 638 +++++++++--------- settings_test.go | 2 +- sidekiq_metrics.go | 16 +- snippet_repository_storage_move.go | 22 +- snippets.go | 26 +- system_hooks.go | 16 +- tags.go | 4 +- testing/enterprise_users_mock.go | 6 +- testing/job_token_scope_mock.go | 12 +- testing/jobs_mock.go | 72 +- testing/keys_mock.go | 6 +- testing/license_mock.go | 6 +- testing/member_roles_mock.go | 12 +- testing/merge_request_approvals_mock.go | 60 +- testing/merge_requests_mock.go | 150 ++-- testing/merge_trains_mock.go | 12 +- testing/milestones_mock.go | 30 +- testing/notes_mock.go | 120 ++-- testing/packages_mock.go | 18 +- testing/personal_access_tokens_mock.go | 30 +- testing/pipeline_schedules_mock.go | 54 +- testing/pipeline_triggers_mock.go | 18 +- testing/pipelines_mock.go | 42 +- testing/project_access_tokens_mock.go | 18 +- testing/project_badges_mock.go | 18 +- testing/project_clusters_mock.go | 18 +- testing/project_members_mock.go | 24 +- testing/project_mirror_mock.go | 24 +- .../project_repository_storage_move_mock.go | 24 +- testing/project_snippets_mock.go | 24 +- testing/projects_mock.go | 84 +-- testing/releaselinks_mock.go | 18 +- testing/resource_iteration_events_mock.go | 12 +- testing/resource_label_events_mock.go | 36 +- testing/resource_milestone_events_mock.go | 24 +- testing/resource_state_events_mock.go | 24 +- testing/resource_weight_events_mock.go | 6 +- testing/runners_mock.go | 18 +- testing/secure_files_mock.go | 18 +- .../snippet_repository_storage_move_mock.go | 24 +- testing/snippets_mock.go | 30 +- testing/system_hooks_mock.go | 18 +- testing/todos_mock.go | 6 +- testing/topics_mock.go | 18 +- testing/users_mock.go | 216 +++--- time_stats.go | 4 +- todos.go | 32 +- todos_test.go | 6 +- topics.go | 14 +- types.go | 10 +- usage_data.go | 20 +- usage_data_test.go | 24 +- users.go | 196 +++--- users_test.go | 4 +- 141 files changed, 2129 insertions(+), 2072 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index aa1a0623..da52c4c8 100644 --- a/AGENTS.md +++ b/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 diff --git a/application_statistics.go b/application_statistics.go index df3f9d61..cbe2ee74 100644 --- a/application_statistics.go +++ b/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/avatar.go b/avatar.go index 7536936f..98a5dd93 100644 --- a/avatar.go +++ b/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/bulk_imports.go b/bulk_imports.go index 73ac2434..6ee80bb6 100644 --- a/bulk_imports.go +++ b/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/cluster_agents.go b/cluster_agents.go index 0d6abc20..f54b848a 100644 --- a/cluster_agents.go +++ b/cluster_agents.go @@ -91,7 +91,7 @@ type Agent struct { 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"` } @@ -117,10 +117,10 @@ type AgentToken struct { 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"` } diff --git a/commits.go b/commits.go index 6e1251c5..e2f768f4 100644 --- a/commits.go +++ b/commits.go @@ -141,7 +141,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"` @@ -151,9 +151,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 { @@ -373,7 +373,7 @@ 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"` } @@ -430,7 +430,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"` } @@ -463,7 +463,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"` } @@ -481,7 +481,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"` @@ -519,7 +519,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) { @@ -627,12 +627,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/commits_test.go b/commits_test.go index 7134d9a9..73fa6253 100644 --- a/commits_test.go +++ b/commits_test.go @@ -102,7 +102,7 @@ func TestGetCommitStatuses_WithOptions(t *testing.T) { Ref: Ptr("master"), Stage: Ptr("test"), Name: Ptr("ci"), - PipelineID: Ptr(1), + PipelineID: Ptr(int64(1)), All: Ptr(true), } diff --git a/container_registry.go b/container_registry.go index d539d975..46a0a634 100644 --- a/container_registry.go +++ b/container_registry.go @@ -96,7 +96,7 @@ type RegistryRepository struct { 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"` } diff --git a/dependencies.go b/dependencies.go index 36dacc96..62696e2d 100644 --- a/dependencies.go +++ b/dependencies.go @@ -59,7 +59,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"` } diff --git a/deployments_merge_requests_test.go b/deployments_merge_requests_test.go index ea1049c2..0e15afa4 100644 --- a/deployments_merge_requests_test.go +++ b/deployments_merge_requests_test.go @@ -51,7 +51,7 @@ func TestDeploymentMergeRequestsService_ListDeploymentMergeRequests(t *testing.T allCreatedAfter := time.Date(2019, time.August, 17, 0, 0, 0, 0, time.UTC) for _, mr := range mergeRequests { - require.Equal(t, 278964, mr.ProjectID) + require.Equal(t, int64(278964), mr.ProjectID) require.Contains(t, validStates, mr.State) assert.Less(t, mr.CreatedAt.Unix(), allCreatedBefore.Unix()) assert.Greater(t, mr.CreatedAt.Unix(), allCreatedAfter.Unix()) diff --git a/enterprise_users.go b/enterprise_users.go index 0aa547b2..0d4899a5 100644 --- a/enterprise_users.go +++ b/enterprise_users.go @@ -25,7 +25,7 @@ type ( ListEnterpriseUsers(gid any, opt *ListEnterpriseUsersOptions, options ...RequestOptionFunc) ([]*User, *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 int, deleteOptions *DeleteEnterpriseUserOptions, options ...RequestOptionFunc) (*Response, error) + DeleteEnterpriseUser(gid any, uid int64, deleteOptions *DeleteEnterpriseUserOptions, options ...RequestOptionFunc) (*Response, error) } // EnterpriseUsersService handles communication with the enterprise users @@ -137,7 +137,7 @@ type DeleteEnterpriseUserOptions struct { // // GitLab API docs: // https://docs.gitlab.com/api/group_enterprise_users/#delete-an-enterprise-user -func (s *EnterpriseUsersService) DeleteEnterpriseUser(gid any, uid int, opt *DeleteEnterpriseUserOptions, options ...RequestOptionFunc) (*Response, error) { +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/examples/impersonation.go b/examples/impersonation.go index 7eae3a51..40b7c063 100644 --- a/examples/impersonation.go +++ b/examples/impersonation.go @@ -28,7 +28,7 @@ func impersonationExample() { log.Fatal(err) } - uid := 1 + uid := int64(1) // list impersonation token from an user tokens, _, err := git.Users.GetAllImpersonationTokens( diff --git a/examples/personal_access_tokens.go b/examples/personal_access_tokens.go index 95fd1ed5..31cc3ea5 100644 --- a/examples/personal_access_tokens.go +++ b/examples/personal_access_tokens.go @@ -47,7 +47,7 @@ func patListExampleWithUserFilter() { opt := &gitlab.ListPersonalAccessTokensOptions{ ListOptions: gitlab.ListOptions{Page: 1, PerPage: 10}, - UserID: gitlab.Ptr(12345), + UserID: gitlab.Ptr(int64(12345)), Sort: gitlab.Ptr("name_desc"), } diff --git a/examples/pipelinestestreport.go b/examples/pipelinestestreport.go index 115375ca..3d326dcc 100644 --- a/examples/pipelinestestreport.go +++ b/examples/pipelinestestreport.go @@ -39,7 +39,7 @@ func pipelineTestReportExample() { for _, pipeline := range pipelines { log.Printf("Found pipeline: %v", pipeline) - report, _, err := git.Pipelines.GetPipelineTestReport(projectID, pipeline.ID) + report, _, err := git.Pipelines.GetPipelineTestReport(projectID, int64(pipeline.ID)) if err != nil { log.Fatal(err) } diff --git a/external_status_checks.go b/external_status_checks.go index 4e235bd5..bc58ef07 100644 --- a/external_status_checks.go +++ b/external_status_checks.go @@ -104,7 +104,7 @@ func (s *ExternalStatusChecksService) ListMergeStatusChecks(pid any, mr int64, o // 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"` } @@ -161,9 +161,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"` } // CreateExternalStatusCheck creates an external status check. @@ -213,9 +213,9 @@ 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"` } // UpdateExternalStatusCheck updates an external status check. @@ -333,10 +333,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"` } // CreateProjectExternalStatusCheck creates an external status check. @@ -396,10 +396,10 @@ 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"` } // UpdateProjectExternalStatusCheck updates an external status check. @@ -460,7 +460,7 @@ 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"` } diff --git a/gitlab.go b/gitlab.go index d6a1b68f..0ac1c694 100644 --- a/gitlab.go +++ b/gitlab.go @@ -302,9 +302,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 @@ -959,12 +959,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 @@ -1001,22 +1001,22 @@ 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) } } @@ -1137,6 +1137,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/gitlab_test.go b/gitlab_test.go index b7a1e4a1..2aff88d4 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -394,7 +394,7 @@ func TestPathEscape(t *testing.T) { func TestPaginationPopulatePageValuesEmpty(t *testing.T) { t.Parallel() - wantPageHeaders := map[string]int{ + wantPageHeaders := map[string]int64{ xTotal: 0, xTotalPages: 0, xPerPage: 0, @@ -413,7 +413,7 @@ func TestPaginationPopulatePageValuesEmpty(t *testing.T) { Header: http.Header{}, }) - gotPageHeaders := map[string]int{ + gotPageHeaders := map[string]int64{ xTotal: r.TotalItems, xTotalPages: r.TotalPages, xPerPage: r.ItemsPerPage, @@ -442,7 +442,7 @@ func TestPaginationPopulatePageValuesEmpty(t *testing.T) { func TestPaginationPopulatePageValuesOffset(t *testing.T) { t.Parallel() - wantPageHeaders := map[string]int{ + wantPageHeaders := map[string]int64{ xTotal: 100, xTotalPages: 5, xPerPage: 20, @@ -473,7 +473,7 @@ func TestPaginationPopulatePageValuesOffset(t *testing.T) { Header: h, }) - gotPageHeaders := map[string]int{ + gotPageHeaders := map[string]int64{ xTotal: r.TotalItems, xTotalPages: r.TotalPages, xPerPage: r.ItemsPerPage, @@ -502,7 +502,7 @@ func TestPaginationPopulatePageValuesOffset(t *testing.T) { func TestPaginationPopulatePageValuesKeyset(t *testing.T) { t.Parallel() - wantPageHeaders := map[string]int{ + wantPageHeaders := map[string]int64{ xTotal: 0, xTotalPages: 0, xPerPage: 0, @@ -532,7 +532,7 @@ func TestPaginationPopulatePageValuesKeyset(t *testing.T) { Header: h, }) - gotPageHeaders := map[string]int{ + gotPageHeaders := map[string]int64{ xTotal: r.TotalItems, xTotalPages: r.TotalPages, xPerPage: r.ItemsPerPage, @@ -1088,7 +1088,7 @@ func TestWithInterceptor(t *testing.T) { t.Run("ordering aligned to how interceptors are provided, as this makes it easier to read a option setup", func(t *testing.T) { t.Parallel() - var ordering []int + var ordering []int64 client, err := NewClient("", WithInterceptor(func(next http.RoundTripper) http.RoundTripper { assert.NotNil(t, next) @@ -1115,7 +1115,7 @@ func TestWithInterceptor(t *testing.T) { require.NoError(t, err) _, _, _ = client.Users.CurrentUser() - assert.Equal(t, []int{1, 2, 3}, ordering) + assert.Equal(t, []int64{1, 2, 3}, ordering) }) t.Run("e2e", func(t *testing.T) { @@ -1483,3 +1483,58 @@ func (e *mockTLSHandshakeError) Timeout() bool { func (e *mockTLSHandshakeError) Temporary() bool { return strings.Contains(e.msg, "timeout") } + +func TestParseID(t *testing.T) { + t.Parallel() + + // GIVEN a set of inputs + tests := []struct { + name string + input any + expected string + wantErr bool + }{ + { + name: "int type", + input: 42, + expected: "42", + wantErr: false, + }, + { + name: "int64 type", + input: int64(15), + expected: "15", + wantErr: false, + }, + { + name: "string type", + input: "test-id", + expected: "test-id", + wantErr: false, + }, + { + name: "invalid type", + input: 3.14, + expected: "", + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + // WHEN parseID is called with the input + result, err := parseID(tt.input) + + // THEN it should return the expected result + if tt.wantErr { + assert.Error(t, err) + assert.Empty(t, result) + } else { + assert.NoError(t, err) + assert.Equal(t, tt.expected, result) + } + }) + } +} diff --git a/gitlab_test/users_integration_test.go b/gitlab_test/users_integration_test.go index 6d72ee5f..af187a67 100644 --- a/gitlab_test/users_integration_test.go +++ b/gitlab_test/users_integration_test.go @@ -281,10 +281,10 @@ func Test_UsersGetUserAssociationsCount_Integration(t *testing.T) { // THEN it should return the user's association counts // Verify the response structure assert.NotNil(t, associationsCount) - assert.GreaterOrEqual(t, associationsCount.GroupsCount, 0) - assert.GreaterOrEqual(t, associationsCount.ProjectsCount, 0) - assert.GreaterOrEqual(t, associationsCount.IssuesCount, 0) - assert.GreaterOrEqual(t, associationsCount.MergeRequestsCount, 0) + assert.GreaterOrEqual(t, associationsCount.GroupsCount, int64(0)) + assert.GreaterOrEqual(t, associationsCount.ProjectsCount, int64(0)) + assert.GreaterOrEqual(t, associationsCount.IssuesCount, int64(0)) + assert.GreaterOrEqual(t, associationsCount.MergeRequestsCount, int64(0)) } // Test_UsersGetUserMemberships_Integration tests the GetUserMemberships function. diff --git a/import.go b/import.go index 5e7b913f..4bce012a 100644 --- a/import.go +++ b/import.go @@ -46,7 +46,7 @@ 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"` @@ -70,7 +70,7 @@ func (s GitHubImport) String() string { // 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"` + 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"` @@ -109,7 +109,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"` @@ -129,7 +129,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. @@ -179,7 +179,7 @@ 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"` @@ -230,7 +230,7 @@ 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"` diff --git a/import_test.go b/import_test.go index a859f6b6..5d314b7f 100644 --- a/import_test.go +++ b/import_test.go @@ -45,7 +45,7 @@ func TestImportService_ImportRepositoryFromGitHub(t *testing.T) { opt := &ImportRepositoryFromGitHubOptions{ PersonalAccessToken: Ptr("token"), - RepoID: Ptr(34), + RepoID: Ptr(int64(34)), TargetNamespace: Ptr("root"), } @@ -92,7 +92,7 @@ func TestImportService_CancelGitHubProjectImport(t *testing.T) { } opt := &CancelGitHubProjectImportOptions{ - ProjectID: Ptr(27), + ProjectID: Ptr(int64(27)), } cgi, resp, err := client.Import.CancelGitHubProjectImport(opt) diff --git a/job_token_scope.go b/job_token_scope.go index 6c2fa0ca..8b70c150 100644 --- a/job_token_scope.go +++ b/job_token_scope.go @@ -24,10 +24,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 @@ -105,8 +105,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 @@ -150,7 +150,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 @@ -184,7 +184,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 @@ -203,8 +203,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 @@ -248,7 +248,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 @@ -282,7 +282,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/job_token_scope_test.go b/job_token_scope_test.go index fca744f9..0af77ad4 100644 --- a/job_token_scope_test.go +++ b/job_token_scope_test.go @@ -145,7 +145,7 @@ func TestAddProjectToJobScopeAllowList(t *testing.T) { addTokenResponse, resp, err := client.JobTokenScope.AddProjectToJobScopeAllowList( 1, - &JobTokenInboundAllowOptions{TargetProjectID: Ptr(2)}, + &JobTokenInboundAllowOptions{TargetProjectID: Ptr(int64(2))}, ) assert.NoError(t, err) assert.Equal(t, want, addTokenResponse) @@ -245,7 +245,7 @@ func TestAddGroupToJobTokenAllowlist(t *testing.T) { addTokenResponse, resp, err := client.JobTokenScope.AddGroupToJobTokenAllowlist( 1, - &AddGroupToJobTokenAllowlistOptions{TargetGroupID: Ptr(2)}, + &AddGroupToJobTokenAllowlistOptions{TargetGroupID: Ptr(int64(2))}, ) assert.NoError(t, err) assert.Equal(t, want, addTokenResponse) diff --git a/jobs.go b/jobs.go index d33d3f49..960c03a8 100644 --- a/jobs.go +++ b/jobs.go @@ -26,21 +26,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) } @@ -70,7 +70,7 @@ type Job struct { QueuedDuration float64 `json:"queued_duration"` ArtifactsExpireAt *time.Time `json:"artifacts_expire_at"` TagList []string `json:"tag_list"` - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Pipeline JobPipeline `json:"pipeline"` Ref string `json:"ref"` @@ -90,8 +90,8 @@ type Job struct { // // GitLab API docs: https://docs.gitlab.com/api/jobs/ type JobPipeline struct { - ID int `json:"id"` - ProjectID int `json:"project_id"` + ID int64 `json:"id"` + ProjectID int64 `json:"project_id"` Ref string `json:"ref"` Sha string `json:"sha"` Status string `json:"status"` @@ -103,7 +103,7 @@ type JobPipeline struct { type JobArtifact struct { FileType string `json:"file_type"` Filename string `json:"filename"` - Size int `json:"size"` + Size int64 `json:"size"` FileFormat string `json:"file_format"` } @@ -112,14 +112,14 @@ type JobArtifact struct { // GitLab API docs: https://docs.gitlab.com/api/jobs/ type JobArtifactsFile struct { Filename string `json:"filename"` - Size int `json:"size"` + Size int64 `json:"size"` } // JobRunner represents a ci build runner. // // GitLab API docs: https://docs.gitlab.com/api/jobs/ type JobRunner struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` Active bool `json:"active"` IsShared bool `json:"is_shared"` @@ -139,7 +139,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"` @@ -195,7 +195,7 @@ 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) { +func (s *JobsService) ListPipelineJobs(pid any, pipelineID int64, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Job, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -221,7 +221,7 @@ 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) { +func (s *JobsService) ListPipelineBridges(pid any, pipelineID int64, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Bridge, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -271,7 +271,7 @@ func (s *JobsService) GetJobTokensJob(opts *GetJobTokensJobOptions, options ...R // // 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) { +func (s *JobsService) GetJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -296,7 +296,7 @@ func (s *JobsService) GetJob(pid any, jobID int, options ...RequestOptionFunc) ( // // 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) { +func (s *JobsService) GetJobArtifacts(pid any, jobID int64, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -359,7 +359,7 @@ 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) { +func (s *JobsService) DownloadSingleArtifactsFile(pid any, jobID int64, artifactPath string, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -423,7 +423,7 @@ func (s *JobsService) DownloadSingleArtifactsFileByTagOrBranch(pid any, refName // // 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) { +func (s *JobsService) GetTraceFile(pid any, jobID int64, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -448,7 +448,7 @@ func (s *JobsService) GetTraceFile(pid any, jobID int, options ...RequestOptionF // // 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) { +func (s *JobsService) CancelJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -473,7 +473,7 @@ func (s *JobsService) CancelJob(pid any, jobID int, options ...RequestOptionFunc // // 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) { +func (s *JobsService) RetryJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -499,7 +499,7 @@ 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) { +func (s *JobsService) EraseJob(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -525,7 +525,7 @@ 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) { +func (s *JobsService) KeepArtifacts(pid any, jobID int64, options ...RequestOptionFunc) (*Job, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -568,7 +568,7 @@ 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) { +func (s *JobsService) PlayJob(pid any, jobID int64, opt *PlayJobOptions, options ...RequestOptionFunc) (*Job, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -593,7 +593,7 @@ func (s *JobsService) PlayJob(pid any, jobID int, opt *PlayJobOptions, options . // // 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) { +func (s *JobsService) DeleteArtifacts(pid any, jobID int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err diff --git a/keys.go b/keys.go index 3b2187c6..8d76a22b 100644 --- a/keys.go +++ b/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/labels.go b/labels.go index d7eb1e62..3a78a14e 100644 --- a/labels.go +++ b/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/labels_test.go b/labels_test.go index c67e1c97..0a4d1630 100644 --- a/labels_test.go +++ b/labels_test.go @@ -36,7 +36,7 @@ func TestCreateLabel(t *testing.T) { l := &CreateLabelOptions{ Name: Ptr("MyLabel"), Color: Ptr("#11FF22"), - Priority: Ptr(2), + Priority: Ptr(int64(2)), } label, _, err := client.Labels.CreateLabel("1", l) if err != nil { @@ -96,7 +96,7 @@ func TestUpdateLabel(t *testing.T) { NewName: Ptr("New Label"), Color: Ptr("#11FF23"), Description: Ptr("This is updated label"), - Priority: Ptr(42), + Priority: Ptr(int64(42)), } label, resp, err := client.Labels.UpdateLabel("1", "MyLabel", l) diff --git a/license.go b/license.go index ebf43a5a..89418fb9 100644 --- a/license.go +++ b/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,17 +46,17 @@ var _ LicenseServiceInterface = (*LicenseService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/license/ type License struct { - ID int `json:"id"` + 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 int `json:"historical_max"` - MaximumUserCount int `json:"maximum_user_count"` + HistoricalMax int64 `json:"historical_max"` + MaximumUserCount int64 `json:"maximum_user_count"` Expired bool `json:"expired"` - Overage int `json:"overage"` - UserLimit int `json:"user_limit"` - ActiveUsers int `json:"active_users"` + 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 @@ -86,11 +86,11 @@ func (l LicenseLicensee) String() string { // GitLab API docs: // https://docs.gitlab.com/api/license/ type LicenseAddOns 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"` + 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 { @@ -146,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/markdown_uploads.go b/markdown_uploads.go index 8f6e08d8..6b0591a3 100644 --- a/markdown_uploads.go +++ b/markdown_uploads.go @@ -29,8 +29,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 +50,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"` diff --git a/member_roles.go b/member_roles.go index e9fede21..fe330159 100644 --- a/member_roles.go +++ b/member_roles.go @@ -9,10 +9,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 +32,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"` @@ -134,7 +134,7 @@ func (s *MemberRolesService) CreateInstanceMemberRole(opt *CreateMemberRoleOptio // // 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) { +func (s *MemberRolesService) DeleteInstanceMemberRole(memberRoleID int64, options ...RequestOptionFunc) (*Response, error) { u := fmt.Sprintf("member_roles/%d", memberRoleID) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) @@ -199,7 +199,7 @@ func (s *MemberRolesService) CreateMemberRole(gid any, opt *CreateMemberRoleOpti // // 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) { +func (s *MemberRolesService) DeleteMemberRole(gid any, memberRole int64, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err diff --git a/merge_request_approvals.go b/merge_request_approvals.go index ee52962a..12263ac9 100644 --- a/merge_request_approvals.go +++ b/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"` @@ -92,7 +92,7 @@ type MergeRequestApproverGroup struct { } type MergeRequestApproverNestedGroup struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Path string `json:"path"` Description string `json:"description"` @@ -110,12 +110,12 @@ type MergeRequestApproverNestedGroup 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"` @@ -160,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 @@ -185,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 @@ -205,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 @@ -224,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 @@ -250,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 @@ -281,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 @@ -306,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 @@ -333,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 @@ -371,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 @@ -406,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/merge_request_approvals_test.go b/merge_request_approvals_test.go index 50718009..25c10703 100644 --- a/merge_request_approvals_test.go +++ b/merge_request_approvals_test.go @@ -364,9 +364,9 @@ func TestCreateApprovalRules(t *testing.T) { opt := &CreateMergeRequestApprovalRuleOptions{ Name: Ptr("security"), - ApprovalsRequired: Ptr(3), - UserIDs: &[]int{5, 50}, - GroupIDs: &[]int{5}, + ApprovalsRequired: Ptr(int64(3)), + UserIDs: &[]int64{5, 50}, + GroupIDs: &[]int64{5}, } rule, resp, err := client.MergeRequestApprovals.CreateApprovalRule(1, 1, opt) diff --git a/merge_requests.go b/merge_requests.go index d7d3859a..7c39ee24 100644 --- a/merge_requests.go +++ b/merge_requests.go @@ -29,37 +29,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) + 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 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) + 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 +79,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 +114,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"` @@ -153,7 +153,7 @@ type MergeRequest struct { HeadPipeline *Pipeline `json:"head_pipeline"` DiffRefs MergeRequestDiffRefs `json:"diff_refs"` RebaseInProgress bool `json:"rebase_in_progress"` - DivergedCommitsCount int `json:"diverged_commits_count"` + DivergedCommitsCount int64 `json:"diverged_commits_count"` FirstContribution bool `json:"first_contribution"` // Deprecated: use Draft instead @@ -243,12 +243,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"` @@ -281,7 +281,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"` @@ -327,7 +327,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"` @@ -342,7 +342,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"` @@ -404,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"` @@ -461,7 +461,7 @@ 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) { +func (s *MergeRequestsService) GetMergeRequest(pid any, mergeRequest int64, opt *GetMergeRequestsOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -486,7 +486,7 @@ func (s *MergeRequestsService) GetMergeRequest(pid any, mergeRequest int, opt *G // // 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) { +func (s *MergeRequestsService) GetMergeRequestApprovals(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -520,7 +520,7 @@ type GetMergeRequestCommitsOptions struct { // // 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) { +func (s *MergeRequestsService) GetMergeRequestCommits(pid any, mergeRequest int64, opt *GetMergeRequestCommitsOptions, options ...RequestOptionFunc) ([]*Commit, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -561,7 +561,7 @@ 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) { +func (s *MergeRequestsService) GetMergeRequestChanges(pid any, mergeRequest int64, opt *GetMergeRequestChangesOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -596,7 +596,7 @@ 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) { +func (s *MergeRequestsService) ListMergeRequestDiffs(pid any, mergeRequest int64, opt *ListMergeRequestDiffsOptions, options ...RequestOptionFunc) ([]*MergeRequestDiff, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -628,7 +628,7 @@ 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) { +func (s *MergeRequestsService) ShowMergeRequestRawDiffs(pid any, mergeRequest int64, opt *ShowMergeRequestRawDiffsOptions, options ...RequestOptionFunc) ([]byte, *Response, error) { project, err := parseID(pid) if err != nil { return []byte{}, nil, err @@ -657,7 +657,7 @@ func (s *MergeRequestsService) ShowMergeRequestRawDiffs(pid any, mergeRequest in // // 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) { +func (s *MergeRequestsService) GetMergeRequestParticipants(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*BasicUser, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -692,7 +692,7 @@ type MergeRequestReviewer struct { // // 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) { +func (s *MergeRequestsService) GetMergeRequestReviewers(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*MergeRequestReviewer, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -717,7 +717,7 @@ func (s *MergeRequestsService) GetMergeRequestReviewers(pid any, mergeRequest in // // 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) { +func (s *MergeRequestsService) ListMergeRequestPipelines(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]*PipelineInfo, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -742,7 +742,7 @@ func (s *MergeRequestsService) ListMergeRequestPipelines(pid any, mergeRequest i // // 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) { +func (s *MergeRequestsService) CreateMergeRequestPipeline(pid any, mergeRequest int64, options ...RequestOptionFunc) (*PipelineInfo, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -777,7 +777,7 @@ type GetIssuesClosedOnMergeOptions struct { // // 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) { +func (s *MergeRequestsService) GetIssuesClosedOnMerge(pid any, mergeRequest int64, opt *GetIssuesClosedOnMergeOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -810,7 +810,7 @@ type ListRelatedIssuesOptions struct { // // 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) { +func (s *MergeRequestsService) ListRelatedIssues(pid any, mergeRequest int64, opt *ListRelatedIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -843,17 +843,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. @@ -890,13 +890,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"` @@ -908,7 +908,7 @@ 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) { +func (s *MergeRequestsService) UpdateMergeRequest(pid any, mergeRequest int64, opt *UpdateMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -933,7 +933,7 @@ func (s *MergeRequestsService) UpdateMergeRequest(pid any, mergeRequest int, opt // // 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) { +func (s *MergeRequestsService) DeleteMergeRequest(pid any, mergeRequest int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -972,7 +972,7 @@ 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) { +func (s *MergeRequestsService) AcceptMergeRequest(pid any, mergeRequest int64, opt *AcceptMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1001,7 +1001,7 @@ 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) { +func (s *MergeRequestsService) CancelMergeWhenPipelineSucceeds(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1037,7 +1037,7 @@ 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) { +func (s *MergeRequestsService) RebaseMergeRequest(pid any, mergeRequest int64, opt *RebaseMergeRequestOptions, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -1065,7 +1065,7 @@ type GetMergeRequestDiffVersionsOptions struct { // // 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) { +func (s *MergeRequestsService) GetMergeRequestDiffVersions(pid any, mergeRequest int64, opt *GetMergeRequestDiffVersionsOptions, options ...RequestOptionFunc) ([]*MergeRequestDiffVersion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1099,7 +1099,7 @@ 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) { +func (s *MergeRequestsService) GetSingleMergeRequestDiffVersion(pid any, mergeRequest, version int64, opt *GetSingleMergeRequestDiffVersionOptions, options ...RequestOptionFunc) (*MergeRequestDiffVersion, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1126,7 +1126,7 @@ 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) { +func (s *MergeRequestsService) SubscribeToMergeRequest(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1154,7 +1154,7 @@ 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) { +func (s *MergeRequestsService) UnsubscribeFromMergeRequest(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeRequest, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1181,7 +1181,7 @@ 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) { +func (s *MergeRequestsService) CreateTodo(pid any, mergeRequest int64, options ...RequestOptionFunc) (*Todo, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1247,9 +1247,9 @@ func (s *MergeRequestsService) GetTimeSpent(pid any, mergeRequest int64, 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. @@ -1257,23 +1257,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"` @@ -1286,7 +1286,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"` @@ -1311,7 +1311,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 @@ -1328,7 +1328,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 @@ -1336,7 +1336,7 @@ 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) { +func (s *MergeRequestsService) CreateMergeRequestDependency(pid any, mergeRequest int64, opts CreateMergeRequestDependencyOptions, options ...RequestOptionFunc) (*MergeRequestDependency, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -1362,7 +1362,7 @@ 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) { +func (s *MergeRequestsService) DeleteMergeRequestDependency(pid any, mergeRequest int64, blockingMergeRequest int64, options ...RequestOptionFunc) (*Response, error) { project, err := parseID(pid) if err != nil { return nil, err @@ -1381,7 +1381,7 @@ func (s *MergeRequestsService) DeleteMergeRequestDependency(pid any, mergeReques // // 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) { +func (s *MergeRequestsService) GetMergeRequestDependencies(pid any, mergeRequest int64, options ...RequestOptionFunc) ([]MergeRequestDependency, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/merge_requests_test.go b/merge_requests_test.go index 4f150ad3..4a9b23e0 100644 --- a/merge_requests_test.go +++ b/merge_requests_test.go @@ -114,13 +114,13 @@ func TestGetMergeRequest(t *testing.T) { require.NoError(t, err) - require.Equal(t, 33092005, mergeRequest.ID) + require.Equal(t, int64(33092005), mergeRequest.ID) require.Equal(t, "8e0b45049b6253b8984cde9241830d2851168142", mergeRequest.SHA) - require.Equal(t, 14656, mergeRequest.IID) - require.Equal(t, 278964, mergeRequest.ProjectID) + require.Equal(t, int64(14656), mergeRequest.IID) + require.Equal(t, int64(278964), mergeRequest.ProjectID) require.Equal(t, "delete-designs-v2", mergeRequest.SourceBranch) - require.Equal(t, 9, mergeRequest.TaskCompletionStatus.Count) - require.Equal(t, 8, mergeRequest.TaskCompletionStatus.CompletedCount) + require.Equal(t, int64(9), mergeRequest.TaskCompletionStatus.Count) + require.Equal(t, int64(8), mergeRequest.TaskCompletionStatus.CompletedCount) require.Equal(t, "Add deletion support for designs", mergeRequest.Title) require.Equal(t, "## What does this MR do?\r\n\r\nThis adds the capability to destroy/hide designs.", mergeRequest.Description) require.Equal(t, "https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14656", mergeRequest.WebURL) @@ -131,7 +131,7 @@ func TestGetMergeRequest(t *testing.T) { require.Equal(t, []*BasicUser{&tk}, mergeRequest.Reviewers) require.Equal(t, labels, mergeRequest.Labels) require.True(t, mergeRequest.Squash) - require.Equal(t, 245, mergeRequest.UserNotesCount) + require.Equal(t, int64(245), mergeRequest.UserNotesCount) require.Equal(t, &pipelineBasic, mergeRequest.Pipeline) require.Equal(t, &pipelineDetailed, mergeRequest.HeadPipeline) mrCreation := time.Date(2019, time.July, 11, 22, 34, 43, 500000000, time.UTC) @@ -188,7 +188,7 @@ func TestListProjectMergeRequests(t *testing.T) { allCreatedAfter := time.Date(2019, time.August, 17, 0, 0, 0, 0, time.UTC) for _, mr := range mergeRequests { - require.Equal(t, 278964, mr.ProjectID) + require.Equal(t, int64(278964), mr.ProjectID) require.Contains(t, validStates, mr.State) assert.Less(t, mr.CreatedAt.Unix(), allCreatedBefore.Unix()) assert.Greater(t, mr.CreatedAt.Unix(), allCreatedAfter.Unix()) @@ -245,7 +245,7 @@ func TestListProjectMergeRequestsAuthorUsername(t *testing.T) { allCreatedAfter := time.Date(2019, time.August, 17, 0, 0, 0, 0, time.UTC) for _, mr := range mergeRequests { - require.Equal(t, 278964, mr.ProjectID) + require.Equal(t, int64(278964), mr.ProjectID) require.Contains(t, validStates, mr.State) assert.Less(t, mr.CreatedAt.Unix(), allCreatedBefore.Unix()) assert.Greater(t, mr.CreatedAt.Unix(), allCreatedAfter.Unix()) @@ -302,7 +302,7 @@ func TestListProjectMergeRequestsNotAuthorUsername(t *testing.T) { allCreatedAfter := time.Date(2019, time.August, 17, 0, 0, 0, 0, time.UTC) for _, mr := range mergeRequests { - require.Equal(t, 278964, mr.ProjectID) + require.Equal(t, int64(278964), mr.ProjectID) require.Contains(t, validStates, mr.State) assert.Less(t, mr.CreatedAt.Unix(), allCreatedBefore.Unix()) assert.Greater(t, mr.CreatedAt.Unix(), allCreatedAfter.Unix()) @@ -326,7 +326,7 @@ func TestCreateMergeRequestPipeline(t *testing.T) { t.Errorf("MergeRequests.CreateMergeRequestPipeline returned error: %v", err) } - assert.Equal(t, 1, pipeline.ID) + assert.Equal(t, int64(1), pipeline.ID) assert.Equal(t, "pending", pipeline.Status) } @@ -524,7 +524,7 @@ func TestIntSliceOrString(t *testing.T) { t.Parallel() opts := &ListMergeRequestsOptions{} - opts.ApprovedByIDs = ApproverIDs([]int{1, 2, 3}) + opts.ApprovedByIDs = ApproverIDs([]int64{1, 2, 3}) q, err := query.Values(opts) assert.NoError(t, err) includedIDs := q["approved_by_ids[]"] @@ -574,7 +574,7 @@ func TestCreateMergeRequestDependency(t *testing.T) { mux, client := setup(t) const project = "12345" const mergeRequest = 1 - blockingMergeRequest := int(2) + blockingMergeRequest := int64(2) path := fmt.Sprintf("/%sprojects/%s/merge_requests/%d/blocks", apiVersionPath, project, mergeRequest) mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { diff --git a/merge_trains.go b/merge_trains.go index 059612e1..c7bb9df2 100644 --- a/merge_trains.go +++ b/merge_trains.go @@ -10,8 +10,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 +29,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 +38,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"` @@ -122,7 +122,7 @@ 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) { +func (s *MergeTrainsService) GetMergeRequestOnAMergeTrain(pid any, mergeRequest int64, options ...RequestOptionFunc) (*MergeTrain, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err @@ -162,7 +162,7 @@ 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) { +func (s *MergeTrainsService) AddMergeRequestToMergeTrain(pid any, mergeRequest int64, opts *AddMergeRequestToMergeTrainOptions, options ...RequestOptionFunc) ([]*MergeTrain, *Response, error) { project, err := parseID(pid) if err != nil { return nil, nil, err diff --git a/milestones.go b/milestones.go index 3e4380bb..024101ef 100644 --- a/milestones.go +++ b/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 @@ -236,7 +236,7 @@ type GetMilestoneIssuesOptions struct { // // 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 @@ -271,7 +271,7 @@ type GetMilestoneMergeRequestsOptions struct { // // 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/namespaces.go b/namespaces.go index b4768551..c69f6a1d 100644 --- a/namespaces.go +++ b/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/namespaces_test.go b/namespaces_test.go index 27f8867d..3a4e44a3 100644 --- a/namespaces_test.go +++ b/namespaces_test.go @@ -212,8 +212,8 @@ func TestGetNamespace(t *testing.T) { WebURL: "https://gitlab.example.com/groups/group1", MembersCountWithDescendants: 2, BillableMembersCount: 2, - MaxSeatsUsed: Ptr(0), - SeatsInUse: Ptr(0), + MaxSeatsUsed: Ptr(int64(0)), + SeatsInUse: Ptr(int64(0)), Plan: "default", TrialEndsOn: nil, Trial: false, @@ -239,7 +239,7 @@ func TestNamespaceExists(t *testing.T) { }) opt := &NamespaceExistsOptions{ - ParentID: Ptr(1), + ParentID: Ptr(int64(1)), } exists, _, err := client.Namespaces.NamespaceExists("my-group", opt) if err != nil { @@ -297,8 +297,8 @@ func TestSearchNamespace(t *testing.T) { WebURL: "https://gitlab.example.com/groups/twitter", MembersCountWithDescendants: 2, BillableMembersCount: 2, - MaxSeatsUsed: Ptr(0), - SeatsInUse: Ptr(0), + MaxSeatsUsed: Ptr(int64(0)), + SeatsInUse: Ptr(int64(0)), Plan: "default", TrialEndsOn: nil, Trial: false, diff --git a/notes.go b/notes.go index fc5e9a14..1dc08499 100644 --- a/notes.go +++ b/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,7 +63,7 @@ var _ NotesServiceInterface = (*NotesService)(nil) // GitLab API docs: // https://docs.gitlab.com/api/notes/ type Note struct { - ID int `json:"id"` + ID int64 `json:"id"` Type NoteTypeValue `json:"type"` Body string `json:"body"` Attachment string `json:"attachment"` @@ -76,10 +76,10 @@ type Note struct { ExpiresAt *time.Time `json:"expires_at"` CommitID string `json:"commit_id"` Position *NotePosition `json:"position"` - NoteableID int `json:"noteable_id"` + NoteableID int64 `json:"noteable_id"` NoteableType string `json:"noteable_type"` - ProjectID int `json:"project_id"` - NoteableIID int `json:"noteable_iid"` + ProjectID int64 `json:"project_id"` + NoteableIID int64 `json:"noteable_iid"` Resolvable bool `json:"resolvable"` Resolved bool `json:"resolved"` ResolvedAt *time.Time `json:"resolved_at"` @@ -95,7 +95,7 @@ type Note struct { // GitLab API docs: // https://docs.gitlab.com/api/notes/ type NoteResolvedBy struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Email string `json:"email"` Name string `json:"name"` @@ -106,7 +106,7 @@ type NoteResolvedBy struct { // 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"` @@ -122,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"` } @@ -138,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 { @@ -160,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 @@ -185,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 @@ -221,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 @@ -255,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 @@ -280,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 @@ -310,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 @@ -335,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 @@ -371,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 @@ -405,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 @@ -430,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 @@ -460,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 @@ -485,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 @@ -522,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 @@ -556,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 @@ -581,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 @@ -613,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 @@ -639,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 @@ -674,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 @@ -708,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 @@ -733,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/packages.go b/packages.go index 83a8e3ba..7a08072f 100644 --- a/packages.go +++ b/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"` @@ -211,7 +211,7 @@ type ListPackageFilesOptions struct { // // 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 @@ -240,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 @@ -259,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/pages_domains.go b/pages_domains.go index 1d9befb1..6d18c5f8 100644 --- a/pages_domains.go +++ b/pages_domains.go @@ -50,7 +50,7 @@ type PagesDomain struct { Domain string `json:"domain"` AutoSslEnabled bool `json:"auto_ssl_enabled"` URL string `json:"url"` - ProjectID int `json:"project_id"` + ProjectID int64 `json:"project_id"` Verified bool `json:"verified"` VerificationCode string `json:"verification_code"` EnabledUntil *time.Time `json:"enabled_until"` diff --git a/personal_access_tokens.go b/personal_access_tokens.go index 9dcbe687..eb6c00e5 100644 --- a/personal_access_tokens.go +++ b/personal_access_tokens.go @@ -25,13 +25,13 @@ 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) + RevokePersonalAccessToken(token int64, options ...RequestOptionFunc) (*Response, error) + RevokePersonalAccessTokenByID(token int64, options ...RequestOptionFunc) (*Response, error) RevokePersonalAccessTokenSelf(options ...RequestOptionFunc) (*Response, error) } @@ -50,13 +50,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 +92,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 +118,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 +165,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 +174,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 +214,7 @@ func (s *PersonalAccessTokensService) RotatePersonalAccessTokenSelf(opt *RotateP } // RevokePersonalAccessToken is a backwards-compat shim for RevokePersonalAccessTokenByID. -func (s *PersonalAccessTokensService) RevokePersonalAccessToken(token int, options ...RequestOptionFunc) (*Response, error) { +func (s *PersonalAccessTokensService) RevokePersonalAccessToken(token int64, options ...RequestOptionFunc) (*Response, error) { return s.RevokePersonalAccessTokenByID(token, options...) } @@ -222,7 +222,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/personal_access_tokens_test.go b/personal_access_tokens_test.go index 950df02e..f09c6d80 100644 --- a/personal_access_tokens_test.go +++ b/personal_access_tokens_test.go @@ -34,7 +34,7 @@ func TestListPersonalAccessTokensWithUserFilter(t *testing.T) { personalAccessTokens, _, err := client.PersonalAccessTokens.ListPersonalAccessTokens( &ListPersonalAccessTokensOptions{ - UserID: Ptr(1), + UserID: Ptr(int64(1)), ExpiresBefore: Ptr(ISOTime(time.Date(2022, time.March, 22, 0, 0, 0, 0, time.UTC))), ListOptions: ListOptions{Page: 1, PerPage: 10}, }, diff --git a/pipeline_schedules.go b/pipeline_schedules.go index fc50ed84..c88eb6c4 100644 --- a/pipeline_schedules.go +++ b/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 @@ -151,7 +151,7 @@ type ListPipelinesTriggeredByScheduleOptions struct { // // 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 @@ -229,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 @@ -255,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 @@ -280,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 @@ -299,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 @@ -329,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 @@ -364,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 @@ -389,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/pipeline_triggers.go b/pipeline_triggers.go index d353ee58..a065cbc6 100644 --- a/pipeline_triggers.go +++ b/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"` @@ -95,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 @@ -161,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 @@ -186,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/pipelines.go b/pipelines.go index c40deb0a..1a54b95d 100644 --- a/pipelines.go +++ b/pipelines.go @@ -50,15 +50,15 @@ 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) + 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) 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 @@ -93,9 +93,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"` @@ -110,8 +110,8 @@ 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"` @@ -150,11 +150,11 @@ func (i DetailedStatusIllustration) String() string { // 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"` } @@ -162,11 +162,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"` } @@ -185,7 +185,7 @@ type PipelineTestCases struct { // 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"` } @@ -196,9 +196,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"` @@ -265,7 +265,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 @@ -290,7 +290,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 @@ -315,7 +315,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 @@ -481,7 +481,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 @@ -506,7 +506,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 @@ -531,7 +531,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 @@ -560,7 +560,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/plan_limits.go b/plan_limits.go index 53e9c9fd..018eff59 100644 --- a/plan_limits.go +++ b/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/plan_limits_test.go b/plan_limits_test.go index 0e9a6c0a..86256c71 100644 --- a/plan_limits_test.go +++ b/plan_limits_test.go @@ -85,7 +85,7 @@ func TestChangePlanLimits(t *testing.T) { opt := &ChangePlanLimitOptions{ PlanName: Ptr("default"), - ConanMaxFileSize: Ptr(3221225472), + ConanMaxFileSize: Ptr(int64(3221225472)), } planlimit, _, err := client.PlanLimits.ChangePlanLimits(opt) if err != nil { diff --git a/project_access_tokens.go b/project_access_tokens.go index e98e6585..41c3af62 100644 --- a/project_access_tokens.go +++ b/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/project_aliases.go b/project_aliases.go index a1af481c..c83230dd 100644 --- a/project_aliases.go +++ b/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/project_aliases_test.go b/project_aliases_test.go index 417206ba..07057672 100644 --- a/project_aliases_test.go +++ b/project_aliases_test.go @@ -27,7 +27,7 @@ func TestProjectAliasesService_CreateProjectAlias(t *testing.T) { require.NotNil(t, payload.Name) assert.Equal(t, "my-alias", *payload.Name) - assert.Equal(t, 1, payload.ProjectID) + assert.Equal(t, int64(1), payload.ProjectID) w.WriteHeader(http.StatusCreated) w.Write([]byte(`{"id": 10, "name": "my-alias", "project_id": 1}`)) @@ -36,13 +36,13 @@ func TestProjectAliasesService_CreateProjectAlias(t *testing.T) { s := client.ProjectAliases opt := &CreateProjectAliasOptions{ Name: Ptr("my-alias"), - ProjectID: 1, + ProjectID: int64(1), } alias, resp, err := s.CreateProjectAlias(opt) require.NoError(t, err) - assert.Equal(t, 10, alias.ID) + assert.Equal(t, int64(10), alias.ID) assert.Equal(t, "my-alias", alias.Name) - assert.Equal(t, 1, alias.ProjectID) + assert.Equal(t, int64(1), alias.ProjectID) assert.Equal(t, 201, resp.StatusCode) } @@ -76,9 +76,9 @@ func TestProjectAliasesService_GetProjectAlias(t *testing.T) { s := client.ProjectAliases alias, resp, err := s.GetProjectAlias("my-alias") require.NoError(t, err) - assert.Equal(t, 10, alias.ID) + assert.Equal(t, int64(10), alias.ID) assert.Equal(t, "my-alias", alias.Name) - assert.Equal(t, 1, alias.ProjectID) + assert.Equal(t, int64(1), alias.ProjectID) assert.Equal(t, 200, resp.StatusCode) } @@ -97,9 +97,9 @@ func TestProjectAliasesService_ListProjectAliases(t *testing.T) { aliases, resp, err := s.ListProjectAliases() require.NoError(t, err) require.Len(t, aliases, 1) - assert.Equal(t, 10, aliases[0].ID) + assert.Equal(t, int64(10), aliases[0].ID) assert.Equal(t, "my-alias", aliases[0].Name) - assert.Equal(t, 1, aliases[0].ProjectID) + assert.Equal(t, int64(1), aliases[0].ProjectID) assert.Equal(t, 200, resp.StatusCode) } @@ -120,9 +120,9 @@ func TestProjectAliasesService_GetProjectAlias_WithSpecialCharacters(t *testing. s := client.ProjectAliases alias, resp, err := s.GetProjectAlias(aliasName) require.NoError(t, err) - assert.Equal(t, 10, alias.ID) + assert.Equal(t, int64(10), alias.ID) assert.Equal(t, "my/alias?with=special&chars", alias.Name) - assert.Equal(t, 1, alias.ProjectID) + assert.Equal(t, int64(1), alias.ProjectID) assert.Equal(t, 200, resp.StatusCode) } @@ -162,9 +162,9 @@ func TestProjectAliasesService_GetProjectAlias_WithSpacesAndDots(t *testing.T) { s := client.ProjectAliases alias, resp, err := s.GetProjectAlias(aliasName) require.NoError(t, err) - assert.Equal(t, 20, alias.ID) + assert.Equal(t, int64(20), alias.ID) assert.Equal(t, "my alias.name", alias.Name) - assert.Equal(t, 2, alias.ProjectID) + assert.Equal(t, int64(2), alias.ProjectID) assert.Equal(t, 200, resp.StatusCode) } diff --git a/project_badges.go b/project_badges.go index c65daa38..408426a9 100644 --- a/project_badges.go +++ b/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/project_clusters.go b/project_clusters.go index 0572e1b6..b9a7ce8c 100644 --- a/project_clusters.go +++ b/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/project_feature_flags.go b/project_feature_flags.go index 53491bcc..1eed0d5e 100644 --- a/project_feature_flags.go +++ b/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/project_import_export.go b/project_import_export.go index 4a1052d4..6a4df5f0 100644 --- a/project_import_export.go +++ b/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,7 +72,7 @@ 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"` + ID int64 `json:"id"` Description string `json:"description"` Name string `json:"name"` NameWithNamespace string `json:"name_with_namespace"` diff --git a/project_iterations.go b/project_iterations.go index 2495e4cf..0fdaf3a4 100644 --- a/project_iterations.go +++ b/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/project_members.go b/project_members.go index e12a2fa6..cbb77729 100644 --- a/project_members.go +++ b/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"` @@ -64,7 +64,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"` @@ -79,8 +79,8 @@ 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"` + Query *string `url:"query,omitempty" json:"query,omitempty"` + UserIDs *[]int64 `url:"user_ids[],omitempty" json:"user_ids,omitempty"` } // ListProjectMembers gets a list of a project's team members viewable by the @@ -141,7 +141,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 @@ -166,7 +166,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 @@ -196,7 +196,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 @@ -234,14 +234,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 @@ -266,7 +266,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/project_mirror.go b/project_mirror.go index 3c242206..258c5a62 100644 --- a/project_mirror.go +++ b/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"` @@ -99,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 @@ -124,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 @@ -201,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 @@ -226,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/project_repository_storage_move.go b/project_repository_storage_move.go index f69169c6..7a94ddce 100644 --- a/project_repository_storage_move.go +++ b/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"` @@ -101,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) @@ -122,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) @@ -143,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) @@ -173,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/project_snippets.go b/project_snippets.go index 15e351f6..8ba3cb3f 100644 --- a/project_snippets.go +++ b/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 @@ -78,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 @@ -162,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 @@ -189,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 @@ -208,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/project_templates.go b/project_templates.go index 1e7c6489..ffafb257 100644 --- a/project_templates.go +++ b/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/project_vulnerabilities.go b/project_vulnerabilities.go index aa85f43b..b55130e1 100644 --- a/project_vulnerabilities.go +++ b/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/project_vulnerabilities_test.go b/project_vulnerabilities_test.go index 52923c4e..5dc4b185 100644 --- a/project_vulnerabilities_test.go +++ b/project_vulnerabilities_test.go @@ -57,7 +57,7 @@ func TestCreateVulnerability(t *testing.T) { }) opt := &CreateVulnerabilityOptions{ - FindingID: Ptr(1), + FindingID: Ptr(int64(1)), } projectVulnerability, _, err := client.ProjectVulnerabilities.CreateVulnerability(1, opt) diff --git a/projects.go b/projects.go index 4d6e3dfb..57b10e1f 100644 --- a/projects.go +++ b/projects.go @@ -42,7 +42,7 @@ 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) @@ -53,18 +53,18 @@ type ( 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,10 +76,10 @@ 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) @@ -104,7 +104,7 @@ var _ ProjectsServiceInterface = (*ProjectsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/projects/ type Project struct { - ID int `json:"id"` + ID int64 `json:"id"` Description string `json:"description"` DefaultBranch string `json:"default_branch"` Visibility VisibilityValue `json:"visibility"` @@ -118,7 +118,7 @@ type Project struct { NameWithNamespace string `json:"name_with_namespace"` Path string `json:"path"` PathWithNamespace string `json:"path_with_namespace"` - OpenIssuesCount int `json:"open_issues_count"` + 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"` @@ -126,7 +126,7 @@ type Project struct { 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"` + CreatorID int64 `json:"creator_id"` Namespace *ProjectNamespace `json:"namespace"` Permissions *Permissions `json:"permissions"` MarkedForDeletionOn *ISOTime `json:"marked_for_deletion_on"` @@ -138,9 +138,9 @@ type Project struct { 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"` + 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"` @@ -156,7 +156,7 @@ type Project struct { CanCreateMergeRequestIn bool `json:"can_create_merge_request_in"` ForkedFromProject *ForkParent `json:"forked_from_project"` Mirror bool `json:"mirror"` - MirrorUserID int `json:"mirror_user_id"` + 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"` @@ -189,8 +189,8 @@ type Project struct { 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"` + 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"` @@ -201,7 +201,7 @@ type Project struct { 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"` + BuildTimeout int64 `json:"build_timeout"` AutoCancelPendingPipelines string `json:"auto_cancel_pending_pipelines"` CIConfigPath string `json:"ci_config_path"` CustomAttributes []*CustomAttribute `json:"custom_attributes"` @@ -239,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 @@ -262,15 +262,15 @@ type Project struct { // // GitLab API docs: https://docs.gitlab.com/api/projects/ type ProjectSharedWithGroup 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"` } // 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"` @@ -282,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"` @@ -295,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"` @@ -347,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"` } @@ -399,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"` @@ -423,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"` @@ -546,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"` @@ -590,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"` @@ -606,7 +606,7 @@ type ListProjectGroupOptions struct { Search *string `url:"search,omitempty" json:"search,omitempty"` SharedMinAccessLevel *AccessLevelValue `url:"shared_min_access_level,omitempty" json:"shared_min_access_level,omitempty"` SharedVisibleOnly *bool `url:"shared_visible_only,omitempty" json:"shared_visible_only,omitempty"` - SkipGroups *[]int `url:"skip_groups,omitempty" json:"skip_groups,omitempty"` + SkipGroups *[]int64 `url:"skip_groups,omitempty" json:"skip_groups,omitempty"` WithShared *bool `url:"with_shared,omitempty" json:"with_shared,omitempty"` } @@ -715,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"` @@ -726,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"` @@ -743,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"` @@ -772,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. @@ -814,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"` @@ -892,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). @@ -945,11 +945,11 @@ 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"` @@ -983,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"` @@ -1023,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 @@ -1099,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"` @@ -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"` @@ -1462,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 @@ -1568,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 @@ -1594,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 @@ -1621,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 @@ -1649,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 @@ -1668,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 @@ -1696,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 @@ -1715,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 @@ -1735,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"` } @@ -1747,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 @@ -1875,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"` @@ -1886,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"` @@ -1932,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"` @@ -1978,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"` @@ -2046,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. @@ -2088,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. @@ -2154,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 @@ -2182,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"` } @@ -2224,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"` } @@ -2236,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 @@ -2261,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 @@ -2282,7 +2282,7 @@ 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"` + ID int64 `json:"id"` LastError string `json:"last_error"` LastSuccessfulUpdateAt *time.Time `json:"last_successful_update_at"` LastUpdateAt *time.Time `json:"last_update_at"` @@ -2431,7 +2431,7 @@ 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"` diff --git a/projects_test.go b/projects_test.go index bfa4b80f..ec7657d5 100644 --- a/projects_test.go +++ b/projects_test.go @@ -374,7 +374,7 @@ func TestEditProject(t *testing.T) { assert.True(t, attributesFound) assert.Equal(t, developerRole, project.CIRestrictPipelineCancellationRole) assert.Equal(t, developerPipelineVariablesRole, project.CIPipelineVariablesMinimumOverrideRole) - assert.Equal(t, 14, project.CIDeletePipelinesInSeconds) + assert.Equal(t, int64(14), project.CIDeletePipelinesInSeconds) } func TestListStarredProjects(t *testing.T) { @@ -664,7 +664,7 @@ func TestShareProjectWithGroup(t *testing.T) { }) opt := &ShareWithGroupOptions{ - GroupID: Ptr(1), + GroupID: Ptr(int64(1)), GroupAccess: Ptr(AccessLevelValue(50)), } @@ -744,7 +744,7 @@ func TestChangeApprovalConfiguration(t *testing.T) { }) opt := &ChangeApprovalConfigurationOptions{ - ApprovalsBeforeMerge: Ptr(3), + ApprovalsBeforeMerge: Ptr(int64(3)), } approvals, resp, err := client.Projects.ChangeApprovalConfiguration(1, opt) @@ -769,7 +769,7 @@ func TestForkProject(t *testing.T) { t.Parallel() mux, client := setup(t) - namespaceID := 42 + namespaceID := int64(42) name := "myreponame" path := "myrepopath" @@ -778,7 +778,7 @@ func TestForkProject(t *testing.T) { testBodyJSON(t, r, struct { Branches string `json:"branches"` Name string `json:"name"` - NamespaceID int `json:"namespace_id"` + NamespaceID int64 `json:"namespace_id"` Path string `json:"path"` }{"main", name, namespaceID, path}) fmt.Fprint(w, `{"id":2}`) @@ -1243,9 +1243,9 @@ func TestCreateProjectApprovalRule(t *testing.T) { opt := &CreateProjectLevelRuleOptions{ Name: Ptr("security"), - ApprovalsRequired: Ptr(3), - UserIDs: &[]int{5, 50}, - GroupIDs: &[]int{5}, + ApprovalsRequired: Ptr(int64(3)), + UserIDs: &[]int64{5, 50}, + GroupIDs: &[]int64{5}, ReportType: Ptr("code_coverage"), Usernames: &([]string{"some-cool-user"}), } @@ -1468,7 +1468,7 @@ func TestCreateProjectApprovalRuleEligibleApprovers(t *testing.T) { opt := &CreateProjectLevelRuleOptions{ Name: Ptr("Any name"), - ApprovalsRequired: Ptr(1), + ApprovalsRequired: Ptr(int64(1)), } rule, resp, err := client.Projects.CreateProjectApprovalRule(1, opt) @@ -1824,7 +1824,7 @@ func TestAddProjectPushRules(t *testing.T) { PreventSecrets: Ptr(false), AuthorEmailRegex: Ptr("@company.com$"), FileNameRegex: Ptr("(jar|exe)$"), - MaxFileSize: Ptr(5), + MaxFileSize: Ptr(int64(5)), CommitCommitterCheck: Ptr(false), CommitCommitterNameCheck: Ptr(false), RejectUnsignedCommits: Ptr(false), @@ -1888,7 +1888,7 @@ func TestEditProjectPushRules(t *testing.T) { PreventSecrets: Ptr(false), AuthorEmailRegex: Ptr("@company.com$"), FileNameRegex: Ptr("(jar|exe)$"), - MaxFileSize: Ptr(5), + MaxFileSize: Ptr(int64(5)), CommitCommitterCheck: Ptr(false), CommitCommitterNameCheck: Ptr(false), RejectUnsignedCommits: Ptr(false), @@ -2055,7 +2055,7 @@ func TestTransferProject(t *testing.T) { opt := &TransferProjectOptions{Namespace: Ptr("new-namespace")} project, _, err := client.Projects.TransferProject(1, opt) assert.NoError(t, err) - assert.Equal(t, 1, project.ID) + assert.Equal(t, int64(1), project.ID) } func TestDeleteProjectPushRule(t *testing.T) { diff --git a/protected_branches.go b/protected_branches.go index d3c1aaa7..3d6b9e95 100644 --- a/protected_branches.go +++ b/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/protected_environments.go b/protected_environments.go index c5e7ba60..3ca4b457 100644 --- a/protected_environments.go +++ b/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 @@ -151,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"` } @@ -162,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 @@ -173,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 @@ -215,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"` } @@ -226,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"` } @@ -239,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/protected_environments_test.go b/protected_environments_test.go index 51636e8a..1dc9e764 100644 --- a/protected_environments_test.go +++ b/protected_environments_test.go @@ -259,10 +259,10 @@ func TestProtectRepositoryEnvironments(t *testing.T) { DeployAccessLevels: &[]*EnvironmentAccessOptions{ {AccessLevel: Ptr(AccessLevelValue(30))}, }, - RequiredApprovalCount: Ptr(2), + RequiredApprovalCount: Ptr(int64(2)), ApprovalRules: &[]*EnvironmentApprovalRuleOptions{ { - GroupID: Ptr(10), + GroupID: Ptr(int64(10)), AccessLevel: Ptr(AccessLevelValue(0)), AccessLevelDescription: Ptr("devops"), }, @@ -368,13 +368,13 @@ func TestUpdateProtectedEnvironments(t *testing.T) { DeployAccessLevels: &[]*UpdateEnvironmentAccessOptions{ { AccessLevel: Ptr(AccessLevelValue(30)), - GroupInheritanceType: Ptr(1), + GroupInheritanceType: Ptr(int64(1)), }, }, - RequiredApprovalCount: Ptr(2), + RequiredApprovalCount: Ptr(int64(2)), ApprovalRules: &[]*UpdateEnvironmentApprovalRuleOptions{ { - GroupID: Ptr(10), + GroupID: Ptr(int64(10)), AccessLevel: Ptr(AccessLevelValue(0)), AccessLevelDescription: Ptr("devops"), }, @@ -456,7 +456,7 @@ func TestUpdateProtectedEnvironments(t *testing.T) { Name: Ptr(environmentName), DeployAccessLevels: &[]*UpdateEnvironmentAccessOptions{ { - ID: Ptr(42), + ID: Ptr(int64(42)), AccessLevel: Ptr(AccessLevelValue(30)), }, }, @@ -516,8 +516,8 @@ func TestUpdateProtectedEnvironments(t *testing.T) { Name: Ptr(environmentName), ApprovalRules: &[]*UpdateEnvironmentApprovalRuleOptions{ { - ID: Ptr(1), - GroupID: Ptr(10), + ID: Ptr(int64(1)), + GroupID: Ptr(int64(10)), AccessLevel: Ptr(AccessLevelValue(0)), AccessLevelDescription: Ptr("devops"), }, @@ -562,11 +562,11 @@ func TestUpdateProtectedEnvironments(t *testing.T) { Name: Ptr(environmentName), ApprovalRules: &[]*UpdateEnvironmentApprovalRuleOptions{ { - ID: Ptr(1), + ID: Ptr(int64(1)), Destroy: Ptr(true), }, }, - RequiredApprovalCount: Ptr(0), + RequiredApprovalCount: Ptr(int64(0)), } environment, _, err = client.ProtectedEnvironments.UpdateProtectedEnvironments(5, environmentName, opt) diff --git a/protected_tags.go b/protected_tags.go index 035260f5..ce48c369 100644 --- a/protected_tags.go +++ b/protected_tags.go @@ -55,9 +55,9 @@ 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"` AccessLevel AccessLevelValue `json:"access_level"` AccessLevelDescription string `json:"access_level_description"` } @@ -137,8 +137,8 @@ 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"` AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` } diff --git a/protected_tags_test.go b/protected_tags_test.go index fd28ecb1..e6fa840e 100644 --- a/protected_tags_test.go +++ b/protected_tags_test.go @@ -121,7 +121,7 @@ func TestProtectRepositoryTags(t *testing.T) { CreateAccessLevel: Ptr(AccessLevelValue(30)), AllowedToCreate: &[]*TagsPermissionOptions{ { - GroupID: Ptr(300), + GroupID: Ptr(int64(300)), }, }, } diff --git a/releaselinks.go b/releaselinks.go index 35698043..00fb33dc 100644 --- a/releaselinks.go +++ b/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"` @@ -87,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 @@ -162,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 @@ -189,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/releases.go b/releases.go index 3f3858c4..be400d30 100644 --- a/releases.go +++ b/releases.go @@ -70,7 +70,7 @@ type Release struct { // GitLab API docs: // https://docs.gitlab.com/api/releases/#list-releases type ReleaseAssets struct { - Count int `json:"count"` + Count int64 `json:"count"` Sources []ReleaseAssetsSource `json:"sources"` Links []*ReleaseLink `json:"links"` EvidenceFilePath string `json:"evidence_file_path"` @@ -104,9 +104,9 @@ type ReleaseLinks 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"` @@ -124,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/repositories.go b/repositories.go index 05e16e6f..c622ec38 100644 --- a/repositories.go +++ b/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/repository_files.go b/repository_files.go index ae69ab6c..5290b467 100644 --- a/repository_files.go +++ b/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 } @@ -213,8 +213,8 @@ func (c FileBlameRangeCommit) String() string { // 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/request_options.go b/request_options.go index 78ded578..9e5e9dac 100644 --- a/request_options.go +++ b/request_options.go @@ -90,11 +90,11 @@ 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 } diff --git a/resource_group.go b/resource_group.go index 6b851143..d3b8a76b 100644 --- a/resource_group.go +++ b/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/resource_iteration_events.go b/resource_iteration_events.go index bb52fc0e..d460ad4c 100644 --- a/resource_iteration_events.go +++ b/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/resource_label_events.go b/resource_label_events.go index 18e13f79..cd8e9bf0 100644 --- a/resource_label_events.go +++ b/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,11 +51,11 @@ 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"` + ID int64 `json:"id"` Action string `json:"action"` CreatedAt *time.Time `json:"created_at"` ResourceType string `json:"resource_type"` - ResourceID int `json:"resource_id"` + ResourceID int64 `json:"resource_id"` User BasicUser `json:"user"` Label LabelEventLabel `json:"label"` } @@ -65,7 +65,7 @@ type LabelEvent struct { // GitLab API docs: // https://docs.gitlab.com/api/resource_label_events/#get-single-issue-label-event type LabelEventLabel struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` Color string `json:"color"` TextColor string `json:"text_color"` @@ -86,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 @@ -111,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 @@ -138,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 @@ -164,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 @@ -190,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 @@ -215,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/resource_milestone_events.go b/resource_milestone_events.go index 76cb105d..ed4e03a0 100644 --- a/resource_milestone_events.go +++ b/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/resource_state_events.go b/resource_state_events.go index b1acec9c..ba0e5152 100644 --- a/resource_state_events.go +++ b/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/resource_weight_events.go b/resource_weight_events.go index e515f312..4bf9a121 100644 --- a/resource_weight_events.go +++ b/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/runners.go b/runners.go index b943a030..8e6b7ab3 100644 --- a/runners.go +++ b/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"` @@ -89,7 +89,7 @@ type Runner struct { type RunnerDetails struct { Paused bool `json:"paused"` Description string `json:"description"` - ID int `json:"id"` + ID int64 `json:"id"` IsShared bool `json:"is_shared"` RunnerType string `json:"runner_type"` ContactedAt *time.Time `json:"contacted_at"` @@ -103,7 +103,7 @@ type RunnerDetails struct { RunUntagged bool `json:"run_untagged"` Locked bool `json:"locked"` AccessLevel string `json:"access_level"` - MaximumTimeout int `json:"maximum_timeout"` + MaximumTimeout int64 `json:"maximum_timeout"` Groups []RunnerDetailsGroup `json:"groups"` // Deprecated: for removal in v5 of the API, see GraphQL resource CiRunnerManager instead @@ -129,7 +129,7 @@ type RunnerDetails struct { // // GitLab API docs: https://docs.gitlab.com/api/runners/ type RunnerDetailsProject struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` NameWithNamespace string `json:"name_with_namespace"` Path string `json:"path"` @@ -140,7 +140,7 @@ type RunnerDetailsProject struct { // // GitLab API docs: https://docs.gitlab.com/api/runners/ type RunnerDetailsGroup struct { - ID int `json:"id"` + ID int64 `json:"id"` Name string `json:"name"` WebURL string `json:"web_url"` } @@ -235,7 +235,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 @@ -361,7 +361,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. @@ -393,7 +393,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) { project, err := parseID(pid) if err != nil { return nil, err @@ -460,7 +460,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 @@ -525,7 +525,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) { req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("runners/%d", rid), nil, options) if err != nil { return nil, err @@ -642,7 +642,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) { u := fmt.Sprintf("runners/%d/reset_authentication_token", rid) req, err := s.client.NewRequest(http.MethodPost, u, nil, options) if err != nil { diff --git a/runners_test.go b/runners_test.go index 2729af69..f9c8fda6 100644 --- a/runners_test.go +++ b/runners_test.go @@ -288,7 +288,7 @@ func TestRegisterNewRunnerInfo(t *testing.T) { Active: Ptr(true), Locked: Ptr(true), RunUntagged: Ptr(false), - MaximumTimeout: Ptr(45), + MaximumTimeout: Ptr(int64(45)), } runner, resp, err := client.Runners.RegisterNewRunner(opt, nil) if err != nil { @@ -346,7 +346,7 @@ func TestDeleteRegisteredRunnerByID(t *testing.T) { w.WriteHeader(http.StatusNoContent) }) - rid := 11111 + rid := int64(11111) resp, err := client.Runners.DeleteRegisteredRunnerByID(rid, nil) if err != nil { diff --git a/search.go b/search.go index 580e56ff..33276d59 100644 --- a/search.go +++ b/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/search_test.go b/search_test.go index 500d4523..fd2a7e0a 100644 --- a/search_test.go +++ b/search_test.go @@ -102,7 +102,7 @@ func TestSearchService_Users(t *testing.T) { assert.NoError(t, err) assert.Len(t, users, 1) - assert.Equal(t, 2, users[0].ID) + assert.Equal(t, int64(2), users[0].ID) }) } diff --git a/secure_files.go b/secure_files.go index bf1f1089..a0f96d1a 100644 --- a/secure_files.go +++ b/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"` @@ -135,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 @@ -194,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 @@ -219,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/services.go b/services.go index 98ad3ed5..32b89235 100644 --- a/services.go +++ b/services.go @@ -1229,7 +1229,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 +1264,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 +1308,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"` diff --git a/services_test.go b/services_test.go index 442383e0..3a796ca6 100644 --- a/services_test.go +++ b/services_test.go @@ -560,7 +560,7 @@ func TestSetJiraServiceAuthTypeBasicAuth(t *testing.T) { URL: Ptr("asd"), Username: Ptr("aas"), Password: Ptr("asd"), - JiraAuthType: Ptr(0), + JiraAuthType: Ptr(int64(0)), } _, resp, err := client.Services.SetJiraService(1, opt) @@ -580,7 +580,7 @@ func TestSetJiraServiceAuthTypeTokenAuth(t *testing.T) { opt := &SetJiraServiceOptions{ URL: Ptr("asd"), Password: Ptr("asd"), - JiraAuthType: Ptr(1), + JiraAuthType: Ptr(int64(1)), } _, resp, err := client.Services.SetJiraService(1, opt) diff --git a/settings.go b/settings.go index 9e798169..ef3d769f 100644 --- a/settings.go +++ b/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/settings_test.go b/settings_test.go index c182563e..25393df2 100644 --- a/settings_test.go +++ b/settings_test.go @@ -56,7 +56,7 @@ func TestUpdateSettings(t *testing.T) { }) options := &UpdateSettingsOptions{ - DefaultProjectsLimit: Ptr(100), + DefaultProjectsLimit: Ptr(int64(100)), } settings, _, err := client.Settings.UpdateSettings(options) if err != nil { diff --git a/sidekiq_metrics.go b/sidekiq_metrics.go index 2650ae20..cc7296f1 100644 --- a/sidekiq_metrics.go +++ b/sidekiq_metrics.go @@ -52,8 +52,8 @@ type QueueMetrics struct { // GitLab API docs: // https://docs.gitlab.com/api/sidekiq_metrics/#get-the-current-queue-metrics type QueueMetricsQueue struct { - Backlog int `json:"backlog"` - Latency int `json:"latency"` + Backlog int64 `json:"backlog"` + Latency int64 `json:"latency"` } // GetQueueMetrics lists information about all the registered queues, @@ -90,13 +90,13 @@ type ProcessMetrics struct { // https://docs.gitlab.com/api/sidekiq_metrics/#get-the-current-process-metrics type ProcessMetricsProcess struct { Hostname string `json:"hostname"` - Pid int `json:"pid"` + Pid int64 `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"` + Concurrency int64 `json:"concurrency"` + Busy int64 `json:"busy"` } // GetProcessMetrics lists information about all the Sidekiq workers registered @@ -132,9 +132,9 @@ type JobStats struct { // GitLab API docs: // https://docs.gitlab.com/api/sidekiq_metrics/#get-the-current-job-statistics type JobStatsJobs struct { - Processed int `json:"processed"` - Failed int `json:"failed"` - Enqueued int `json:"enqueued"` + 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/snippet_repository_storage_move.go b/snippet_repository_storage_move.go index 911584d5..aa2eba69 100644 --- a/snippet_repository_storage_move.go +++ b/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"` @@ -106,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) @@ -127,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) @@ -148,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) @@ -178,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/snippets.go b/snippets.go index 0fbb1500..dabb25aa 100644 --- a/snippets.go +++ b/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,7 +51,7 @@ var _ SnippetsServiceInterface = (*SnippetsService)(nil) // // GitLab API docs: https://docs.gitlab.com/api/snippets/ type Snippet struct { - ID int `json:"id"` + ID int64 `json:"id"` Title string `json:"title"` FileName string `json:"file_name"` Description string `json:"description"` @@ -59,7 +59,7 @@ type Snippet struct { Author SnippetAuthor `json:"author"` 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"` Files []SnippetFile `json:"files"` @@ -74,7 +74,7 @@ func (s Snippet) String() string { // // GitLab API docs: https://docs.gitlab.com/api/snippets/ type SnippetAuthor struct { - ID int `json:"id"` + ID int64 `json:"id"` Username string `json:"username"` Email string `json:"email"` Name string `json:"name"` @@ -129,7 +129,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) { u := fmt.Sprintf("snippets/%d", snippet) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -150,7 +150,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) @@ -171,7 +171,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) @@ -260,7 +260,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) { u := fmt.Sprintf("snippets/%d", snippet) req, err := s.client.NewRequest(http.MethodPut, u, opt, options) @@ -283,7 +283,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) { u := fmt.Sprintf("snippets/%d", snippet) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) diff --git a/system_hooks.go b/system_hooks.go index 3f778ec0..a74914f9 100644 --- a/system_hooks.go +++ b/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/tags.go b/tags.go index 8a8c40c7..5df51a3e 100644 --- a/tags.go +++ b/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,7 +77,7 @@ 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"` diff --git a/testing/enterprise_users_mock.go b/testing/enterprise_users_mock.go index 727d70e2..c6cd83c9 100644 --- a/testing/enterprise_users_mock.go +++ b/testing/enterprise_users_mock.go @@ -41,7 +41,7 @@ func (m *MockEnterpriseUsersServiceInterface) EXPECT() *MockEnterpriseUsersServi } // DeleteEnterpriseUser mocks base method. -func (m *MockEnterpriseUsersServiceInterface) DeleteEnterpriseUser(gid any, uid int, deleteOptions *gitlab.DeleteEnterpriseUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockEnterpriseUsersServiceInterface) DeleteEnterpriseUser(gid any, uid int64, deleteOptions *gitlab.DeleteEnterpriseUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, uid, deleteOptions} for _, a := range options { @@ -73,13 +73,13 @@ func (c *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall) Do(f func(any, int, *gitlab.DeleteEnterpriseUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall { +func (c *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall) Do(f func(any, int64, *gitlab.DeleteEnterpriseUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall) DoAndReturn(f func(any, int, *gitlab.DeleteEnterpriseUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall { +func (c *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall) DoAndReturn(f func(any, int64, *gitlab.DeleteEnterpriseUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockEnterpriseUsersServiceInterfaceDeleteEnterpriseUserCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/job_token_scope_mock.go b/testing/job_token_scope_mock.go index 1ca888b5..b6da8b2d 100644 --- a/testing/job_token_scope_mock.go +++ b/testing/job_token_scope_mock.go @@ -310,7 +310,7 @@ func (c *MockJobTokenScopeServiceInterfacePatchProjectJobTokenAccessSettingsCall } // RemoveGroupFromJobTokenAllowlist mocks base method. -func (m *MockJobTokenScopeServiceInterface) RemoveGroupFromJobTokenAllowlist(pid any, targetGroup int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockJobTokenScopeServiceInterface) RemoveGroupFromJobTokenAllowlist(pid any, targetGroup int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, targetGroup} for _, a := range options { @@ -342,19 +342,19 @@ func (c *MockJobTokenScopeServiceInterfaceRemoveGroupFromJobTokenAllowlistCall) } // Do rewrite *gomock.Call.Do -func (c *MockJobTokenScopeServiceInterfaceRemoveGroupFromJobTokenAllowlistCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobTokenScopeServiceInterfaceRemoveGroupFromJobTokenAllowlistCall { +func (c *MockJobTokenScopeServiceInterfaceRemoveGroupFromJobTokenAllowlistCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobTokenScopeServiceInterfaceRemoveGroupFromJobTokenAllowlistCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobTokenScopeServiceInterfaceRemoveGroupFromJobTokenAllowlistCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobTokenScopeServiceInterfaceRemoveGroupFromJobTokenAllowlistCall { +func (c *MockJobTokenScopeServiceInterfaceRemoveGroupFromJobTokenAllowlistCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobTokenScopeServiceInterfaceRemoveGroupFromJobTokenAllowlistCall { c.Call = c.Call.DoAndReturn(f) return c } // RemoveProjectFromJobScopeAllowList mocks base method. -func (m *MockJobTokenScopeServiceInterface) RemoveProjectFromJobScopeAllowList(pid any, targetProject int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockJobTokenScopeServiceInterface) RemoveProjectFromJobScopeAllowList(pid any, targetProject int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, targetProject} for _, a := range options { @@ -386,13 +386,13 @@ func (c *MockJobTokenScopeServiceInterfaceRemoveProjectFromJobScopeAllowListCall } // Do rewrite *gomock.Call.Do -func (c *MockJobTokenScopeServiceInterfaceRemoveProjectFromJobScopeAllowListCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobTokenScopeServiceInterfaceRemoveProjectFromJobScopeAllowListCall { +func (c *MockJobTokenScopeServiceInterfaceRemoveProjectFromJobScopeAllowListCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobTokenScopeServiceInterfaceRemoveProjectFromJobScopeAllowListCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobTokenScopeServiceInterfaceRemoveProjectFromJobScopeAllowListCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobTokenScopeServiceInterfaceRemoveProjectFromJobScopeAllowListCall { +func (c *MockJobTokenScopeServiceInterfaceRemoveProjectFromJobScopeAllowListCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobTokenScopeServiceInterfaceRemoveProjectFromJobScopeAllowListCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/jobs_mock.go b/testing/jobs_mock.go index 08ca53b7..4695207f 100644 --- a/testing/jobs_mock.go +++ b/testing/jobs_mock.go @@ -42,7 +42,7 @@ func (m *MockJobsServiceInterface) EXPECT() *MockJobsServiceInterfaceMockRecorde } // CancelJob mocks base method. -func (m *MockJobsServiceInterface) CancelJob(pid any, jobID int, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) CancelJob(pid any, jobID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, jobID} for _, a := range options { @@ -75,19 +75,19 @@ func (c *MockJobsServiceInterfaceCancelJobCall) Return(arg0 *gitlab.Job, arg1 *g } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceCancelJobCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceCancelJobCall { +func (c *MockJobsServiceInterfaceCancelJobCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceCancelJobCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceCancelJobCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceCancelJobCall { +func (c *MockJobsServiceInterfaceCancelJobCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceCancelJobCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteArtifacts mocks base method. -func (m *MockJobsServiceInterface) DeleteArtifacts(pid any, jobID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockJobsServiceInterface) DeleteArtifacts(pid any, jobID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, jobID} for _, a := range options { @@ -119,13 +119,13 @@ func (c *MockJobsServiceInterfaceDeleteArtifactsCall) Return(arg0 *gitlab.Respon } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceDeleteArtifactsCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobsServiceInterfaceDeleteArtifactsCall { +func (c *MockJobsServiceInterfaceDeleteArtifactsCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobsServiceInterfaceDeleteArtifactsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceDeleteArtifactsCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobsServiceInterfaceDeleteArtifactsCall { +func (c *MockJobsServiceInterfaceDeleteArtifactsCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockJobsServiceInterfaceDeleteArtifactsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -220,7 +220,7 @@ func (c *MockJobsServiceInterfaceDownloadArtifactsFileCall) DoAndReturn(f func(a } // DownloadSingleArtifactsFile mocks base method. -func (m *MockJobsServiceInterface) DownloadSingleArtifactsFile(pid any, jobID int, artifactPath string, options ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) DownloadSingleArtifactsFile(pid any, jobID int64, artifactPath string, options ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, jobID, artifactPath} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockJobsServiceInterfaceDownloadSingleArtifactsFileCall) Return(arg0 *b } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceDownloadSingleArtifactsFileCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceDownloadSingleArtifactsFileCall { +func (c *MockJobsServiceInterfaceDownloadSingleArtifactsFileCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceDownloadSingleArtifactsFileCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceDownloadSingleArtifactsFileCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceDownloadSingleArtifactsFileCall { +func (c *MockJobsServiceInterfaceDownloadSingleArtifactsFileCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceDownloadSingleArtifactsFileCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -310,7 +310,7 @@ func (c *MockJobsServiceInterfaceDownloadSingleArtifactsFileByTagOrBranchCall) D } // EraseJob mocks base method. -func (m *MockJobsServiceInterface) EraseJob(pid any, jobID int, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) EraseJob(pid any, jobID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, jobID} for _, a := range options { @@ -343,19 +343,19 @@ func (c *MockJobsServiceInterfaceEraseJobCall) Return(arg0 *gitlab.Job, arg1 *gi } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceEraseJobCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceEraseJobCall { +func (c *MockJobsServiceInterfaceEraseJobCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceEraseJobCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceEraseJobCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceEraseJobCall { +func (c *MockJobsServiceInterfaceEraseJobCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceEraseJobCall { c.Call = c.Call.DoAndReturn(f) return c } // GetJob mocks base method. -func (m *MockJobsServiceInterface) GetJob(pid any, jobID int, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) GetJob(pid any, jobID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, jobID} for _, a := range options { @@ -388,19 +388,19 @@ func (c *MockJobsServiceInterfaceGetJobCall) Return(arg0 *gitlab.Job, arg1 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceGetJobCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceGetJobCall { +func (c *MockJobsServiceInterfaceGetJobCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceGetJobCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceGetJobCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceGetJobCall { +func (c *MockJobsServiceInterfaceGetJobCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceGetJobCall { c.Call = c.Call.DoAndReturn(f) return c } // GetJobArtifacts mocks base method. -func (m *MockJobsServiceInterface) GetJobArtifacts(pid any, jobID int, options ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) GetJobArtifacts(pid any, jobID int64, options ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, jobID} for _, a := range options { @@ -433,13 +433,13 @@ func (c *MockJobsServiceInterfaceGetJobArtifactsCall) Return(arg0 *bytes.Reader, } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceGetJobArtifactsCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceGetJobArtifactsCall { +func (c *MockJobsServiceInterfaceGetJobArtifactsCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceGetJobArtifactsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceGetJobArtifactsCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceGetJobArtifactsCall { +func (c *MockJobsServiceInterfaceGetJobArtifactsCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceGetJobArtifactsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -490,7 +490,7 @@ func (c *MockJobsServiceInterfaceGetJobTokensJobCall) DoAndReturn(f func(*gitlab } // GetTraceFile mocks base method. -func (m *MockJobsServiceInterface) GetTraceFile(pid any, jobID int, options ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) GetTraceFile(pid any, jobID int64, options ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, jobID} for _, a := range options { @@ -523,19 +523,19 @@ func (c *MockJobsServiceInterfaceGetTraceFileCall) Return(arg0 *bytes.Reader, ar } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceGetTraceFileCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceGetTraceFileCall { +func (c *MockJobsServiceInterfaceGetTraceFileCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceGetTraceFileCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceGetTraceFileCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceGetTraceFileCall { +func (c *MockJobsServiceInterfaceGetTraceFileCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*bytes.Reader, *gitlab.Response, error)) *MockJobsServiceInterfaceGetTraceFileCall { c.Call = c.Call.DoAndReturn(f) return c } // KeepArtifacts mocks base method. -func (m *MockJobsServiceInterface) KeepArtifacts(pid any, jobID int, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) KeepArtifacts(pid any, jobID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, jobID} for _, a := range options { @@ -568,19 +568,19 @@ func (c *MockJobsServiceInterfaceKeepArtifactsCall) Return(arg0 *gitlab.Job, arg } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceKeepArtifactsCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceKeepArtifactsCall { +func (c *MockJobsServiceInterfaceKeepArtifactsCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceKeepArtifactsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceKeepArtifactsCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceKeepArtifactsCall { +func (c *MockJobsServiceInterfaceKeepArtifactsCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceKeepArtifactsCall { c.Call = c.Call.DoAndReturn(f) return c } // ListPipelineBridges mocks base method. -func (m *MockJobsServiceInterface) ListPipelineBridges(pid any, pipelineID int, opts *gitlab.ListJobsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Bridge, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) ListPipelineBridges(pid any, pipelineID int64, opts *gitlab.ListJobsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Bridge, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pipelineID, opts} for _, a := range options { @@ -613,19 +613,19 @@ func (c *MockJobsServiceInterfaceListPipelineBridgesCall) Return(arg0 []*gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceListPipelineBridgesCall) Do(f func(any, int, *gitlab.ListJobsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Bridge, *gitlab.Response, error)) *MockJobsServiceInterfaceListPipelineBridgesCall { +func (c *MockJobsServiceInterfaceListPipelineBridgesCall) Do(f func(any, int64, *gitlab.ListJobsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Bridge, *gitlab.Response, error)) *MockJobsServiceInterfaceListPipelineBridgesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceListPipelineBridgesCall) DoAndReturn(f func(any, int, *gitlab.ListJobsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Bridge, *gitlab.Response, error)) *MockJobsServiceInterfaceListPipelineBridgesCall { +func (c *MockJobsServiceInterfaceListPipelineBridgesCall) DoAndReturn(f func(any, int64, *gitlab.ListJobsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Bridge, *gitlab.Response, error)) *MockJobsServiceInterfaceListPipelineBridgesCall { c.Call = c.Call.DoAndReturn(f) return c } // ListPipelineJobs mocks base method. -func (m *MockJobsServiceInterface) ListPipelineJobs(pid any, pipelineID int, opts *gitlab.ListJobsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Job, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) ListPipelineJobs(pid any, pipelineID int64, opts *gitlab.ListJobsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Job, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pipelineID, opts} for _, a := range options { @@ -658,13 +658,13 @@ func (c *MockJobsServiceInterfaceListPipelineJobsCall) Return(arg0 []*gitlab.Job } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceListPipelineJobsCall) Do(f func(any, int, *gitlab.ListJobsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceListPipelineJobsCall { +func (c *MockJobsServiceInterfaceListPipelineJobsCall) Do(f func(any, int64, *gitlab.ListJobsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceListPipelineJobsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceListPipelineJobsCall) DoAndReturn(f func(any, int, *gitlab.ListJobsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceListPipelineJobsCall { +func (c *MockJobsServiceInterfaceListPipelineJobsCall) DoAndReturn(f func(any, int64, *gitlab.ListJobsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceListPipelineJobsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -715,7 +715,7 @@ func (c *MockJobsServiceInterfaceListProjectJobsCall) DoAndReturn(f func(any, *g } // PlayJob mocks base method. -func (m *MockJobsServiceInterface) PlayJob(pid any, jobID int, opt *gitlab.PlayJobOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) PlayJob(pid any, jobID int64, opt *gitlab.PlayJobOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, jobID, opt} for _, a := range options { @@ -748,19 +748,19 @@ func (c *MockJobsServiceInterfacePlayJobCall) Return(arg0 *gitlab.Job, arg1 *git } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfacePlayJobCall) Do(f func(any, int, *gitlab.PlayJobOptions, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfacePlayJobCall { +func (c *MockJobsServiceInterfacePlayJobCall) Do(f func(any, int64, *gitlab.PlayJobOptions, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfacePlayJobCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfacePlayJobCall) DoAndReturn(f func(any, int, *gitlab.PlayJobOptions, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfacePlayJobCall { +func (c *MockJobsServiceInterfacePlayJobCall) DoAndReturn(f func(any, int64, *gitlab.PlayJobOptions, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfacePlayJobCall { c.Call = c.Call.DoAndReturn(f) return c } // RetryJob mocks base method. -func (m *MockJobsServiceInterface) RetryJob(pid any, jobID int, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { +func (m *MockJobsServiceInterface) RetryJob(pid any, jobID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, jobID} for _, a := range options { @@ -793,13 +793,13 @@ func (c *MockJobsServiceInterfaceRetryJobCall) Return(arg0 *gitlab.Job, arg1 *gi } // Do rewrite *gomock.Call.Do -func (c *MockJobsServiceInterfaceRetryJobCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceRetryJobCall { +func (c *MockJobsServiceInterfaceRetryJobCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceRetryJobCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockJobsServiceInterfaceRetryJobCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceRetryJobCall { +func (c *MockJobsServiceInterfaceRetryJobCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Job, *gitlab.Response, error)) *MockJobsServiceInterfaceRetryJobCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/keys_mock.go b/testing/keys_mock.go index a92c9679..da3c34e1 100644 --- a/testing/keys_mock.go +++ b/testing/keys_mock.go @@ -86,7 +86,7 @@ func (c *MockKeysServiceInterfaceGetKeyByFingerprintCall) DoAndReturn(f func(*gi } // GetKeyWithUser mocks base method. -func (m *MockKeysServiceInterface) GetKeyWithUser(key int, options ...gitlab.RequestOptionFunc) (*gitlab.Key, *gitlab.Response, error) { +func (m *MockKeysServiceInterface) GetKeyWithUser(key int64, options ...gitlab.RequestOptionFunc) (*gitlab.Key, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{key} for _, a := range options { @@ -119,13 +119,13 @@ func (c *MockKeysServiceInterfaceGetKeyWithUserCall) Return(arg0 *gitlab.Key, ar } // Do rewrite *gomock.Call.Do -func (c *MockKeysServiceInterfaceGetKeyWithUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Key, *gitlab.Response, error)) *MockKeysServiceInterfaceGetKeyWithUserCall { +func (c *MockKeysServiceInterfaceGetKeyWithUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Key, *gitlab.Response, error)) *MockKeysServiceInterfaceGetKeyWithUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockKeysServiceInterfaceGetKeyWithUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Key, *gitlab.Response, error)) *MockKeysServiceInterfaceGetKeyWithUserCall { +func (c *MockKeysServiceInterfaceGetKeyWithUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Key, *gitlab.Response, error)) *MockKeysServiceInterfaceGetKeyWithUserCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/license_mock.go b/testing/license_mock.go index 36c312cf..81c7ac8b 100644 --- a/testing/license_mock.go +++ b/testing/license_mock.go @@ -86,7 +86,7 @@ func (c *MockLicenseServiceInterfaceAddLicenseCall) DoAndReturn(f func(*gitlab.A } // DeleteLicense mocks base method. -func (m *MockLicenseServiceInterface) DeleteLicense(licenseID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockLicenseServiceInterface) DeleteLicense(licenseID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{licenseID} for _, a := range options { @@ -118,13 +118,13 @@ func (c *MockLicenseServiceInterfaceDeleteLicenseCall) Return(arg0 *gitlab.Respo } // Do rewrite *gomock.Call.Do -func (c *MockLicenseServiceInterfaceDeleteLicenseCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockLicenseServiceInterfaceDeleteLicenseCall { +func (c *MockLicenseServiceInterfaceDeleteLicenseCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockLicenseServiceInterfaceDeleteLicenseCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockLicenseServiceInterfaceDeleteLicenseCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockLicenseServiceInterfaceDeleteLicenseCall { +func (c *MockLicenseServiceInterfaceDeleteLicenseCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockLicenseServiceInterfaceDeleteLicenseCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/member_roles_mock.go b/testing/member_roles_mock.go index fd4d0338..2263edae 100644 --- a/testing/member_roles_mock.go +++ b/testing/member_roles_mock.go @@ -131,7 +131,7 @@ func (c *MockMemberRolesServiceInterfaceCreateMemberRoleCall) DoAndReturn(f func } // DeleteInstanceMemberRole mocks base method. -func (m *MockMemberRolesServiceInterface) DeleteInstanceMemberRole(memberRoleID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockMemberRolesServiceInterface) DeleteInstanceMemberRole(memberRoleID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{memberRoleID} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockMemberRolesServiceInterfaceDeleteInstanceMemberRoleCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockMemberRolesServiceInterfaceDeleteInstanceMemberRoleCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMemberRolesServiceInterfaceDeleteInstanceMemberRoleCall { +func (c *MockMemberRolesServiceInterfaceDeleteInstanceMemberRoleCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMemberRolesServiceInterfaceDeleteInstanceMemberRoleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMemberRolesServiceInterfaceDeleteInstanceMemberRoleCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMemberRolesServiceInterfaceDeleteInstanceMemberRoleCall { +func (c *MockMemberRolesServiceInterfaceDeleteInstanceMemberRoleCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMemberRolesServiceInterfaceDeleteInstanceMemberRoleCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteMemberRole mocks base method. -func (m *MockMemberRolesServiceInterface) DeleteMemberRole(gid any, memberRole int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockMemberRolesServiceInterface) DeleteMemberRole(gid any, memberRole int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, memberRole} for _, a := range options { @@ -207,13 +207,13 @@ func (c *MockMemberRolesServiceInterfaceDeleteMemberRoleCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockMemberRolesServiceInterfaceDeleteMemberRoleCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMemberRolesServiceInterfaceDeleteMemberRoleCall { +func (c *MockMemberRolesServiceInterfaceDeleteMemberRoleCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMemberRolesServiceInterfaceDeleteMemberRoleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMemberRolesServiceInterfaceDeleteMemberRoleCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMemberRolesServiceInterfaceDeleteMemberRoleCall { +func (c *MockMemberRolesServiceInterfaceDeleteMemberRoleCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMemberRolesServiceInterfaceDeleteMemberRoleCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/merge_request_approvals_mock.go b/testing/merge_request_approvals_mock.go index 426ae38e..350a9760 100644 --- a/testing/merge_request_approvals_mock.go +++ b/testing/merge_request_approvals_mock.go @@ -41,7 +41,7 @@ func (m *MockMergeRequestApprovalsServiceInterface) EXPECT() *MockMergeRequestAp } // ApproveMergeRequest mocks base method. -func (m *MockMergeRequestApprovalsServiceInterface) ApproveMergeRequest(pid any, mr int, opt *gitlab.ApproveMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error) { +func (m *MockMergeRequestApprovalsServiceInterface) ApproveMergeRequest(pid any, mr int64, opt *gitlab.ApproveMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mr, opt} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockMergeRequestApprovalsServiceInterfaceApproveMergeRequestCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalsServiceInterfaceApproveMergeRequestCall) Do(f func(any, int, *gitlab.ApproveMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceApproveMergeRequestCall { +func (c *MockMergeRequestApprovalsServiceInterfaceApproveMergeRequestCall) Do(f func(any, int64, *gitlab.ApproveMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceApproveMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalsServiceInterfaceApproveMergeRequestCall) DoAndReturn(f func(any, int, *gitlab.ApproveMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceApproveMergeRequestCall { +func (c *MockMergeRequestApprovalsServiceInterfaceApproveMergeRequestCall) DoAndReturn(f func(any, int64, *gitlab.ApproveMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceApproveMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // ChangeApprovalConfiguration mocks base method. -func (m *MockMergeRequestApprovalsServiceInterface) ChangeApprovalConfiguration(pid any, mergeRequest int, opt *gitlab.ChangeMergeRequestApprovalConfigurationOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { +func (m *MockMergeRequestApprovalsServiceInterface) ChangeApprovalConfiguration(pid any, mergeRequest int64, opt *gitlab.ChangeMergeRequestApprovalConfigurationOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockMergeRequestApprovalsServiceInterfaceChangeApprovalConfigurationCal } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalsServiceInterfaceChangeApprovalConfigurationCall) Do(f func(any, int, *gitlab.ChangeMergeRequestApprovalConfigurationOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceChangeApprovalConfigurationCall { +func (c *MockMergeRequestApprovalsServiceInterfaceChangeApprovalConfigurationCall) Do(f func(any, int64, *gitlab.ChangeMergeRequestApprovalConfigurationOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceChangeApprovalConfigurationCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalsServiceInterfaceChangeApprovalConfigurationCall) DoAndReturn(f func(any, int, *gitlab.ChangeMergeRequestApprovalConfigurationOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceChangeApprovalConfigurationCall { +func (c *MockMergeRequestApprovalsServiceInterfaceChangeApprovalConfigurationCall) DoAndReturn(f func(any, int64, *gitlab.ChangeMergeRequestApprovalConfigurationOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceChangeApprovalConfigurationCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateApprovalRule mocks base method. -func (m *MockMergeRequestApprovalsServiceInterface) CreateApprovalRule(pid any, mergeRequest int, opt *gitlab.CreateMergeRequestApprovalRuleOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error) { +func (m *MockMergeRequestApprovalsServiceInterface) CreateApprovalRule(pid any, mergeRequest int64, opt *gitlab.CreateMergeRequestApprovalRuleOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockMergeRequestApprovalsServiceInterfaceCreateApprovalRuleCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalsServiceInterfaceCreateApprovalRuleCall) Do(f func(any, int, *gitlab.CreateMergeRequestApprovalRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceCreateApprovalRuleCall { +func (c *MockMergeRequestApprovalsServiceInterfaceCreateApprovalRuleCall) Do(f func(any, int64, *gitlab.CreateMergeRequestApprovalRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceCreateApprovalRuleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalsServiceInterfaceCreateApprovalRuleCall) DoAndReturn(f func(any, int, *gitlab.CreateMergeRequestApprovalRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceCreateApprovalRuleCall { +func (c *MockMergeRequestApprovalsServiceInterfaceCreateApprovalRuleCall) DoAndReturn(f func(any, int64, *gitlab.CreateMergeRequestApprovalRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceCreateApprovalRuleCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteApprovalRule mocks base method. -func (m *MockMergeRequestApprovalsServiceInterface) DeleteApprovalRule(pid any, mergeRequest, approvalRule int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockMergeRequestApprovalsServiceInterface) DeleteApprovalRule(pid any, mergeRequest, approvalRule int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, approvalRule} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockMergeRequestApprovalsServiceInterfaceDeleteApprovalRuleCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalsServiceInterfaceDeleteApprovalRuleCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceDeleteApprovalRuleCall { +func (c *MockMergeRequestApprovalsServiceInterfaceDeleteApprovalRuleCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceDeleteApprovalRuleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalsServiceInterfaceDeleteApprovalRuleCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceDeleteApprovalRuleCall { +func (c *MockMergeRequestApprovalsServiceInterfaceDeleteApprovalRuleCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceDeleteApprovalRuleCall { c.Call = c.Call.DoAndReturn(f) return c } // GetApprovalRules mocks base method. -func (m *MockMergeRequestApprovalsServiceInterface) GetApprovalRules(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestApprovalRule, *gitlab.Response, error) { +func (m *MockMergeRequestApprovalsServiceInterface) GetApprovalRules(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestApprovalRule, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -253,19 +253,19 @@ func (c *MockMergeRequestApprovalsServiceInterfaceGetApprovalRulesCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalsServiceInterfaceGetApprovalRulesCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetApprovalRulesCall { +func (c *MockMergeRequestApprovalsServiceInterfaceGetApprovalRulesCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetApprovalRulesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalsServiceInterfaceGetApprovalRulesCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetApprovalRulesCall { +func (c *MockMergeRequestApprovalsServiceInterfaceGetApprovalRulesCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetApprovalRulesCall { c.Call = c.Call.DoAndReturn(f) return c } // GetApprovalState mocks base method. -func (m *MockMergeRequestApprovalsServiceInterface) GetApprovalState(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalState, *gitlab.Response, error) { +func (m *MockMergeRequestApprovalsServiceInterface) GetApprovalState(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalState, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -298,19 +298,19 @@ func (c *MockMergeRequestApprovalsServiceInterfaceGetApprovalStateCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalsServiceInterfaceGetApprovalStateCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalState, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetApprovalStateCall { +func (c *MockMergeRequestApprovalsServiceInterfaceGetApprovalStateCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalState, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetApprovalStateCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalsServiceInterfaceGetApprovalStateCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalState, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetApprovalStateCall { +func (c *MockMergeRequestApprovalsServiceInterfaceGetApprovalStateCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalState, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetApprovalStateCall { c.Call = c.Call.DoAndReturn(f) return c } // GetConfiguration mocks base method. -func (m *MockMergeRequestApprovalsServiceInterface) GetConfiguration(pid any, mr int, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error) { +func (m *MockMergeRequestApprovalsServiceInterface) GetConfiguration(pid any, mr int64, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mr} for _, a := range options { @@ -343,19 +343,19 @@ func (c *MockMergeRequestApprovalsServiceInterfaceGetConfigurationCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalsServiceInterfaceGetConfigurationCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetConfigurationCall { +func (c *MockMergeRequestApprovalsServiceInterfaceGetConfigurationCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetConfigurationCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalsServiceInterfaceGetConfigurationCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetConfigurationCall { +func (c *MockMergeRequestApprovalsServiceInterfaceGetConfigurationCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceGetConfigurationCall { c.Call = c.Call.DoAndReturn(f) return c } // ResetApprovalsOfMergeRequest mocks base method. -func (m *MockMergeRequestApprovalsServiceInterface) ResetApprovalsOfMergeRequest(pid any, mr int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockMergeRequestApprovalsServiceInterface) ResetApprovalsOfMergeRequest(pid any, mr int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mr} for _, a := range options { @@ -387,19 +387,19 @@ func (c *MockMergeRequestApprovalsServiceInterfaceResetApprovalsOfMergeRequestCa } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalsServiceInterfaceResetApprovalsOfMergeRequestCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceResetApprovalsOfMergeRequestCall { +func (c *MockMergeRequestApprovalsServiceInterfaceResetApprovalsOfMergeRequestCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceResetApprovalsOfMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalsServiceInterfaceResetApprovalsOfMergeRequestCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceResetApprovalsOfMergeRequestCall { +func (c *MockMergeRequestApprovalsServiceInterfaceResetApprovalsOfMergeRequestCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceResetApprovalsOfMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // UnapproveMergeRequest mocks base method. -func (m *MockMergeRequestApprovalsServiceInterface) UnapproveMergeRequest(pid any, mr int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockMergeRequestApprovalsServiceInterface) UnapproveMergeRequest(pid any, mr int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mr} for _, a := range options { @@ -431,19 +431,19 @@ func (c *MockMergeRequestApprovalsServiceInterfaceUnapproveMergeRequestCall) Ret } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalsServiceInterfaceUnapproveMergeRequestCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceUnapproveMergeRequestCall { +func (c *MockMergeRequestApprovalsServiceInterfaceUnapproveMergeRequestCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceUnapproveMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalsServiceInterfaceUnapproveMergeRequestCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceUnapproveMergeRequestCall { +func (c *MockMergeRequestApprovalsServiceInterfaceUnapproveMergeRequestCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceUnapproveMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateApprovalRule mocks base method. -func (m *MockMergeRequestApprovalsServiceInterface) UpdateApprovalRule(pid any, mergeRequest, approvalRule int, opt *gitlab.UpdateMergeRequestApprovalRuleOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error) { +func (m *MockMergeRequestApprovalsServiceInterface) UpdateApprovalRule(pid any, mergeRequest, approvalRule int64, opt *gitlab.UpdateMergeRequestApprovalRuleOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, approvalRule, opt} for _, a := range options { @@ -476,13 +476,13 @@ func (c *MockMergeRequestApprovalsServiceInterfaceUpdateApprovalRuleCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestApprovalsServiceInterfaceUpdateApprovalRuleCall) Do(f func(any, int, int, *gitlab.UpdateMergeRequestApprovalRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceUpdateApprovalRuleCall { +func (c *MockMergeRequestApprovalsServiceInterfaceUpdateApprovalRuleCall) Do(f func(any, int64, int64, *gitlab.UpdateMergeRequestApprovalRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceUpdateApprovalRuleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestApprovalsServiceInterfaceUpdateApprovalRuleCall) DoAndReturn(f func(any, int, int, *gitlab.UpdateMergeRequestApprovalRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceUpdateApprovalRuleCall { +func (c *MockMergeRequestApprovalsServiceInterfaceUpdateApprovalRuleCall) DoAndReturn(f func(any, int64, int64, *gitlab.UpdateMergeRequestApprovalRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovalRule, *gitlab.Response, error)) *MockMergeRequestApprovalsServiceInterfaceUpdateApprovalRuleCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/merge_requests_mock.go b/testing/merge_requests_mock.go index f84117b2..ebeecf7d 100644 --- a/testing/merge_requests_mock.go +++ b/testing/merge_requests_mock.go @@ -41,7 +41,7 @@ func (m *MockMergeRequestsServiceInterface) EXPECT() *MockMergeRequestsServiceIn } // AcceptMergeRequest mocks base method. -func (m *MockMergeRequestsServiceInterface) AcceptMergeRequest(pid any, mergeRequest int, opt *gitlab.AcceptMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) AcceptMergeRequest(pid any, mergeRequest int64, opt *gitlab.AcceptMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -74,13 +74,13 @@ func (c *MockMergeRequestsServiceInterfaceAcceptMergeRequestCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceAcceptMergeRequestCall) Do(f func(any, int, *gitlab.AcceptMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceAcceptMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceAcceptMergeRequestCall) Do(f func(any, int64, *gitlab.AcceptMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceAcceptMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceAcceptMergeRequestCall) DoAndReturn(f func(any, int, *gitlab.AcceptMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceAcceptMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceAcceptMergeRequestCall) DoAndReturn(f func(any, int64, *gitlab.AcceptMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceAcceptMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -131,7 +131,7 @@ func (c *MockMergeRequestsServiceInterfaceAddSpentTimeCall) DoAndReturn(f func(a } // CancelMergeWhenPipelineSucceeds mocks base method. -func (m *MockMergeRequestsServiceInterface) CancelMergeWhenPipelineSucceeds(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) CancelMergeWhenPipelineSucceeds(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -164,13 +164,13 @@ func (c *MockMergeRequestsServiceInterfaceCancelMergeWhenPipelineSucceedsCall) R } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceCancelMergeWhenPipelineSucceedsCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCancelMergeWhenPipelineSucceedsCall { +func (c *MockMergeRequestsServiceInterfaceCancelMergeWhenPipelineSucceedsCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCancelMergeWhenPipelineSucceedsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceCancelMergeWhenPipelineSucceedsCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCancelMergeWhenPipelineSucceedsCall { +func (c *MockMergeRequestsServiceInterfaceCancelMergeWhenPipelineSucceedsCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCancelMergeWhenPipelineSucceedsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -221,7 +221,7 @@ func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestCall) DoAndReturn(f } // CreateMergeRequestDependency mocks base method. -func (m *MockMergeRequestsServiceInterface) CreateMergeRequestDependency(pid any, mergeRequest int, opts gitlab.CreateMergeRequestDependencyOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDependency, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) CreateMergeRequestDependency(pid any, mergeRequest int64, opts gitlab.CreateMergeRequestDependencyOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDependency, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opts} for _, a := range options { @@ -254,19 +254,19 @@ func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestDependencyCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestDependencyCall) Do(f func(any, int, gitlab.CreateMergeRequestDependencyOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDependency, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateMergeRequestDependencyCall { +func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestDependencyCall) Do(f func(any, int64, gitlab.CreateMergeRequestDependencyOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDependency, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateMergeRequestDependencyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestDependencyCall) DoAndReturn(f func(any, int, gitlab.CreateMergeRequestDependencyOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDependency, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateMergeRequestDependencyCall { +func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestDependencyCall) DoAndReturn(f func(any, int64, gitlab.CreateMergeRequestDependencyOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDependency, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateMergeRequestDependencyCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateMergeRequestPipeline mocks base method. -func (m *MockMergeRequestsServiceInterface) CreateMergeRequestPipeline(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineInfo, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) CreateMergeRequestPipeline(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineInfo, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -299,19 +299,19 @@ func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestPipelineCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestPipelineCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineInfo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateMergeRequestPipelineCall { +func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestPipelineCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineInfo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateMergeRequestPipelineCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestPipelineCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineInfo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateMergeRequestPipelineCall { +func (c *MockMergeRequestsServiceInterfaceCreateMergeRequestPipelineCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineInfo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateMergeRequestPipelineCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateTodo mocks base method. -func (m *MockMergeRequestsServiceInterface) CreateTodo(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) CreateTodo(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -344,19 +344,19 @@ func (c *MockMergeRequestsServiceInterfaceCreateTodoCall) Return(arg0 *gitlab.To } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceCreateTodoCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateTodoCall { +func (c *MockMergeRequestsServiceInterfaceCreateTodoCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateTodoCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceCreateTodoCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateTodoCall { +func (c *MockMergeRequestsServiceInterfaceCreateTodoCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Todo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceCreateTodoCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteMergeRequest mocks base method. -func (m *MockMergeRequestsServiceInterface) DeleteMergeRequest(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) DeleteMergeRequest(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -388,19 +388,19 @@ func (c *MockMergeRequestsServiceInterfaceDeleteMergeRequestCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceDeleteMergeRequestCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceDeleteMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceDeleteMergeRequestCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceDeleteMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceDeleteMergeRequestCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceDeleteMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceDeleteMergeRequestCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceDeleteMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteMergeRequestDependency mocks base method. -func (m *MockMergeRequestsServiceInterface) DeleteMergeRequestDependency(pid any, mergeRequest, blockingMergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) DeleteMergeRequestDependency(pid any, mergeRequest, blockingMergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, blockingMergeRequest} for _, a := range options { @@ -432,19 +432,19 @@ func (c *MockMergeRequestsServiceInterfaceDeleteMergeRequestDependencyCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceDeleteMergeRequestDependencyCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceDeleteMergeRequestDependencyCall { +func (c *MockMergeRequestsServiceInterfaceDeleteMergeRequestDependencyCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceDeleteMergeRequestDependencyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceDeleteMergeRequestDependencyCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceDeleteMergeRequestDependencyCall { +func (c *MockMergeRequestsServiceInterfaceDeleteMergeRequestDependencyCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceDeleteMergeRequestDependencyCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssuesClosedOnMerge mocks base method. -func (m *MockMergeRequestsServiceInterface) GetIssuesClosedOnMerge(pid any, mergeRequest int, opt *gitlab.GetIssuesClosedOnMergeOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetIssuesClosedOnMerge(pid any, mergeRequest int64, opt *gitlab.GetIssuesClosedOnMergeOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -477,19 +477,19 @@ func (c *MockMergeRequestsServiceInterfaceGetIssuesClosedOnMergeCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetIssuesClosedOnMergeCall) Do(f func(any, int, *gitlab.GetIssuesClosedOnMergeOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetIssuesClosedOnMergeCall { +func (c *MockMergeRequestsServiceInterfaceGetIssuesClosedOnMergeCall) Do(f func(any, int64, *gitlab.GetIssuesClosedOnMergeOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetIssuesClosedOnMergeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetIssuesClosedOnMergeCall) DoAndReturn(f func(any, int, *gitlab.GetIssuesClosedOnMergeOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetIssuesClosedOnMergeCall { +func (c *MockMergeRequestsServiceInterfaceGetIssuesClosedOnMergeCall) DoAndReturn(f func(any, int64, *gitlab.GetIssuesClosedOnMergeOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetIssuesClosedOnMergeCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequest mocks base method. -func (m *MockMergeRequestsServiceInterface) GetMergeRequest(pid any, mergeRequest int, opt *gitlab.GetMergeRequestsOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetMergeRequest(pid any, mergeRequest int64, opt *gitlab.GetMergeRequestsOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -522,19 +522,19 @@ func (c *MockMergeRequestsServiceInterfaceGetMergeRequestCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestCall) Do(f func(any, int, *gitlab.GetMergeRequestsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestCall) Do(f func(any, int64, *gitlab.GetMergeRequestsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestCall) DoAndReturn(f func(any, int, *gitlab.GetMergeRequestsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestCall) DoAndReturn(f func(any, int64, *gitlab.GetMergeRequestsOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestApprovals mocks base method. -func (m *MockMergeRequestsServiceInterface) GetMergeRequestApprovals(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetMergeRequestApprovals(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -567,19 +567,19 @@ func (c *MockMergeRequestsServiceInterfaceGetMergeRequestApprovalsCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestApprovalsCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestApprovalsCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestApprovalsCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestApprovalsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestApprovalsCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestApprovalsCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestApprovalsCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestApprovalsCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestChanges mocks base method. -func (m *MockMergeRequestsServiceInterface) GetMergeRequestChanges(pid any, mergeRequest int, opt *gitlab.GetMergeRequestChangesOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetMergeRequestChanges(pid any, mergeRequest int64, opt *gitlab.GetMergeRequestChangesOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -612,19 +612,19 @@ func (c *MockMergeRequestsServiceInterfaceGetMergeRequestChangesCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestChangesCall) Do(f func(any, int, *gitlab.GetMergeRequestChangesOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestChangesCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestChangesCall) Do(f func(any, int64, *gitlab.GetMergeRequestChangesOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestChangesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestChangesCall) DoAndReturn(f func(any, int, *gitlab.GetMergeRequestChangesOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestChangesCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestChangesCall) DoAndReturn(f func(any, int64, *gitlab.GetMergeRequestChangesOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestChangesCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestCommits mocks base method. -func (m *MockMergeRequestsServiceInterface) GetMergeRequestCommits(pid any, mergeRequest int, opt *gitlab.GetMergeRequestCommitsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Commit, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetMergeRequestCommits(pid any, mergeRequest int64, opt *gitlab.GetMergeRequestCommitsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Commit, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -657,19 +657,19 @@ func (c *MockMergeRequestsServiceInterfaceGetMergeRequestCommitsCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestCommitsCall) Do(f func(any, int, *gitlab.GetMergeRequestCommitsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Commit, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestCommitsCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestCommitsCall) Do(f func(any, int64, *gitlab.GetMergeRequestCommitsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Commit, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestCommitsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestCommitsCall) DoAndReturn(f func(any, int, *gitlab.GetMergeRequestCommitsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Commit, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestCommitsCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestCommitsCall) DoAndReturn(f func(any, int64, *gitlab.GetMergeRequestCommitsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Commit, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestCommitsCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestDependencies mocks base method. -func (m *MockMergeRequestsServiceInterface) GetMergeRequestDependencies(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) ([]gitlab.MergeRequestDependency, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetMergeRequestDependencies(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) ([]gitlab.MergeRequestDependency, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -702,19 +702,19 @@ func (c *MockMergeRequestsServiceInterfaceGetMergeRequestDependenciesCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestDependenciesCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]gitlab.MergeRequestDependency, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestDependenciesCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestDependenciesCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]gitlab.MergeRequestDependency, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestDependenciesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestDependenciesCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]gitlab.MergeRequestDependency, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestDependenciesCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestDependenciesCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]gitlab.MergeRequestDependency, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestDependenciesCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestDiffVersions mocks base method. -func (m *MockMergeRequestsServiceInterface) GetMergeRequestDiffVersions(pid any, mergeRequest int, opt *gitlab.GetMergeRequestDiffVersionsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiffVersion, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetMergeRequestDiffVersions(pid any, mergeRequest int64, opt *gitlab.GetMergeRequestDiffVersionsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiffVersion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -747,19 +747,19 @@ func (c *MockMergeRequestsServiceInterfaceGetMergeRequestDiffVersionsCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestDiffVersionsCall) Do(f func(any, int, *gitlab.GetMergeRequestDiffVersionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiffVersion, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestDiffVersionsCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestDiffVersionsCall) Do(f func(any, int64, *gitlab.GetMergeRequestDiffVersionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiffVersion, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestDiffVersionsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestDiffVersionsCall) DoAndReturn(f func(any, int, *gitlab.GetMergeRequestDiffVersionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiffVersion, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestDiffVersionsCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestDiffVersionsCall) DoAndReturn(f func(any, int64, *gitlab.GetMergeRequestDiffVersionsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiffVersion, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestDiffVersionsCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestParticipants mocks base method. -func (m *MockMergeRequestsServiceInterface) GetMergeRequestParticipants(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetMergeRequestParticipants(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -792,19 +792,19 @@ func (c *MockMergeRequestsServiceInterfaceGetMergeRequestParticipantsCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestParticipantsCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestParticipantsCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestParticipantsCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestParticipantsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestParticipantsCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestParticipantsCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestParticipantsCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicUser, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestParticipantsCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestReviewers mocks base method. -func (m *MockMergeRequestsServiceInterface) GetMergeRequestReviewers(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestReviewer, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetMergeRequestReviewers(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestReviewer, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -837,19 +837,19 @@ func (c *MockMergeRequestsServiceInterfaceGetMergeRequestReviewersCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestReviewersCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestReviewer, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestReviewersCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestReviewersCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestReviewer, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestReviewersCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetMergeRequestReviewersCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestReviewer, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestReviewersCall { +func (c *MockMergeRequestsServiceInterfaceGetMergeRequestReviewersCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestReviewer, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetMergeRequestReviewersCall { c.Call = c.Call.DoAndReturn(f) return c } // GetSingleMergeRequestDiffVersion mocks base method. -func (m *MockMergeRequestsServiceInterface) GetSingleMergeRequestDiffVersion(pid any, mergeRequest, version int, opt *gitlab.GetSingleMergeRequestDiffVersionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDiffVersion, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) GetSingleMergeRequestDiffVersion(pid any, mergeRequest, version int64, opt *gitlab.GetSingleMergeRequestDiffVersionOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDiffVersion, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, version, opt} for _, a := range options { @@ -882,13 +882,13 @@ func (c *MockMergeRequestsServiceInterfaceGetSingleMergeRequestDiffVersionCall) } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceGetSingleMergeRequestDiffVersionCall) Do(f func(any, int, int, *gitlab.GetSingleMergeRequestDiffVersionOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDiffVersion, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetSingleMergeRequestDiffVersionCall { +func (c *MockMergeRequestsServiceInterfaceGetSingleMergeRequestDiffVersionCall) Do(f func(any, int64, int64, *gitlab.GetSingleMergeRequestDiffVersionOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDiffVersion, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetSingleMergeRequestDiffVersionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceGetSingleMergeRequestDiffVersionCall) DoAndReturn(f func(any, int, int, *gitlab.GetSingleMergeRequestDiffVersionOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDiffVersion, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetSingleMergeRequestDiffVersionCall { +func (c *MockMergeRequestsServiceInterfaceGetSingleMergeRequestDiffVersionCall) DoAndReturn(f func(any, int64, int64, *gitlab.GetSingleMergeRequestDiffVersionOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestDiffVersion, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceGetSingleMergeRequestDiffVersionCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -984,7 +984,7 @@ func (c *MockMergeRequestsServiceInterfaceListGroupMergeRequestsCall) DoAndRetur } // ListMergeRequestDiffs mocks base method. -func (m *MockMergeRequestsServiceInterface) ListMergeRequestDiffs(pid any, mergeRequest int, opt *gitlab.ListMergeRequestDiffsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiff, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) ListMergeRequestDiffs(pid any, mergeRequest int64, opt *gitlab.ListMergeRequestDiffsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiff, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -1017,19 +1017,19 @@ func (c *MockMergeRequestsServiceInterfaceListMergeRequestDiffsCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceListMergeRequestDiffsCall) Do(f func(any, int, *gitlab.ListMergeRequestDiffsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiff, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListMergeRequestDiffsCall { +func (c *MockMergeRequestsServiceInterfaceListMergeRequestDiffsCall) Do(f func(any, int64, *gitlab.ListMergeRequestDiffsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiff, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListMergeRequestDiffsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceListMergeRequestDiffsCall) DoAndReturn(f func(any, int, *gitlab.ListMergeRequestDiffsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiff, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListMergeRequestDiffsCall { +func (c *MockMergeRequestsServiceInterfaceListMergeRequestDiffsCall) DoAndReturn(f func(any, int64, *gitlab.ListMergeRequestDiffsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequestDiff, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListMergeRequestDiffsCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMergeRequestPipelines mocks base method. -func (m *MockMergeRequestsServiceInterface) ListMergeRequestPipelines(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineInfo, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) ListMergeRequestPipelines(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineInfo, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -1062,13 +1062,13 @@ func (c *MockMergeRequestsServiceInterfaceListMergeRequestPipelinesCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceListMergeRequestPipelinesCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineInfo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListMergeRequestPipelinesCall { +func (c *MockMergeRequestsServiceInterfaceListMergeRequestPipelinesCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineInfo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListMergeRequestPipelinesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceListMergeRequestPipelinesCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineInfo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListMergeRequestPipelinesCall { +func (c *MockMergeRequestsServiceInterfaceListMergeRequestPipelinesCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineInfo, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListMergeRequestPipelinesCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1164,7 +1164,7 @@ func (c *MockMergeRequestsServiceInterfaceListProjectMergeRequestsCall) DoAndRet } // ListRelatedIssues mocks base method. -func (m *MockMergeRequestsServiceInterface) ListRelatedIssues(pid any, mergeRequest int, opt *gitlab.ListRelatedIssuesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) ListRelatedIssues(pid any, mergeRequest int64, opt *gitlab.ListRelatedIssuesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -1197,19 +1197,19 @@ func (c *MockMergeRequestsServiceInterfaceListRelatedIssuesCall) Return(arg0 []* } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceListRelatedIssuesCall) Do(f func(any, int, *gitlab.ListRelatedIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListRelatedIssuesCall { +func (c *MockMergeRequestsServiceInterfaceListRelatedIssuesCall) Do(f func(any, int64, *gitlab.ListRelatedIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListRelatedIssuesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceListRelatedIssuesCall) DoAndReturn(f func(any, int, *gitlab.ListRelatedIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListRelatedIssuesCall { +func (c *MockMergeRequestsServiceInterfaceListRelatedIssuesCall) DoAndReturn(f func(any, int64, *gitlab.ListRelatedIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceListRelatedIssuesCall { c.Call = c.Call.DoAndReturn(f) return c } // RebaseMergeRequest mocks base method. -func (m *MockMergeRequestsServiceInterface) RebaseMergeRequest(pid any, mergeRequest int, opt *gitlab.RebaseMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) RebaseMergeRequest(pid any, mergeRequest int64, opt *gitlab.RebaseMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -1241,13 +1241,13 @@ func (c *MockMergeRequestsServiceInterfaceRebaseMergeRequestCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceRebaseMergeRequestCall) Do(f func(any, int, *gitlab.RebaseMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceRebaseMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceRebaseMergeRequestCall) Do(f func(any, int64, *gitlab.RebaseMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceRebaseMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceRebaseMergeRequestCall) DoAndReturn(f func(any, int, *gitlab.RebaseMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceRebaseMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceRebaseMergeRequestCall) DoAndReturn(f func(any, int64, *gitlab.RebaseMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMergeRequestsServiceInterfaceRebaseMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1388,7 +1388,7 @@ func (c *MockMergeRequestsServiceInterfaceSetTimeEstimateCall) DoAndReturn(f fun } // ShowMergeRequestRawDiffs mocks base method. -func (m *MockMergeRequestsServiceInterface) ShowMergeRequestRawDiffs(pid any, mergeRequest int, opt *gitlab.ShowMergeRequestRawDiffsOptions, options ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) ShowMergeRequestRawDiffs(pid any, mergeRequest int64, opt *gitlab.ShowMergeRequestRawDiffsOptions, options ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -1421,19 +1421,19 @@ func (c *MockMergeRequestsServiceInterfaceShowMergeRequestRawDiffsCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceShowMergeRequestRawDiffsCall) Do(f func(any, int, *gitlab.ShowMergeRequestRawDiffsOptions, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceShowMergeRequestRawDiffsCall { +func (c *MockMergeRequestsServiceInterfaceShowMergeRequestRawDiffsCall) Do(f func(any, int64, *gitlab.ShowMergeRequestRawDiffsOptions, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceShowMergeRequestRawDiffsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceShowMergeRequestRawDiffsCall) DoAndReturn(f func(any, int, *gitlab.ShowMergeRequestRawDiffsOptions, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceShowMergeRequestRawDiffsCall { +func (c *MockMergeRequestsServiceInterfaceShowMergeRequestRawDiffsCall) DoAndReturn(f func(any, int64, *gitlab.ShowMergeRequestRawDiffsOptions, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceShowMergeRequestRawDiffsCall { c.Call = c.Call.DoAndReturn(f) return c } // SubscribeToMergeRequest mocks base method. -func (m *MockMergeRequestsServiceInterface) SubscribeToMergeRequest(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) SubscribeToMergeRequest(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -1466,19 +1466,19 @@ func (c *MockMergeRequestsServiceInterfaceSubscribeToMergeRequestCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceSubscribeToMergeRequestCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceSubscribeToMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceSubscribeToMergeRequestCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceSubscribeToMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceSubscribeToMergeRequestCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceSubscribeToMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceSubscribeToMergeRequestCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceSubscribeToMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // UnsubscribeFromMergeRequest mocks base method. -func (m *MockMergeRequestsServiceInterface) UnsubscribeFromMergeRequest(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) UnsubscribeFromMergeRequest(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -1511,19 +1511,19 @@ func (c *MockMergeRequestsServiceInterfaceUnsubscribeFromMergeRequestCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceUnsubscribeFromMergeRequestCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceUnsubscribeFromMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceUnsubscribeFromMergeRequestCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceUnsubscribeFromMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceUnsubscribeFromMergeRequestCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceUnsubscribeFromMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceUnsubscribeFromMergeRequestCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceUnsubscribeFromMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateMergeRequest mocks base method. -func (m *MockMergeRequestsServiceInterface) UpdateMergeRequest(pid any, mergeRequest int, opt *gitlab.UpdateMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { +func (m *MockMergeRequestsServiceInterface) UpdateMergeRequest(pid any, mergeRequest int64, opt *gitlab.UpdateMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -1556,13 +1556,13 @@ func (c *MockMergeRequestsServiceInterfaceUpdateMergeRequestCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockMergeRequestsServiceInterfaceUpdateMergeRequestCall) Do(f func(any, int, *gitlab.UpdateMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceUpdateMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceUpdateMergeRequestCall) Do(f func(any, int64, *gitlab.UpdateMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceUpdateMergeRequestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeRequestsServiceInterfaceUpdateMergeRequestCall) DoAndReturn(f func(any, int, *gitlab.UpdateMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceUpdateMergeRequestCall { +func (c *MockMergeRequestsServiceInterfaceUpdateMergeRequestCall) DoAndReturn(f func(any, int64, *gitlab.UpdateMergeRequestOptions, ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error)) *MockMergeRequestsServiceInterfaceUpdateMergeRequestCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/merge_trains_mock.go b/testing/merge_trains_mock.go index a2ee64f0..9c761f63 100644 --- a/testing/merge_trains_mock.go +++ b/testing/merge_trains_mock.go @@ -41,7 +41,7 @@ func (m *MockMergeTrainsServiceInterface) EXPECT() *MockMergeTrainsServiceInterf } // AddMergeRequestToMergeTrain mocks base method. -func (m *MockMergeTrainsServiceInterface) AddMergeRequestToMergeTrain(pid any, mergeRequest int, opts *gitlab.AddMergeRequestToMergeTrainOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeTrain, *gitlab.Response, error) { +func (m *MockMergeTrainsServiceInterface) AddMergeRequestToMergeTrain(pid any, mergeRequest int64, opts *gitlab.AddMergeRequestToMergeTrainOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeTrain, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opts} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockMergeTrainsServiceInterfaceAddMergeRequestToMergeTrainCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockMergeTrainsServiceInterfaceAddMergeRequestToMergeTrainCall) Do(f func(any, int, *gitlab.AddMergeRequestToMergeTrainOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeTrain, *gitlab.Response, error)) *MockMergeTrainsServiceInterfaceAddMergeRequestToMergeTrainCall { +func (c *MockMergeTrainsServiceInterfaceAddMergeRequestToMergeTrainCall) Do(f func(any, int64, *gitlab.AddMergeRequestToMergeTrainOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeTrain, *gitlab.Response, error)) *MockMergeTrainsServiceInterfaceAddMergeRequestToMergeTrainCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeTrainsServiceInterfaceAddMergeRequestToMergeTrainCall) DoAndReturn(f func(any, int, *gitlab.AddMergeRequestToMergeTrainOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeTrain, *gitlab.Response, error)) *MockMergeTrainsServiceInterfaceAddMergeRequestToMergeTrainCall { +func (c *MockMergeTrainsServiceInterfaceAddMergeRequestToMergeTrainCall) DoAndReturn(f func(any, int64, *gitlab.AddMergeRequestToMergeTrainOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MergeTrain, *gitlab.Response, error)) *MockMergeTrainsServiceInterfaceAddMergeRequestToMergeTrainCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestOnAMergeTrain mocks base method. -func (m *MockMergeTrainsServiceInterface) GetMergeRequestOnAMergeTrain(pid any, mergeRequest int, options ...gitlab.RequestOptionFunc) (*gitlab.MergeTrain, *gitlab.Response, error) { +func (m *MockMergeTrainsServiceInterface) GetMergeRequestOnAMergeTrain(pid any, mergeRequest int64, options ...gitlab.RequestOptionFunc) (*gitlab.MergeTrain, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest} for _, a := range options { @@ -119,13 +119,13 @@ func (c *MockMergeTrainsServiceInterfaceGetMergeRequestOnAMergeTrainCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockMergeTrainsServiceInterfaceGetMergeRequestOnAMergeTrainCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeTrain, *gitlab.Response, error)) *MockMergeTrainsServiceInterfaceGetMergeRequestOnAMergeTrainCall { +func (c *MockMergeTrainsServiceInterfaceGetMergeRequestOnAMergeTrainCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeTrain, *gitlab.Response, error)) *MockMergeTrainsServiceInterfaceGetMergeRequestOnAMergeTrainCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMergeTrainsServiceInterfaceGetMergeRequestOnAMergeTrainCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.MergeTrain, *gitlab.Response, error)) *MockMergeTrainsServiceInterfaceGetMergeRequestOnAMergeTrainCall { +func (c *MockMergeTrainsServiceInterfaceGetMergeRequestOnAMergeTrainCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.MergeTrain, *gitlab.Response, error)) *MockMergeTrainsServiceInterfaceGetMergeRequestOnAMergeTrainCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/milestones_mock.go b/testing/milestones_mock.go index 5b7c17b7..2779dffa 100644 --- a/testing/milestones_mock.go +++ b/testing/milestones_mock.go @@ -86,7 +86,7 @@ func (c *MockMilestonesServiceInterfaceCreateMilestoneCall) DoAndReturn(f func(a } // DeleteMilestone mocks base method. -func (m *MockMilestonesServiceInterface) DeleteMilestone(pid any, milestone int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockMilestonesServiceInterface) DeleteMilestone(pid any, milestone int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, milestone} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockMilestonesServiceInterfaceDeleteMilestoneCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockMilestonesServiceInterfaceDeleteMilestoneCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMilestonesServiceInterfaceDeleteMilestoneCall { +func (c *MockMilestonesServiceInterfaceDeleteMilestoneCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMilestonesServiceInterfaceDeleteMilestoneCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMilestonesServiceInterfaceDeleteMilestoneCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMilestonesServiceInterfaceDeleteMilestoneCall { +func (c *MockMilestonesServiceInterfaceDeleteMilestoneCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockMilestonesServiceInterfaceDeleteMilestoneCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMilestone mocks base method. -func (m *MockMilestonesServiceInterface) GetMilestone(pid any, milestone int, options ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error) { +func (m *MockMilestonesServiceInterface) GetMilestone(pid any, milestone int64, options ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, milestone} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockMilestonesServiceInterfaceGetMilestoneCall) Return(arg0 *gitlab.Mil } // Do rewrite *gomock.Call.Do -func (c *MockMilestonesServiceInterfaceGetMilestoneCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneCall { +func (c *MockMilestonesServiceInterfaceGetMilestoneCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMilestonesServiceInterfaceGetMilestoneCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneCall { +func (c *MockMilestonesServiceInterfaceGetMilestoneCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMilestoneIssues mocks base method. -func (m *MockMilestonesServiceInterface) GetMilestoneIssues(pid any, milestone int, opt *gitlab.GetMilestoneIssuesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { +func (m *MockMilestonesServiceInterface) GetMilestoneIssues(pid any, milestone int64, opt *gitlab.GetMilestoneIssuesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, milestone, opt} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockMilestonesServiceInterfaceGetMilestoneIssuesCall) Return(arg0 []*gi } // Do rewrite *gomock.Call.Do -func (c *MockMilestonesServiceInterfaceGetMilestoneIssuesCall) Do(f func(any, int, *gitlab.GetMilestoneIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneIssuesCall { +func (c *MockMilestonesServiceInterfaceGetMilestoneIssuesCall) Do(f func(any, int64, *gitlab.GetMilestoneIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneIssuesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMilestonesServiceInterfaceGetMilestoneIssuesCall) DoAndReturn(f func(any, int, *gitlab.GetMilestoneIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneIssuesCall { +func (c *MockMilestonesServiceInterfaceGetMilestoneIssuesCall) DoAndReturn(f func(any, int64, *gitlab.GetMilestoneIssuesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneIssuesCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMilestoneMergeRequests mocks base method. -func (m *MockMilestonesServiceInterface) GetMilestoneMergeRequests(pid any, milestone int, opt *gitlab.GetMilestoneMergeRequestsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error) { +func (m *MockMilestonesServiceInterface) GetMilestoneMergeRequests(pid any, milestone int64, opt *gitlab.GetMilestoneMergeRequestsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, milestone, opt} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockMilestonesServiceInterfaceGetMilestoneMergeRequestsCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockMilestonesServiceInterfaceGetMilestoneMergeRequestsCall) Do(f func(any, int, *gitlab.GetMilestoneMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneMergeRequestsCall { +func (c *MockMilestonesServiceInterfaceGetMilestoneMergeRequestsCall) Do(f func(any, int64, *gitlab.GetMilestoneMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneMergeRequestsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMilestonesServiceInterfaceGetMilestoneMergeRequestsCall) DoAndReturn(f func(any, int, *gitlab.GetMilestoneMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneMergeRequestsCall { +func (c *MockMilestonesServiceInterfaceGetMilestoneMergeRequestsCall) DoAndReturn(f func(any, int64, *gitlab.GetMilestoneMergeRequestsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)) *MockMilestonesServiceInterfaceGetMilestoneMergeRequestsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -310,7 +310,7 @@ func (c *MockMilestonesServiceInterfaceListMilestonesCall) DoAndReturn(f func(an } // UpdateMilestone mocks base method. -func (m *MockMilestonesServiceInterface) UpdateMilestone(pid any, milestone int, opt *gitlab.UpdateMilestoneOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error) { +func (m *MockMilestonesServiceInterface) UpdateMilestone(pid any, milestone int64, opt *gitlab.UpdateMilestoneOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, milestone, opt} for _, a := range options { @@ -343,13 +343,13 @@ func (c *MockMilestonesServiceInterfaceUpdateMilestoneCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockMilestonesServiceInterfaceUpdateMilestoneCall) Do(f func(any, int, *gitlab.UpdateMilestoneOptions, ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error)) *MockMilestonesServiceInterfaceUpdateMilestoneCall { +func (c *MockMilestonesServiceInterfaceUpdateMilestoneCall) Do(f func(any, int64, *gitlab.UpdateMilestoneOptions, ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error)) *MockMilestonesServiceInterfaceUpdateMilestoneCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockMilestonesServiceInterfaceUpdateMilestoneCall) DoAndReturn(f func(any, int, *gitlab.UpdateMilestoneOptions, ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error)) *MockMilestonesServiceInterfaceUpdateMilestoneCall { +func (c *MockMilestonesServiceInterfaceUpdateMilestoneCall) DoAndReturn(f func(any, int64, *gitlab.UpdateMilestoneOptions, ...gitlab.RequestOptionFunc) (*gitlab.Milestone, *gitlab.Response, error)) *MockMilestonesServiceInterfaceUpdateMilestoneCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/notes_mock.go b/testing/notes_mock.go index 1f381b74..e87c5a46 100644 --- a/testing/notes_mock.go +++ b/testing/notes_mock.go @@ -41,7 +41,7 @@ func (m *MockNotesServiceInterface) EXPECT() *MockNotesServiceInterfaceMockRecor } // CreateEpicNote mocks base method. -func (m *MockNotesServiceInterface) CreateEpicNote(gid any, epic int, opt *gitlab.CreateEpicNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) CreateEpicNote(gid any, epic int64, opt *gitlab.CreateEpicNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, opt} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockNotesServiceInterfaceCreateEpicNoteCall) Return(arg0 *gitlab.Note, } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceCreateEpicNoteCall) Do(f func(any, int, *gitlab.CreateEpicNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateEpicNoteCall { +func (c *MockNotesServiceInterfaceCreateEpicNoteCall) Do(f func(any, int64, *gitlab.CreateEpicNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateEpicNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceCreateEpicNoteCall) DoAndReturn(f func(any, int, *gitlab.CreateEpicNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateEpicNoteCall { +func (c *MockNotesServiceInterfaceCreateEpicNoteCall) DoAndReturn(f func(any, int64, *gitlab.CreateEpicNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateEpicNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateIssueNote mocks base method. -func (m *MockNotesServiceInterface) CreateIssueNote(pid any, issue int, opt *gitlab.CreateIssueNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) CreateIssueNote(pid any, issue int64, opt *gitlab.CreateIssueNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockNotesServiceInterfaceCreateIssueNoteCall) Return(arg0 *gitlab.Note, } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceCreateIssueNoteCall) Do(f func(any, int, *gitlab.CreateIssueNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateIssueNoteCall { +func (c *MockNotesServiceInterfaceCreateIssueNoteCall) Do(f func(any, int64, *gitlab.CreateIssueNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateIssueNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceCreateIssueNoteCall) DoAndReturn(f func(any, int, *gitlab.CreateIssueNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateIssueNoteCall { +func (c *MockNotesServiceInterfaceCreateIssueNoteCall) DoAndReturn(f func(any, int64, *gitlab.CreateIssueNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateIssueNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateMergeRequestNote mocks base method. -func (m *MockNotesServiceInterface) CreateMergeRequestNote(pid any, mergeRequest int, opt *gitlab.CreateMergeRequestNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) CreateMergeRequestNote(pid any, mergeRequest int64, opt *gitlab.CreateMergeRequestNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockNotesServiceInterfaceCreateMergeRequestNoteCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceCreateMergeRequestNoteCall) Do(f func(any, int, *gitlab.CreateMergeRequestNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateMergeRequestNoteCall { +func (c *MockNotesServiceInterfaceCreateMergeRequestNoteCall) Do(f func(any, int64, *gitlab.CreateMergeRequestNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateMergeRequestNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceCreateMergeRequestNoteCall) DoAndReturn(f func(any, int, *gitlab.CreateMergeRequestNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateMergeRequestNoteCall { +func (c *MockNotesServiceInterfaceCreateMergeRequestNoteCall) DoAndReturn(f func(any, int64, *gitlab.CreateMergeRequestNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateMergeRequestNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateSnippetNote mocks base method. -func (m *MockNotesServiceInterface) CreateSnippetNote(pid any, snippet int, opt *gitlab.CreateSnippetNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) CreateSnippetNote(pid any, snippet int64, opt *gitlab.CreateSnippetNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, opt} for _, a := range options { @@ -209,19 +209,19 @@ func (c *MockNotesServiceInterfaceCreateSnippetNoteCall) Return(arg0 *gitlab.Not } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceCreateSnippetNoteCall) Do(f func(any, int, *gitlab.CreateSnippetNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateSnippetNoteCall { +func (c *MockNotesServiceInterfaceCreateSnippetNoteCall) Do(f func(any, int64, *gitlab.CreateSnippetNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateSnippetNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceCreateSnippetNoteCall) DoAndReturn(f func(any, int, *gitlab.CreateSnippetNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateSnippetNoteCall { +func (c *MockNotesServiceInterfaceCreateSnippetNoteCall) DoAndReturn(f func(any, int64, *gitlab.CreateSnippetNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceCreateSnippetNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteEpicNote mocks base method. -func (m *MockNotesServiceInterface) DeleteEpicNote(gid any, epic, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockNotesServiceInterface) DeleteEpicNote(gid any, epic, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, note} for _, a := range options { @@ -253,19 +253,19 @@ func (c *MockNotesServiceInterfaceDeleteEpicNoteCall) Return(arg0 *gitlab.Respon } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceDeleteEpicNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteEpicNoteCall { +func (c *MockNotesServiceInterfaceDeleteEpicNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteEpicNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceDeleteEpicNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteEpicNoteCall { +func (c *MockNotesServiceInterfaceDeleteEpicNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteEpicNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteIssueNote mocks base method. -func (m *MockNotesServiceInterface) DeleteIssueNote(pid any, issue, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockNotesServiceInterface) DeleteIssueNote(pid any, issue, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, note} for _, a := range options { @@ -297,19 +297,19 @@ func (c *MockNotesServiceInterfaceDeleteIssueNoteCall) Return(arg0 *gitlab.Respo } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceDeleteIssueNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteIssueNoteCall { +func (c *MockNotesServiceInterfaceDeleteIssueNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteIssueNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceDeleteIssueNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteIssueNoteCall { +func (c *MockNotesServiceInterfaceDeleteIssueNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteIssueNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteMergeRequestNote mocks base method. -func (m *MockNotesServiceInterface) DeleteMergeRequestNote(pid any, mergeRequest, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockNotesServiceInterface) DeleteMergeRequestNote(pid any, mergeRequest, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, note} for _, a := range options { @@ -341,19 +341,19 @@ func (c *MockNotesServiceInterfaceDeleteMergeRequestNoteCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceDeleteMergeRequestNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteMergeRequestNoteCall { +func (c *MockNotesServiceInterfaceDeleteMergeRequestNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteMergeRequestNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceDeleteMergeRequestNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteMergeRequestNoteCall { +func (c *MockNotesServiceInterfaceDeleteMergeRequestNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteMergeRequestNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteSnippetNote mocks base method. -func (m *MockNotesServiceInterface) DeleteSnippetNote(pid any, snippet, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockNotesServiceInterface) DeleteSnippetNote(pid any, snippet, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, note} for _, a := range options { @@ -385,19 +385,19 @@ func (c *MockNotesServiceInterfaceDeleteSnippetNoteCall) Return(arg0 *gitlab.Res } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceDeleteSnippetNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteSnippetNoteCall { +func (c *MockNotesServiceInterfaceDeleteSnippetNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteSnippetNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceDeleteSnippetNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteSnippetNoteCall { +func (c *MockNotesServiceInterfaceDeleteSnippetNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockNotesServiceInterfaceDeleteSnippetNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // GetEpicNote mocks base method. -func (m *MockNotesServiceInterface) GetEpicNote(gid any, epic, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) GetEpicNote(gid any, epic, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, note} for _, a := range options { @@ -430,19 +430,19 @@ func (c *MockNotesServiceInterfaceGetEpicNoteCall) Return(arg0 *gitlab.Note, arg } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceGetEpicNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetEpicNoteCall { +func (c *MockNotesServiceInterfaceGetEpicNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetEpicNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceGetEpicNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetEpicNoteCall { +func (c *MockNotesServiceInterfaceGetEpicNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetEpicNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssueNote mocks base method. -func (m *MockNotesServiceInterface) GetIssueNote(pid any, issue, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) GetIssueNote(pid any, issue, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, note} for _, a := range options { @@ -475,19 +475,19 @@ func (c *MockNotesServiceInterfaceGetIssueNoteCall) Return(arg0 *gitlab.Note, ar } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceGetIssueNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetIssueNoteCall { +func (c *MockNotesServiceInterfaceGetIssueNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetIssueNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceGetIssueNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetIssueNoteCall { +func (c *MockNotesServiceInterfaceGetIssueNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetIssueNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestNote mocks base method. -func (m *MockNotesServiceInterface) GetMergeRequestNote(pid any, mergeRequest, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) GetMergeRequestNote(pid any, mergeRequest, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, note} for _, a := range options { @@ -520,19 +520,19 @@ func (c *MockNotesServiceInterfaceGetMergeRequestNoteCall) Return(arg0 *gitlab.N } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceGetMergeRequestNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetMergeRequestNoteCall { +func (c *MockNotesServiceInterfaceGetMergeRequestNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetMergeRequestNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceGetMergeRequestNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetMergeRequestNoteCall { +func (c *MockNotesServiceInterfaceGetMergeRequestNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetMergeRequestNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // GetSnippetNote mocks base method. -func (m *MockNotesServiceInterface) GetSnippetNote(pid any, snippet, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) GetSnippetNote(pid any, snippet, note int64, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, note} for _, a := range options { @@ -565,19 +565,19 @@ func (c *MockNotesServiceInterfaceGetSnippetNoteCall) Return(arg0 *gitlab.Note, } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceGetSnippetNoteCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetSnippetNoteCall { +func (c *MockNotesServiceInterfaceGetSnippetNoteCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetSnippetNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceGetSnippetNoteCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetSnippetNoteCall { +func (c *MockNotesServiceInterfaceGetSnippetNoteCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceGetSnippetNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // ListEpicNotes mocks base method. -func (m *MockNotesServiceInterface) ListEpicNotes(gid any, epic int, opt *gitlab.ListEpicNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) ListEpicNotes(gid any, epic int64, opt *gitlab.ListEpicNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, opt} for _, a := range options { @@ -610,19 +610,19 @@ func (c *MockNotesServiceInterfaceListEpicNotesCall) Return(arg0 []*gitlab.Note, } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceListEpicNotesCall) Do(f func(any, int, *gitlab.ListEpicNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListEpicNotesCall { +func (c *MockNotesServiceInterfaceListEpicNotesCall) Do(f func(any, int64, *gitlab.ListEpicNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListEpicNotesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceListEpicNotesCall) DoAndReturn(f func(any, int, *gitlab.ListEpicNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListEpicNotesCall { +func (c *MockNotesServiceInterfaceListEpicNotesCall) DoAndReturn(f func(any, int64, *gitlab.ListEpicNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListEpicNotesCall { c.Call = c.Call.DoAndReturn(f) return c } // ListIssueNotes mocks base method. -func (m *MockNotesServiceInterface) ListIssueNotes(pid any, issue int, opt *gitlab.ListIssueNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) ListIssueNotes(pid any, issue int64, opt *gitlab.ListIssueNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -655,19 +655,19 @@ func (c *MockNotesServiceInterfaceListIssueNotesCall) Return(arg0 []*gitlab.Note } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceListIssueNotesCall) Do(f func(any, int, *gitlab.ListIssueNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListIssueNotesCall { +func (c *MockNotesServiceInterfaceListIssueNotesCall) Do(f func(any, int64, *gitlab.ListIssueNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListIssueNotesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceListIssueNotesCall) DoAndReturn(f func(any, int, *gitlab.ListIssueNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListIssueNotesCall { +func (c *MockNotesServiceInterfaceListIssueNotesCall) DoAndReturn(f func(any, int64, *gitlab.ListIssueNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListIssueNotesCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMergeRequestNotes mocks base method. -func (m *MockNotesServiceInterface) ListMergeRequestNotes(pid any, mergeRequest int, opt *gitlab.ListMergeRequestNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) ListMergeRequestNotes(pid any, mergeRequest int64, opt *gitlab.ListMergeRequestNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, opt} for _, a := range options { @@ -700,19 +700,19 @@ func (c *MockNotesServiceInterfaceListMergeRequestNotesCall) Return(arg0 []*gitl } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceListMergeRequestNotesCall) Do(f func(any, int, *gitlab.ListMergeRequestNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListMergeRequestNotesCall { +func (c *MockNotesServiceInterfaceListMergeRequestNotesCall) Do(f func(any, int64, *gitlab.ListMergeRequestNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListMergeRequestNotesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceListMergeRequestNotesCall) DoAndReturn(f func(any, int, *gitlab.ListMergeRequestNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListMergeRequestNotesCall { +func (c *MockNotesServiceInterfaceListMergeRequestNotesCall) DoAndReturn(f func(any, int64, *gitlab.ListMergeRequestNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListMergeRequestNotesCall { c.Call = c.Call.DoAndReturn(f) return c } // ListSnippetNotes mocks base method. -func (m *MockNotesServiceInterface) ListSnippetNotes(pid any, snippet int, opt *gitlab.ListSnippetNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) ListSnippetNotes(pid any, snippet int64, opt *gitlab.ListSnippetNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, opt} for _, a := range options { @@ -745,19 +745,19 @@ func (c *MockNotesServiceInterfaceListSnippetNotesCall) Return(arg0 []*gitlab.No } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceListSnippetNotesCall) Do(f func(any, int, *gitlab.ListSnippetNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListSnippetNotesCall { +func (c *MockNotesServiceInterfaceListSnippetNotesCall) Do(f func(any, int64, *gitlab.ListSnippetNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListSnippetNotesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceListSnippetNotesCall) DoAndReturn(f func(any, int, *gitlab.ListSnippetNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListSnippetNotesCall { +func (c *MockNotesServiceInterfaceListSnippetNotesCall) DoAndReturn(f func(any, int64, *gitlab.ListSnippetNotesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceListSnippetNotesCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateEpicNote mocks base method. -func (m *MockNotesServiceInterface) UpdateEpicNote(gid any, epic, note int, opt *gitlab.UpdateEpicNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) UpdateEpicNote(gid any, epic, note int64, opt *gitlab.UpdateEpicNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, note, opt} for _, a := range options { @@ -790,19 +790,19 @@ func (c *MockNotesServiceInterfaceUpdateEpicNoteCall) Return(arg0 *gitlab.Note, } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceUpdateEpicNoteCall) Do(f func(any, int, int, *gitlab.UpdateEpicNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateEpicNoteCall { +func (c *MockNotesServiceInterfaceUpdateEpicNoteCall) Do(f func(any, int64, int64, *gitlab.UpdateEpicNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateEpicNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceUpdateEpicNoteCall) DoAndReturn(f func(any, int, int, *gitlab.UpdateEpicNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateEpicNoteCall { +func (c *MockNotesServiceInterfaceUpdateEpicNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.UpdateEpicNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateEpicNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateIssueNote mocks base method. -func (m *MockNotesServiceInterface) UpdateIssueNote(pid any, issue, note int, opt *gitlab.UpdateIssueNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) UpdateIssueNote(pid any, issue, note int64, opt *gitlab.UpdateIssueNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, note, opt} for _, a := range options { @@ -835,19 +835,19 @@ func (c *MockNotesServiceInterfaceUpdateIssueNoteCall) Return(arg0 *gitlab.Note, } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceUpdateIssueNoteCall) Do(f func(any, int, int, *gitlab.UpdateIssueNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateIssueNoteCall { +func (c *MockNotesServiceInterfaceUpdateIssueNoteCall) Do(f func(any, int64, int64, *gitlab.UpdateIssueNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateIssueNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceUpdateIssueNoteCall) DoAndReturn(f func(any, int, int, *gitlab.UpdateIssueNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateIssueNoteCall { +func (c *MockNotesServiceInterfaceUpdateIssueNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.UpdateIssueNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateIssueNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateMergeRequestNote mocks base method. -func (m *MockNotesServiceInterface) UpdateMergeRequestNote(pid any, mergeRequest, note int, opt *gitlab.UpdateMergeRequestNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) UpdateMergeRequestNote(pid any, mergeRequest, note int64, opt *gitlab.UpdateMergeRequestNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mergeRequest, note, opt} for _, a := range options { @@ -880,19 +880,19 @@ func (c *MockNotesServiceInterfaceUpdateMergeRequestNoteCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceUpdateMergeRequestNoteCall) Do(f func(any, int, int, *gitlab.UpdateMergeRequestNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateMergeRequestNoteCall { +func (c *MockNotesServiceInterfaceUpdateMergeRequestNoteCall) Do(f func(any, int64, int64, *gitlab.UpdateMergeRequestNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateMergeRequestNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceUpdateMergeRequestNoteCall) DoAndReturn(f func(any, int, int, *gitlab.UpdateMergeRequestNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateMergeRequestNoteCall { +func (c *MockNotesServiceInterfaceUpdateMergeRequestNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.UpdateMergeRequestNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateMergeRequestNoteCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateSnippetNote mocks base method. -func (m *MockNotesServiceInterface) UpdateSnippetNote(pid any, snippet, note int, opt *gitlab.UpdateSnippetNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { +func (m *MockNotesServiceInterface) UpdateSnippetNote(pid any, snippet, note int64, opt *gitlab.UpdateSnippetNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, note, opt} for _, a := range options { @@ -925,13 +925,13 @@ func (c *MockNotesServiceInterfaceUpdateSnippetNoteCall) Return(arg0 *gitlab.Not } // Do rewrite *gomock.Call.Do -func (c *MockNotesServiceInterfaceUpdateSnippetNoteCall) Do(f func(any, int, int, *gitlab.UpdateSnippetNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateSnippetNoteCall { +func (c *MockNotesServiceInterfaceUpdateSnippetNoteCall) Do(f func(any, int64, int64, *gitlab.UpdateSnippetNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateSnippetNoteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockNotesServiceInterfaceUpdateSnippetNoteCall) DoAndReturn(f func(any, int, int, *gitlab.UpdateSnippetNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateSnippetNoteCall { +func (c *MockNotesServiceInterfaceUpdateSnippetNoteCall) DoAndReturn(f func(any, int64, int64, *gitlab.UpdateSnippetNoteOptions, ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)) *MockNotesServiceInterfaceUpdateSnippetNoteCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/packages_mock.go b/testing/packages_mock.go index 9561b8c7..d9118877 100644 --- a/testing/packages_mock.go +++ b/testing/packages_mock.go @@ -41,7 +41,7 @@ func (m *MockPackagesServiceInterface) EXPECT() *MockPackagesServiceInterfaceMoc } // DeletePackageFile mocks base method. -func (m *MockPackagesServiceInterface) DeletePackageFile(pid any, pkg, file int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockPackagesServiceInterface) DeletePackageFile(pid any, pkg, file int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pkg, file} for _, a := range options { @@ -73,19 +73,19 @@ func (c *MockPackagesServiceInterfaceDeletePackageFileCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockPackagesServiceInterfaceDeletePackageFileCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPackagesServiceInterfaceDeletePackageFileCall { +func (c *MockPackagesServiceInterfaceDeletePackageFileCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPackagesServiceInterfaceDeletePackageFileCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPackagesServiceInterfaceDeletePackageFileCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPackagesServiceInterfaceDeletePackageFileCall { +func (c *MockPackagesServiceInterfaceDeletePackageFileCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPackagesServiceInterfaceDeletePackageFileCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteProjectPackage mocks base method. -func (m *MockPackagesServiceInterface) DeleteProjectPackage(pid any, pkg int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockPackagesServiceInterface) DeleteProjectPackage(pid any, pkg int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pkg} for _, a := range options { @@ -117,13 +117,13 @@ func (c *MockPackagesServiceInterfaceDeleteProjectPackageCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockPackagesServiceInterfaceDeleteProjectPackageCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPackagesServiceInterfaceDeleteProjectPackageCall { +func (c *MockPackagesServiceInterfaceDeleteProjectPackageCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPackagesServiceInterfaceDeleteProjectPackageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPackagesServiceInterfaceDeleteProjectPackageCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPackagesServiceInterfaceDeleteProjectPackageCall { +func (c *MockPackagesServiceInterfaceDeleteProjectPackageCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPackagesServiceInterfaceDeleteProjectPackageCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -174,7 +174,7 @@ func (c *MockPackagesServiceInterfaceListGroupPackagesCall) DoAndReturn(f func(a } // ListPackageFiles mocks base method. -func (m *MockPackagesServiceInterface) ListPackageFiles(pid any, pkg int, opt *gitlab.ListPackageFilesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.PackageFile, *gitlab.Response, error) { +func (m *MockPackagesServiceInterface) ListPackageFiles(pid any, pkg int64, opt *gitlab.ListPackageFilesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.PackageFile, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pkg, opt} for _, a := range options { @@ -207,13 +207,13 @@ func (c *MockPackagesServiceInterfaceListPackageFilesCall) Return(arg0 []*gitlab } // Do rewrite *gomock.Call.Do -func (c *MockPackagesServiceInterfaceListPackageFilesCall) Do(f func(any, int, *gitlab.ListPackageFilesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.PackageFile, *gitlab.Response, error)) *MockPackagesServiceInterfaceListPackageFilesCall { +func (c *MockPackagesServiceInterfaceListPackageFilesCall) Do(f func(any, int64, *gitlab.ListPackageFilesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.PackageFile, *gitlab.Response, error)) *MockPackagesServiceInterfaceListPackageFilesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPackagesServiceInterfaceListPackageFilesCall) DoAndReturn(f func(any, int, *gitlab.ListPackageFilesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.PackageFile, *gitlab.Response, error)) *MockPackagesServiceInterfaceListPackageFilesCall { +func (c *MockPackagesServiceInterfaceListPackageFilesCall) DoAndReturn(f func(any, int64, *gitlab.ListPackageFilesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.PackageFile, *gitlab.Response, error)) *MockPackagesServiceInterfaceListPackageFilesCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/personal_access_tokens_mock.go b/testing/personal_access_tokens_mock.go index 60f9c4b2..a6735b46 100644 --- a/testing/personal_access_tokens_mock.go +++ b/testing/personal_access_tokens_mock.go @@ -85,7 +85,7 @@ func (c *MockPersonalAccessTokensServiceInterfaceGetSinglePersonalAccessTokenCal } // GetSinglePersonalAccessTokenByID mocks base method. -func (m *MockPersonalAccessTokensServiceInterface) GetSinglePersonalAccessTokenByID(token int, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { +func (m *MockPersonalAccessTokensServiceInterface) GetSinglePersonalAccessTokenByID(token int64, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{token} for _, a := range options { @@ -118,13 +118,13 @@ func (c *MockPersonalAccessTokensServiceInterfaceGetSinglePersonalAccessTokenByI } // Do rewrite *gomock.Call.Do -func (c *MockPersonalAccessTokensServiceInterfaceGetSinglePersonalAccessTokenByIDCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceGetSinglePersonalAccessTokenByIDCall { +func (c *MockPersonalAccessTokensServiceInterfaceGetSinglePersonalAccessTokenByIDCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceGetSinglePersonalAccessTokenByIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPersonalAccessTokensServiceInterfaceGetSinglePersonalAccessTokenByIDCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceGetSinglePersonalAccessTokenByIDCall { +func (c *MockPersonalAccessTokensServiceInterfaceGetSinglePersonalAccessTokenByIDCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceGetSinglePersonalAccessTokenByIDCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -175,7 +175,7 @@ func (c *MockPersonalAccessTokensServiceInterfaceListPersonalAccessTokensCall) D } // RevokePersonalAccessToken mocks base method. -func (m *MockPersonalAccessTokensServiceInterface) RevokePersonalAccessToken(token int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockPersonalAccessTokensServiceInterface) RevokePersonalAccessToken(token int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{token} for _, a := range options { @@ -207,19 +207,19 @@ func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenCall) } // Do rewrite *gomock.Call.Do -func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenCall { +func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenCall { +func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // RevokePersonalAccessTokenByID mocks base method. -func (m *MockPersonalAccessTokensServiceInterface) RevokePersonalAccessTokenByID(token int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockPersonalAccessTokensServiceInterface) RevokePersonalAccessTokenByID(token int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{token} for _, a := range options { @@ -251,13 +251,13 @@ func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenByIDCa } // Do rewrite *gomock.Call.Do -func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenByIDCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenByIDCall { +func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenByIDCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenByIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenByIDCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenByIDCall { +func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenByIDCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenByIDCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -306,7 +306,7 @@ func (c *MockPersonalAccessTokensServiceInterfaceRevokePersonalAccessTokenSelfCa } // RotatePersonalAccessToken mocks base method. -func (m *MockPersonalAccessTokensServiceInterface) RotatePersonalAccessToken(token int, opt *gitlab.RotatePersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { +func (m *MockPersonalAccessTokensServiceInterface) RotatePersonalAccessToken(token int64, opt *gitlab.RotatePersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{token, opt} for _, a := range options { @@ -339,19 +339,19 @@ func (c *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenCall) } // Do rewrite *gomock.Call.Do -func (c *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenCall) Do(f func(int, *gitlab.RotatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenCall { +func (c *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenCall) Do(f func(int64, *gitlab.RotatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenCall) DoAndReturn(f func(int, *gitlab.RotatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenCall { +func (c *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenCall) DoAndReturn(f func(int64, *gitlab.RotatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // RotatePersonalAccessTokenByID mocks base method. -func (m *MockPersonalAccessTokensServiceInterface) RotatePersonalAccessTokenByID(token int, opt *gitlab.RotatePersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { +func (m *MockPersonalAccessTokensServiceInterface) RotatePersonalAccessTokenByID(token int64, opt *gitlab.RotatePersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{token, opt} for _, a := range options { @@ -384,13 +384,13 @@ func (c *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenByIDCa } // Do rewrite *gomock.Call.Do -func (c *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenByIDCall) Do(f func(int, *gitlab.RotatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenByIDCall { +func (c *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenByIDCall) Do(f func(int64, *gitlab.RotatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenByIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenByIDCall) DoAndReturn(f func(int, *gitlab.RotatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenByIDCall { +func (c *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenByIDCall) DoAndReturn(f func(int64, *gitlab.RotatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockPersonalAccessTokensServiceInterfaceRotatePersonalAccessTokenByIDCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/pipeline_schedules_mock.go b/testing/pipeline_schedules_mock.go index 00c255db..46a98f4b 100644 --- a/testing/pipeline_schedules_mock.go +++ b/testing/pipeline_schedules_mock.go @@ -86,7 +86,7 @@ func (c *MockPipelineSchedulesServiceInterfaceCreatePipelineScheduleCall) DoAndR } // CreatePipelineScheduleVariable mocks base method. -func (m *MockPipelineSchedulesServiceInterface) CreatePipelineScheduleVariable(pid any, schedule int, opt *gitlab.CreatePipelineScheduleVariableOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error) { +func (m *MockPipelineSchedulesServiceInterface) CreatePipelineScheduleVariable(pid any, schedule int64, opt *gitlab.CreatePipelineScheduleVariableOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, schedule, opt} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockPipelineSchedulesServiceInterfaceCreatePipelineScheduleVariableCall } // Do rewrite *gomock.Call.Do -func (c *MockPipelineSchedulesServiceInterfaceCreatePipelineScheduleVariableCall) Do(f func(any, int, *gitlab.CreatePipelineScheduleVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceCreatePipelineScheduleVariableCall { +func (c *MockPipelineSchedulesServiceInterfaceCreatePipelineScheduleVariableCall) Do(f func(any, int64, *gitlab.CreatePipelineScheduleVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceCreatePipelineScheduleVariableCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineSchedulesServiceInterfaceCreatePipelineScheduleVariableCall) DoAndReturn(f func(any, int, *gitlab.CreatePipelineScheduleVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceCreatePipelineScheduleVariableCall { +func (c *MockPipelineSchedulesServiceInterfaceCreatePipelineScheduleVariableCall) DoAndReturn(f func(any, int64, *gitlab.CreatePipelineScheduleVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceCreatePipelineScheduleVariableCall { c.Call = c.Call.DoAndReturn(f) return c } // DeletePipelineSchedule mocks base method. -func (m *MockPipelineSchedulesServiceInterface) DeletePipelineSchedule(pid any, schedule int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockPipelineSchedulesServiceInterface) DeletePipelineSchedule(pid any, schedule int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, schedule} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleCall { c.Call = c.Call.DoAndReturn(f) return c } // DeletePipelineScheduleVariable mocks base method. -func (m *MockPipelineSchedulesServiceInterface) DeletePipelineScheduleVariable(pid any, schedule int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error) { +func (m *MockPipelineSchedulesServiceInterface) DeletePipelineScheduleVariable(pid any, schedule int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, schedule, key} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleVariableCall } // Do rewrite *gomock.Call.Do -func (c *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleVariableCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleVariableCall { +func (c *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleVariableCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleVariableCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleVariableCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleVariableCall { +func (c *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleVariableCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceDeletePipelineScheduleVariableCall { c.Call = c.Call.DoAndReturn(f) return c } // EditPipelineSchedule mocks base method. -func (m *MockPipelineSchedulesServiceInterface) EditPipelineSchedule(pid any, schedule int, opt *gitlab.EditPipelineScheduleOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error) { +func (m *MockPipelineSchedulesServiceInterface) EditPipelineSchedule(pid any, schedule int64, opt *gitlab.EditPipelineScheduleOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, schedule, opt} for _, a := range options { @@ -253,19 +253,19 @@ func (c *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleCall) Do(f func(any, int, *gitlab.EditPipelineScheduleOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleCall) Do(f func(any, int64, *gitlab.EditPipelineScheduleOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleCall) DoAndReturn(f func(any, int, *gitlab.EditPipelineScheduleOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleCall) DoAndReturn(f func(any, int64, *gitlab.EditPipelineScheduleOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleCall { c.Call = c.Call.DoAndReturn(f) return c } // EditPipelineScheduleVariable mocks base method. -func (m *MockPipelineSchedulesServiceInterface) EditPipelineScheduleVariable(pid any, schedule int, key string, opt *gitlab.EditPipelineScheduleVariableOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error) { +func (m *MockPipelineSchedulesServiceInterface) EditPipelineScheduleVariable(pid any, schedule int64, key string, opt *gitlab.EditPipelineScheduleVariableOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, schedule, key, opt} for _, a := range options { @@ -298,19 +298,19 @@ func (c *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleVariableCall) } // Do rewrite *gomock.Call.Do -func (c *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleVariableCall) Do(f func(any, int, string, *gitlab.EditPipelineScheduleVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleVariableCall { +func (c *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleVariableCall) Do(f func(any, int64, string, *gitlab.EditPipelineScheduleVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleVariableCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleVariableCall) DoAndReturn(f func(any, int, string, *gitlab.EditPipelineScheduleVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleVariableCall { +func (c *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleVariableCall) DoAndReturn(f func(any, int64, string, *gitlab.EditPipelineScheduleVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceEditPipelineScheduleVariableCall { c.Call = c.Call.DoAndReturn(f) return c } // GetPipelineSchedule mocks base method. -func (m *MockPipelineSchedulesServiceInterface) GetPipelineSchedule(pid any, schedule int, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error) { +func (m *MockPipelineSchedulesServiceInterface) GetPipelineSchedule(pid any, schedule int64, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, schedule} for _, a := range options { @@ -343,13 +343,13 @@ func (c *MockPipelineSchedulesServiceInterfaceGetPipelineScheduleCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockPipelineSchedulesServiceInterfaceGetPipelineScheduleCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceGetPipelineScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceGetPipelineScheduleCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceGetPipelineScheduleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineSchedulesServiceInterfaceGetPipelineScheduleCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceGetPipelineScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceGetPipelineScheduleCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceGetPipelineScheduleCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -400,7 +400,7 @@ func (c *MockPipelineSchedulesServiceInterfaceListPipelineSchedulesCall) DoAndRe } // ListPipelinesTriggeredBySchedule mocks base method. -func (m *MockPipelineSchedulesServiceInterface) ListPipelinesTriggeredBySchedule(pid any, schedule int, opt *gitlab.ListPipelinesTriggeredByScheduleOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Pipeline, *gitlab.Response, error) { +func (m *MockPipelineSchedulesServiceInterface) ListPipelinesTriggeredBySchedule(pid any, schedule int64, opt *gitlab.ListPipelinesTriggeredByScheduleOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Pipeline, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, schedule, opt} for _, a := range options { @@ -433,19 +433,19 @@ func (c *MockPipelineSchedulesServiceInterfaceListPipelinesTriggeredByScheduleCa } // Do rewrite *gomock.Call.Do -func (c *MockPipelineSchedulesServiceInterfaceListPipelinesTriggeredByScheduleCall) Do(f func(any, int, *gitlab.ListPipelinesTriggeredByScheduleOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceListPipelinesTriggeredByScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceListPipelinesTriggeredByScheduleCall) Do(f func(any, int64, *gitlab.ListPipelinesTriggeredByScheduleOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceListPipelinesTriggeredByScheduleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineSchedulesServiceInterfaceListPipelinesTriggeredByScheduleCall) DoAndReturn(f func(any, int, *gitlab.ListPipelinesTriggeredByScheduleOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceListPipelinesTriggeredByScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceListPipelinesTriggeredByScheduleCall) DoAndReturn(f func(any, int64, *gitlab.ListPipelinesTriggeredByScheduleOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceListPipelinesTriggeredByScheduleCall { c.Call = c.Call.DoAndReturn(f) return c } // RunPipelineSchedule mocks base method. -func (m *MockPipelineSchedulesServiceInterface) RunPipelineSchedule(pid any, schedule int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockPipelineSchedulesServiceInterface) RunPipelineSchedule(pid any, schedule int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, schedule} for _, a := range options { @@ -477,19 +477,19 @@ func (c *MockPipelineSchedulesServiceInterfaceRunPipelineScheduleCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockPipelineSchedulesServiceInterfaceRunPipelineScheduleCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceRunPipelineScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceRunPipelineScheduleCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceRunPipelineScheduleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineSchedulesServiceInterfaceRunPipelineScheduleCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceRunPipelineScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceRunPipelineScheduleCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceRunPipelineScheduleCall { c.Call = c.Call.DoAndReturn(f) return c } // TakeOwnershipOfPipelineSchedule mocks base method. -func (m *MockPipelineSchedulesServiceInterface) TakeOwnershipOfPipelineSchedule(pid any, schedule int, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error) { +func (m *MockPipelineSchedulesServiceInterface) TakeOwnershipOfPipelineSchedule(pid any, schedule int64, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, schedule} for _, a := range options { @@ -522,13 +522,13 @@ func (c *MockPipelineSchedulesServiceInterfaceTakeOwnershipOfPipelineScheduleCal } // Do rewrite *gomock.Call.Do -func (c *MockPipelineSchedulesServiceInterfaceTakeOwnershipOfPipelineScheduleCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceTakeOwnershipOfPipelineScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceTakeOwnershipOfPipelineScheduleCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceTakeOwnershipOfPipelineScheduleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineSchedulesServiceInterfaceTakeOwnershipOfPipelineScheduleCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceTakeOwnershipOfPipelineScheduleCall { +func (c *MockPipelineSchedulesServiceInterfaceTakeOwnershipOfPipelineScheduleCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineSchedule, *gitlab.Response, error)) *MockPipelineSchedulesServiceInterfaceTakeOwnershipOfPipelineScheduleCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/pipeline_triggers_mock.go b/testing/pipeline_triggers_mock.go index 645dc0a3..24eaa5e6 100644 --- a/testing/pipeline_triggers_mock.go +++ b/testing/pipeline_triggers_mock.go @@ -86,7 +86,7 @@ func (c *MockPipelineTriggersServiceInterfaceAddPipelineTriggerCall) DoAndReturn } // DeletePipelineTrigger mocks base method. -func (m *MockPipelineTriggersServiceInterface) DeletePipelineTrigger(pid any, trigger int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockPipelineTriggersServiceInterface) DeletePipelineTrigger(pid any, trigger int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, trigger} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockPipelineTriggersServiceInterfaceDeletePipelineTriggerCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockPipelineTriggersServiceInterfaceDeletePipelineTriggerCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceDeletePipelineTriggerCall { +func (c *MockPipelineTriggersServiceInterfaceDeletePipelineTriggerCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceDeletePipelineTriggerCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineTriggersServiceInterfaceDeletePipelineTriggerCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceDeletePipelineTriggerCall { +func (c *MockPipelineTriggersServiceInterfaceDeletePipelineTriggerCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceDeletePipelineTriggerCall { c.Call = c.Call.DoAndReturn(f) return c } // EditPipelineTrigger mocks base method. -func (m *MockPipelineTriggersServiceInterface) EditPipelineTrigger(pid any, trigger int, opt *gitlab.EditPipelineTriggerOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error) { +func (m *MockPipelineTriggersServiceInterface) EditPipelineTrigger(pid any, trigger int64, opt *gitlab.EditPipelineTriggerOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, trigger, opt} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockPipelineTriggersServiceInterfaceEditPipelineTriggerCall) Return(arg } // Do rewrite *gomock.Call.Do -func (c *MockPipelineTriggersServiceInterfaceEditPipelineTriggerCall) Do(f func(any, int, *gitlab.EditPipelineTriggerOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceEditPipelineTriggerCall { +func (c *MockPipelineTriggersServiceInterfaceEditPipelineTriggerCall) Do(f func(any, int64, *gitlab.EditPipelineTriggerOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceEditPipelineTriggerCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineTriggersServiceInterfaceEditPipelineTriggerCall) DoAndReturn(f func(any, int, *gitlab.EditPipelineTriggerOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceEditPipelineTriggerCall { +func (c *MockPipelineTriggersServiceInterfaceEditPipelineTriggerCall) DoAndReturn(f func(any, int64, *gitlab.EditPipelineTriggerOptions, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceEditPipelineTriggerCall { c.Call = c.Call.DoAndReturn(f) return c } // GetPipelineTrigger mocks base method. -func (m *MockPipelineTriggersServiceInterface) GetPipelineTrigger(pid any, trigger int, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error) { +func (m *MockPipelineTriggersServiceInterface) GetPipelineTrigger(pid any, trigger int64, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, trigger} for _, a := range options { @@ -208,13 +208,13 @@ func (c *MockPipelineTriggersServiceInterfaceGetPipelineTriggerCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockPipelineTriggersServiceInterfaceGetPipelineTriggerCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceGetPipelineTriggerCall { +func (c *MockPipelineTriggersServiceInterfaceGetPipelineTriggerCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceGetPipelineTriggerCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelineTriggersServiceInterfaceGetPipelineTriggerCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceGetPipelineTriggerCall { +func (c *MockPipelineTriggersServiceInterfaceGetPipelineTriggerCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTrigger, *gitlab.Response, error)) *MockPipelineTriggersServiceInterfaceGetPipelineTriggerCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/pipelines_mock.go b/testing/pipelines_mock.go index f55de0e0..ad1a9e1c 100644 --- a/testing/pipelines_mock.go +++ b/testing/pipelines_mock.go @@ -41,7 +41,7 @@ func (m *MockPipelinesServiceInterface) EXPECT() *MockPipelinesServiceInterfaceM } // CancelPipelineBuild mocks base method. -func (m *MockPipelinesServiceInterface) CancelPipelineBuild(pid any, pipeline int, options ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error) { +func (m *MockPipelinesServiceInterface) CancelPipelineBuild(pid any, pipeline int64, options ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pipeline} for _, a := range options { @@ -74,13 +74,13 @@ func (c *MockPipelinesServiceInterfaceCancelPipelineBuildCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockPipelinesServiceInterfaceCancelPipelineBuildCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceCancelPipelineBuildCall { +func (c *MockPipelinesServiceInterfaceCancelPipelineBuildCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceCancelPipelineBuildCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelinesServiceInterfaceCancelPipelineBuildCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceCancelPipelineBuildCall { +func (c *MockPipelinesServiceInterfaceCancelPipelineBuildCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceCancelPipelineBuildCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -131,7 +131,7 @@ func (c *MockPipelinesServiceInterfaceCreatePipelineCall) DoAndReturn(f func(any } // DeletePipeline mocks base method. -func (m *MockPipelinesServiceInterface) DeletePipeline(pid any, pipeline int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockPipelinesServiceInterface) DeletePipeline(pid any, pipeline int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pipeline} for _, a := range options { @@ -163,13 +163,13 @@ func (c *MockPipelinesServiceInterfaceDeletePipelineCall) Return(arg0 *gitlab.Re } // Do rewrite *gomock.Call.Do -func (c *MockPipelinesServiceInterfaceDeletePipelineCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelinesServiceInterfaceDeletePipelineCall { +func (c *MockPipelinesServiceInterfaceDeletePipelineCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelinesServiceInterfaceDeletePipelineCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelinesServiceInterfaceDeletePipelineCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelinesServiceInterfaceDeletePipelineCall { +func (c *MockPipelinesServiceInterfaceDeletePipelineCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockPipelinesServiceInterfaceDeletePipelineCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -220,7 +220,7 @@ func (c *MockPipelinesServiceInterfaceGetLatestPipelineCall) DoAndReturn(f func( } // GetPipeline mocks base method. -func (m *MockPipelinesServiceInterface) GetPipeline(pid any, pipeline int, options ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error) { +func (m *MockPipelinesServiceInterface) GetPipeline(pid any, pipeline int64, options ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pipeline} for _, a := range options { @@ -253,19 +253,19 @@ func (c *MockPipelinesServiceInterfaceGetPipelineCall) Return(arg0 *gitlab.Pipel } // Do rewrite *gomock.Call.Do -func (c *MockPipelinesServiceInterfaceGetPipelineCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineCall { +func (c *MockPipelinesServiceInterfaceGetPipelineCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelinesServiceInterfaceGetPipelineCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineCall { +func (c *MockPipelinesServiceInterfaceGetPipelineCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineCall { c.Call = c.Call.DoAndReturn(f) return c } // GetPipelineTestReport mocks base method. -func (m *MockPipelinesServiceInterface) GetPipelineTestReport(pid any, pipeline int, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReport, *gitlab.Response, error) { +func (m *MockPipelinesServiceInterface) GetPipelineTestReport(pid any, pipeline int64, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReport, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pipeline} for _, a := range options { @@ -298,19 +298,19 @@ func (c *MockPipelinesServiceInterfaceGetPipelineTestReportCall) Return(arg0 *gi } // Do rewrite *gomock.Call.Do -func (c *MockPipelinesServiceInterfaceGetPipelineTestReportCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReport, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineTestReportCall { +func (c *MockPipelinesServiceInterfaceGetPipelineTestReportCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReport, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineTestReportCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelinesServiceInterfaceGetPipelineTestReportCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReport, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineTestReportCall { +func (c *MockPipelinesServiceInterfaceGetPipelineTestReportCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReport, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineTestReportCall { c.Call = c.Call.DoAndReturn(f) return c } // GetPipelineVariables mocks base method. -func (m *MockPipelinesServiceInterface) GetPipelineVariables(pid any, pipeline int, options ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineVariable, *gitlab.Response, error) { +func (m *MockPipelinesServiceInterface) GetPipelineVariables(pid any, pipeline int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineVariable, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pipeline} for _, a := range options { @@ -343,13 +343,13 @@ func (c *MockPipelinesServiceInterfaceGetPipelineVariablesCall) Return(arg0 []*g } // Do rewrite *gomock.Call.Do -func (c *MockPipelinesServiceInterfaceGetPipelineVariablesCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineVariablesCall { +func (c *MockPipelinesServiceInterfaceGetPipelineVariablesCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineVariablesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelinesServiceInterfaceGetPipelineVariablesCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineVariablesCall { +func (c *MockPipelinesServiceInterfaceGetPipelineVariablesCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]*gitlab.PipelineVariable, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineVariablesCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -400,7 +400,7 @@ func (c *MockPipelinesServiceInterfaceListProjectPipelinesCall) DoAndReturn(f fu } // RetryPipelineBuild mocks base method. -func (m *MockPipelinesServiceInterface) RetryPipelineBuild(pid any, pipeline int, options ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error) { +func (m *MockPipelinesServiceInterface) RetryPipelineBuild(pid any, pipeline int64, options ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pipeline} for _, a := range options { @@ -433,19 +433,19 @@ func (c *MockPipelinesServiceInterfaceRetryPipelineBuildCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockPipelinesServiceInterfaceRetryPipelineBuildCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceRetryPipelineBuildCall { +func (c *MockPipelinesServiceInterfaceRetryPipelineBuildCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceRetryPipelineBuildCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelinesServiceInterfaceRetryPipelineBuildCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceRetryPipelineBuildCall { +func (c *MockPipelinesServiceInterfaceRetryPipelineBuildCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceRetryPipelineBuildCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdatePipelineMetadata mocks base method. -func (m *MockPipelinesServiceInterface) UpdatePipelineMetadata(pid any, pipeline int, opt *gitlab.UpdatePipelineMetadataOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error) { +func (m *MockPipelinesServiceInterface) UpdatePipelineMetadata(pid any, pipeline int64, opt *gitlab.UpdatePipelineMetadataOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pipeline, opt} for _, a := range options { @@ -478,13 +478,13 @@ func (c *MockPipelinesServiceInterfaceUpdatePipelineMetadataCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockPipelinesServiceInterfaceUpdatePipelineMetadataCall) Do(f func(any, int, *gitlab.UpdatePipelineMetadataOptions, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceUpdatePipelineMetadataCall { +func (c *MockPipelinesServiceInterfaceUpdatePipelineMetadataCall) Do(f func(any, int64, *gitlab.UpdatePipelineMetadataOptions, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceUpdatePipelineMetadataCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelinesServiceInterfaceUpdatePipelineMetadataCall) DoAndReturn(f func(any, int, *gitlab.UpdatePipelineMetadataOptions, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceUpdatePipelineMetadataCall { +func (c *MockPipelinesServiceInterfaceUpdatePipelineMetadataCall) DoAndReturn(f func(any, int64, *gitlab.UpdatePipelineMetadataOptions, ...gitlab.RequestOptionFunc) (*gitlab.Pipeline, *gitlab.Response, error)) *MockPipelinesServiceInterfaceUpdatePipelineMetadataCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/project_access_tokens_mock.go b/testing/project_access_tokens_mock.go index e29bfd0b..e243fbe0 100644 --- a/testing/project_access_tokens_mock.go +++ b/testing/project_access_tokens_mock.go @@ -86,7 +86,7 @@ func (c *MockProjectAccessTokensServiceInterfaceCreateProjectAccessTokenCall) Do } // GetProjectAccessToken mocks base method. -func (m *MockProjectAccessTokensServiceInterface) GetProjectAccessToken(pid any, id int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error) { +func (m *MockProjectAccessTokensServiceInterface) GetProjectAccessToken(pid any, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, id} for _, a := range options { @@ -119,13 +119,13 @@ func (c *MockProjectAccessTokensServiceInterfaceGetProjectAccessTokenCall) Retur } // Do rewrite *gomock.Call.Do -func (c *MockProjectAccessTokensServiceInterfaceGetProjectAccessTokenCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceGetProjectAccessTokenCall { +func (c *MockProjectAccessTokensServiceInterfaceGetProjectAccessTokenCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceGetProjectAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectAccessTokensServiceInterfaceGetProjectAccessTokenCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceGetProjectAccessTokenCall { +func (c *MockProjectAccessTokensServiceInterfaceGetProjectAccessTokenCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceGetProjectAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -176,7 +176,7 @@ func (c *MockProjectAccessTokensServiceInterfaceListProjectAccessTokensCall) DoA } // RevokeProjectAccessToken mocks base method. -func (m *MockProjectAccessTokensServiceInterface) RevokeProjectAccessToken(pid any, id int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectAccessTokensServiceInterface) RevokeProjectAccessToken(pid any, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, id} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockProjectAccessTokensServiceInterfaceRevokeProjectAccessTokenCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockProjectAccessTokensServiceInterfaceRevokeProjectAccessTokenCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceRevokeProjectAccessTokenCall { +func (c *MockProjectAccessTokensServiceInterfaceRevokeProjectAccessTokenCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceRevokeProjectAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectAccessTokensServiceInterfaceRevokeProjectAccessTokenCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceRevokeProjectAccessTokenCall { +func (c *MockProjectAccessTokensServiceInterfaceRevokeProjectAccessTokenCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceRevokeProjectAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // RotateProjectAccessToken mocks base method. -func (m *MockProjectAccessTokensServiceInterface) RotateProjectAccessToken(pid any, id int, opt *gitlab.RotateProjectAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error) { +func (m *MockProjectAccessTokensServiceInterface) RotateProjectAccessToken(pid any, id int64, opt *gitlab.RotateProjectAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, id, opt} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockProjectAccessTokensServiceInterfaceRotateProjectAccessTokenCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockProjectAccessTokensServiceInterfaceRotateProjectAccessTokenCall) Do(f func(any, int, *gitlab.RotateProjectAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceRotateProjectAccessTokenCall { +func (c *MockProjectAccessTokensServiceInterfaceRotateProjectAccessTokenCall) Do(f func(any, int64, *gitlab.RotateProjectAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceRotateProjectAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectAccessTokensServiceInterfaceRotateProjectAccessTokenCall) DoAndReturn(f func(any, int, *gitlab.RotateProjectAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceRotateProjectAccessTokenCall { +func (c *MockProjectAccessTokensServiceInterfaceRotateProjectAccessTokenCall) DoAndReturn(f func(any, int64, *gitlab.RotateProjectAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectAccessToken, *gitlab.Response, error)) *MockProjectAccessTokensServiceInterfaceRotateProjectAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/project_badges_mock.go b/testing/project_badges_mock.go index 42947510..2e6a0f86 100644 --- a/testing/project_badges_mock.go +++ b/testing/project_badges_mock.go @@ -86,7 +86,7 @@ func (c *MockProjectBadgesServiceInterfaceAddProjectBadgeCall) DoAndReturn(f fun } // DeleteProjectBadge mocks base method. -func (m *MockProjectBadgesServiceInterface) DeleteProjectBadge(pid any, badge int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectBadgesServiceInterface) DeleteProjectBadge(pid any, badge int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, badge} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockProjectBadgesServiceInterfaceDeleteProjectBadgeCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockProjectBadgesServiceInterfaceDeleteProjectBadgeCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectBadgesServiceInterfaceDeleteProjectBadgeCall { +func (c *MockProjectBadgesServiceInterfaceDeleteProjectBadgeCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectBadgesServiceInterfaceDeleteProjectBadgeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectBadgesServiceInterfaceDeleteProjectBadgeCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectBadgesServiceInterfaceDeleteProjectBadgeCall { +func (c *MockProjectBadgesServiceInterfaceDeleteProjectBadgeCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectBadgesServiceInterfaceDeleteProjectBadgeCall { c.Call = c.Call.DoAndReturn(f) return c } // EditProjectBadge mocks base method. -func (m *MockProjectBadgesServiceInterface) EditProjectBadge(pid any, badge int, opt *gitlab.EditProjectBadgeOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error) { +func (m *MockProjectBadgesServiceInterface) EditProjectBadge(pid any, badge int64, opt *gitlab.EditProjectBadgeOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, badge, opt} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockProjectBadgesServiceInterfaceEditProjectBadgeCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockProjectBadgesServiceInterfaceEditProjectBadgeCall) Do(f func(any, int, *gitlab.EditProjectBadgeOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error)) *MockProjectBadgesServiceInterfaceEditProjectBadgeCall { +func (c *MockProjectBadgesServiceInterfaceEditProjectBadgeCall) Do(f func(any, int64, *gitlab.EditProjectBadgeOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error)) *MockProjectBadgesServiceInterfaceEditProjectBadgeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectBadgesServiceInterfaceEditProjectBadgeCall) DoAndReturn(f func(any, int, *gitlab.EditProjectBadgeOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error)) *MockProjectBadgesServiceInterfaceEditProjectBadgeCall { +func (c *MockProjectBadgesServiceInterfaceEditProjectBadgeCall) DoAndReturn(f func(any, int64, *gitlab.EditProjectBadgeOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error)) *MockProjectBadgesServiceInterfaceEditProjectBadgeCall { c.Call = c.Call.DoAndReturn(f) return c } // GetProjectBadge mocks base method. -func (m *MockProjectBadgesServiceInterface) GetProjectBadge(pid any, badge int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error) { +func (m *MockProjectBadgesServiceInterface) GetProjectBadge(pid any, badge int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, badge} for _, a := range options { @@ -208,13 +208,13 @@ func (c *MockProjectBadgesServiceInterfaceGetProjectBadgeCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockProjectBadgesServiceInterfaceGetProjectBadgeCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error)) *MockProjectBadgesServiceInterfaceGetProjectBadgeCall { +func (c *MockProjectBadgesServiceInterfaceGetProjectBadgeCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error)) *MockProjectBadgesServiceInterfaceGetProjectBadgeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectBadgesServiceInterfaceGetProjectBadgeCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error)) *MockProjectBadgesServiceInterfaceGetProjectBadgeCall { +func (c *MockProjectBadgesServiceInterfaceGetProjectBadgeCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectBadge, *gitlab.Response, error)) *MockProjectBadgesServiceInterfaceGetProjectBadgeCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/project_clusters_mock.go b/testing/project_clusters_mock.go index 56b573c4..cdf6aa05 100644 --- a/testing/project_clusters_mock.go +++ b/testing/project_clusters_mock.go @@ -86,7 +86,7 @@ func (c *MockProjectClustersServiceInterfaceAddClusterCall) DoAndReturn(f func(a } // DeleteCluster mocks base method. -func (m *MockProjectClustersServiceInterface) DeleteCluster(pid any, cluster int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectClustersServiceInterface) DeleteCluster(pid any, cluster int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, cluster} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockProjectClustersServiceInterfaceDeleteClusterCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockProjectClustersServiceInterfaceDeleteClusterCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectClustersServiceInterfaceDeleteClusterCall { +func (c *MockProjectClustersServiceInterfaceDeleteClusterCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectClustersServiceInterfaceDeleteClusterCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectClustersServiceInterfaceDeleteClusterCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectClustersServiceInterfaceDeleteClusterCall { +func (c *MockProjectClustersServiceInterfaceDeleteClusterCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectClustersServiceInterfaceDeleteClusterCall { c.Call = c.Call.DoAndReturn(f) return c } // EditCluster mocks base method. -func (m *MockProjectClustersServiceInterface) EditCluster(pid any, cluster int, opt *gitlab.EditClusterOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error) { +func (m *MockProjectClustersServiceInterface) EditCluster(pid any, cluster int64, opt *gitlab.EditClusterOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, cluster, opt} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockProjectClustersServiceInterfaceEditClusterCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockProjectClustersServiceInterfaceEditClusterCall) Do(f func(any, int, *gitlab.EditClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error)) *MockProjectClustersServiceInterfaceEditClusterCall { +func (c *MockProjectClustersServiceInterfaceEditClusterCall) Do(f func(any, int64, *gitlab.EditClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error)) *MockProjectClustersServiceInterfaceEditClusterCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectClustersServiceInterfaceEditClusterCall) DoAndReturn(f func(any, int, *gitlab.EditClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error)) *MockProjectClustersServiceInterfaceEditClusterCall { +func (c *MockProjectClustersServiceInterfaceEditClusterCall) DoAndReturn(f func(any, int64, *gitlab.EditClusterOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error)) *MockProjectClustersServiceInterfaceEditClusterCall { c.Call = c.Call.DoAndReturn(f) return c } // GetCluster mocks base method. -func (m *MockProjectClustersServiceInterface) GetCluster(pid any, cluster int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error) { +func (m *MockProjectClustersServiceInterface) GetCluster(pid any, cluster int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, cluster} for _, a := range options { @@ -208,13 +208,13 @@ func (c *MockProjectClustersServiceInterfaceGetClusterCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockProjectClustersServiceInterfaceGetClusterCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error)) *MockProjectClustersServiceInterfaceGetClusterCall { +func (c *MockProjectClustersServiceInterfaceGetClusterCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error)) *MockProjectClustersServiceInterfaceGetClusterCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectClustersServiceInterfaceGetClusterCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error)) *MockProjectClustersServiceInterfaceGetClusterCall { +func (c *MockProjectClustersServiceInterfaceGetClusterCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectCluster, *gitlab.Response, error)) *MockProjectClustersServiceInterfaceGetClusterCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/project_members_mock.go b/testing/project_members_mock.go index 9d94c5d5..807dd209 100644 --- a/testing/project_members_mock.go +++ b/testing/project_members_mock.go @@ -86,7 +86,7 @@ func (c *MockProjectMembersServiceInterfaceAddProjectMemberCall) DoAndReturn(f f } // DeleteProjectMember mocks base method. -func (m *MockProjectMembersServiceInterface) DeleteProjectMember(pid any, user int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectMembersServiceInterface) DeleteProjectMember(pid any, user int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, user} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockProjectMembersServiceInterfaceDeleteProjectMemberCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockProjectMembersServiceInterfaceDeleteProjectMemberCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMembersServiceInterfaceDeleteProjectMemberCall { +func (c *MockProjectMembersServiceInterfaceDeleteProjectMemberCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMembersServiceInterfaceDeleteProjectMemberCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectMembersServiceInterfaceDeleteProjectMemberCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMembersServiceInterfaceDeleteProjectMemberCall { +func (c *MockProjectMembersServiceInterfaceDeleteProjectMemberCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMembersServiceInterfaceDeleteProjectMemberCall { c.Call = c.Call.DoAndReturn(f) return c } // EditProjectMember mocks base method. -func (m *MockProjectMembersServiceInterface) EditProjectMember(pid any, user int, opt *gitlab.EditProjectMemberOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error) { +func (m *MockProjectMembersServiceInterface) EditProjectMember(pid any, user int64, opt *gitlab.EditProjectMemberOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, user, opt} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockProjectMembersServiceInterfaceEditProjectMemberCall) Return(arg0 *g } // Do rewrite *gomock.Call.Do -func (c *MockProjectMembersServiceInterfaceEditProjectMemberCall) Do(f func(any, int, *gitlab.EditProjectMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceEditProjectMemberCall { +func (c *MockProjectMembersServiceInterfaceEditProjectMemberCall) Do(f func(any, int64, *gitlab.EditProjectMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceEditProjectMemberCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectMembersServiceInterfaceEditProjectMemberCall) DoAndReturn(f func(any, int, *gitlab.EditProjectMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceEditProjectMemberCall { +func (c *MockProjectMembersServiceInterfaceEditProjectMemberCall) DoAndReturn(f func(any, int64, *gitlab.EditProjectMemberOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceEditProjectMemberCall { c.Call = c.Call.DoAndReturn(f) return c } // GetInheritedProjectMember mocks base method. -func (m *MockProjectMembersServiceInterface) GetInheritedProjectMember(pid any, user int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error) { +func (m *MockProjectMembersServiceInterface) GetInheritedProjectMember(pid any, user int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, user} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockProjectMembersServiceInterfaceGetInheritedProjectMemberCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockProjectMembersServiceInterfaceGetInheritedProjectMemberCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceGetInheritedProjectMemberCall { +func (c *MockProjectMembersServiceInterfaceGetInheritedProjectMemberCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceGetInheritedProjectMemberCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectMembersServiceInterfaceGetInheritedProjectMemberCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceGetInheritedProjectMemberCall { +func (c *MockProjectMembersServiceInterfaceGetInheritedProjectMemberCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceGetInheritedProjectMemberCall { c.Call = c.Call.DoAndReturn(f) return c } // GetProjectMember mocks base method. -func (m *MockProjectMembersServiceInterface) GetProjectMember(pid any, user int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error) { +func (m *MockProjectMembersServiceInterface) GetProjectMember(pid any, user int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, user} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockProjectMembersServiceInterfaceGetProjectMemberCall) Return(arg0 *gi } // Do rewrite *gomock.Call.Do -func (c *MockProjectMembersServiceInterfaceGetProjectMemberCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceGetProjectMemberCall { +func (c *MockProjectMembersServiceInterfaceGetProjectMemberCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceGetProjectMemberCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectMembersServiceInterfaceGetProjectMemberCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceGetProjectMemberCall { +func (c *MockProjectMembersServiceInterfaceGetProjectMemberCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMember, *gitlab.Response, error)) *MockProjectMembersServiceInterfaceGetProjectMemberCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/project_mirror_mock.go b/testing/project_mirror_mock.go index 26c53bca..2742dc79 100644 --- a/testing/project_mirror_mock.go +++ b/testing/project_mirror_mock.go @@ -86,7 +86,7 @@ func (c *MockProjectMirrorServiceInterfaceAddProjectMirrorCall) DoAndReturn(f fu } // DeleteProjectMirror mocks base method. -func (m *MockProjectMirrorServiceInterface) DeleteProjectMirror(pid any, mirror int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectMirrorServiceInterface) DeleteProjectMirror(pid any, mirror int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mirror} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockProjectMirrorServiceInterfaceDeleteProjectMirrorCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockProjectMirrorServiceInterfaceDeleteProjectMirrorCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMirrorServiceInterfaceDeleteProjectMirrorCall { +func (c *MockProjectMirrorServiceInterfaceDeleteProjectMirrorCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMirrorServiceInterfaceDeleteProjectMirrorCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectMirrorServiceInterfaceDeleteProjectMirrorCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMirrorServiceInterfaceDeleteProjectMirrorCall { +func (c *MockProjectMirrorServiceInterfaceDeleteProjectMirrorCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectMirrorServiceInterfaceDeleteProjectMirrorCall { c.Call = c.Call.DoAndReturn(f) return c } // EditProjectMirror mocks base method. -func (m *MockProjectMirrorServiceInterface) EditProjectMirror(pid any, mirror int, opt *gitlab.EditProjectMirrorOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error) { +func (m *MockProjectMirrorServiceInterface) EditProjectMirror(pid any, mirror int64, opt *gitlab.EditProjectMirrorOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mirror, opt} for _, a := range options { @@ -163,19 +163,19 @@ func (c *MockProjectMirrorServiceInterfaceEditProjectMirrorCall) Return(arg0 *gi } // Do rewrite *gomock.Call.Do -func (c *MockProjectMirrorServiceInterfaceEditProjectMirrorCall) Do(f func(any, int, *gitlab.EditProjectMirrorOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceEditProjectMirrorCall { +func (c *MockProjectMirrorServiceInterfaceEditProjectMirrorCall) Do(f func(any, int64, *gitlab.EditProjectMirrorOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceEditProjectMirrorCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectMirrorServiceInterfaceEditProjectMirrorCall) DoAndReturn(f func(any, int, *gitlab.EditProjectMirrorOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceEditProjectMirrorCall { +func (c *MockProjectMirrorServiceInterfaceEditProjectMirrorCall) DoAndReturn(f func(any, int64, *gitlab.EditProjectMirrorOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceEditProjectMirrorCall { c.Call = c.Call.DoAndReturn(f) return c } // GetProjectMirror mocks base method. -func (m *MockProjectMirrorServiceInterface) GetProjectMirror(pid any, mirror int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error) { +func (m *MockProjectMirrorServiceInterface) GetProjectMirror(pid any, mirror int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mirror} for _, a := range options { @@ -208,19 +208,19 @@ func (c *MockProjectMirrorServiceInterfaceGetProjectMirrorCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockProjectMirrorServiceInterfaceGetProjectMirrorCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceGetProjectMirrorCall { +func (c *MockProjectMirrorServiceInterfaceGetProjectMirrorCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceGetProjectMirrorCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectMirrorServiceInterfaceGetProjectMirrorCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceGetProjectMirrorCall { +func (c *MockProjectMirrorServiceInterfaceGetProjectMirrorCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirror, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceGetProjectMirrorCall { c.Call = c.Call.DoAndReturn(f) return c } // GetProjectMirrorPublicKey mocks base method. -func (m *MockProjectMirrorServiceInterface) GetProjectMirrorPublicKey(pid any, mirror int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirrorPublicKey, *gitlab.Response, error) { +func (m *MockProjectMirrorServiceInterface) GetProjectMirrorPublicKey(pid any, mirror int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirrorPublicKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, mirror} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockProjectMirrorServiceInterfaceGetProjectMirrorPublicKeyCall) Return( } // Do rewrite *gomock.Call.Do -func (c *MockProjectMirrorServiceInterfaceGetProjectMirrorPublicKeyCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirrorPublicKey, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceGetProjectMirrorPublicKeyCall { +func (c *MockProjectMirrorServiceInterfaceGetProjectMirrorPublicKeyCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirrorPublicKey, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceGetProjectMirrorPublicKeyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectMirrorServiceInterfaceGetProjectMirrorPublicKeyCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirrorPublicKey, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceGetProjectMirrorPublicKeyCall { +func (c *MockProjectMirrorServiceInterfaceGetProjectMirrorPublicKeyCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectMirrorPublicKey, *gitlab.Response, error)) *MockProjectMirrorServiceInterfaceGetProjectMirrorPublicKeyCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/project_repository_storage_move_mock.go b/testing/project_repository_storage_move_mock.go index 08fd17c2..6fd01d10 100644 --- a/testing/project_repository_storage_move_mock.go +++ b/testing/project_repository_storage_move_mock.go @@ -41,7 +41,7 @@ func (m *MockProjectRepositoryStorageMoveServiceInterface) EXPECT() *MockProject } // GetStorageMove mocks base method. -func (m *MockProjectRepositoryStorageMoveServiceInterface) GetStorageMove(repositoryStorage int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockProjectRepositoryStorageMoveServiceInterface) GetStorageMove(repositoryStorage int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{repositoryStorage} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) Ret } // Do rewrite *gomock.Call.Do -func (c *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { +func (c *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { +func (c *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { c.Call = c.Call.DoAndReturn(f) return c } // GetStorageMoveForProject mocks base method. -func (m *MockProjectRepositoryStorageMoveServiceInterface) GetStorageMoveForProject(project, repositoryStorage int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockProjectRepositoryStorageMoveServiceInterface) GetStorageMoveForProject(project, repositoryStorage int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{project, repositoryStorage} for _, a := range options { @@ -119,13 +119,13 @@ func (c *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveForProjec } // Do rewrite *gomock.Call.Do -func (c *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveForProjectCall) Do(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveForProjectCall { +func (c *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveForProjectCall) Do(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveForProjectCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveForProjectCall) DoAndReturn(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveForProjectCall { +func (c *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveForProjectCall) DoAndReturn(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceGetStorageMoveForProjectCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -176,7 +176,7 @@ func (c *MockProjectRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMoves } // RetrieveAllStorageMovesForProject mocks base method. -func (m *MockProjectRepositoryStorageMoveServiceInterface) RetrieveAllStorageMovesForProject(project int, opts gitlab.RetrieveAllProjectStorageMovesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockProjectRepositoryStorageMoveServiceInterface) RetrieveAllStorageMovesForProject(project int64, opts gitlab.RetrieveAllProjectStorageMovesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{project, opts} for _, a := range options { @@ -209,13 +209,13 @@ func (c *MockProjectRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMoves } // Do rewrite *gomock.Call.Do -func (c *MockProjectRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForProjectCall) Do(f func(int, gitlab.RetrieveAllProjectStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForProjectCall { +func (c *MockProjectRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForProjectCall) Do(f func(int64, gitlab.RetrieveAllProjectStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForProjectCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForProjectCall) DoAndReturn(f func(int, gitlab.RetrieveAllProjectStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForProjectCall { +func (c *MockProjectRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForProjectCall) DoAndReturn(f func(int64, gitlab.RetrieveAllProjectStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForProjectCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -265,7 +265,7 @@ func (c *MockProjectRepositoryStorageMoveServiceInterfaceScheduleAllStorageMoves } // ScheduleStorageMoveForProject mocks base method. -func (m *MockProjectRepositoryStorageMoveServiceInterface) ScheduleStorageMoveForProject(project int, opts gitlab.ScheduleStorageMoveForProjectOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockProjectRepositoryStorageMoveServiceInterface) ScheduleStorageMoveForProject(project int64, opts gitlab.ScheduleStorageMoveForProjectOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{project, opts} for _, a := range options { @@ -298,13 +298,13 @@ func (c *MockProjectRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForP } // Do rewrite *gomock.Call.Do -func (c *MockProjectRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForProjectCall) Do(f func(int, gitlab.ScheduleStorageMoveForProjectOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForProjectCall { +func (c *MockProjectRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForProjectCall) Do(f func(int64, gitlab.ScheduleStorageMoveForProjectOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForProjectCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForProjectCall) DoAndReturn(f func(int, gitlab.ScheduleStorageMoveForProjectOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForProjectCall { +func (c *MockProjectRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForProjectCall) DoAndReturn(f func(int64, gitlab.ScheduleStorageMoveForProjectOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectRepositoryStorageMove, *gitlab.Response, error)) *MockProjectRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForProjectCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/project_snippets_mock.go b/testing/project_snippets_mock.go index f402bb64..f0be8a24 100644 --- a/testing/project_snippets_mock.go +++ b/testing/project_snippets_mock.go @@ -86,7 +86,7 @@ func (c *MockProjectSnippetsServiceInterfaceCreateSnippetCall) DoAndReturn(f fun } // DeleteSnippet mocks base method. -func (m *MockProjectSnippetsServiceInterface) DeleteSnippet(pid any, snippet int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectSnippetsServiceInterface) DeleteSnippet(pid any, snippet int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockProjectSnippetsServiceInterfaceDeleteSnippetCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockProjectSnippetsServiceInterfaceDeleteSnippetCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceDeleteSnippetCall { +func (c *MockProjectSnippetsServiceInterfaceDeleteSnippetCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceDeleteSnippetCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectSnippetsServiceInterfaceDeleteSnippetCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceDeleteSnippetCall { +func (c *MockProjectSnippetsServiceInterfaceDeleteSnippetCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceDeleteSnippetCall { c.Call = c.Call.DoAndReturn(f) return c } // GetSnippet mocks base method. -func (m *MockProjectSnippetsServiceInterface) GetSnippet(pid any, snippet int, options ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error) { +func (m *MockProjectSnippetsServiceInterface) GetSnippet(pid any, snippet int64, options ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet} for _, a := range options { @@ -163,13 +163,13 @@ func (c *MockProjectSnippetsServiceInterfaceGetSnippetCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockProjectSnippetsServiceInterfaceGetSnippetCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceGetSnippetCall { +func (c *MockProjectSnippetsServiceInterfaceGetSnippetCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceGetSnippetCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectSnippetsServiceInterfaceGetSnippetCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceGetSnippetCall { +func (c *MockProjectSnippetsServiceInterfaceGetSnippetCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceGetSnippetCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -220,7 +220,7 @@ func (c *MockProjectSnippetsServiceInterfaceListSnippetsCall) DoAndReturn(f func } // SnippetContent mocks base method. -func (m *MockProjectSnippetsServiceInterface) SnippetContent(pid any, snippet int, options ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error) { +func (m *MockProjectSnippetsServiceInterface) SnippetContent(pid any, snippet int64, options ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet} for _, a := range options { @@ -253,19 +253,19 @@ func (c *MockProjectSnippetsServiceInterfaceSnippetContentCall) Return(arg0 []by } // Do rewrite *gomock.Call.Do -func (c *MockProjectSnippetsServiceInterfaceSnippetContentCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceSnippetContentCall { +func (c *MockProjectSnippetsServiceInterfaceSnippetContentCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceSnippetContentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectSnippetsServiceInterfaceSnippetContentCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceSnippetContentCall { +func (c *MockProjectSnippetsServiceInterfaceSnippetContentCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceSnippetContentCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateSnippet mocks base method. -func (m *MockProjectSnippetsServiceInterface) UpdateSnippet(pid any, snippet int, opt *gitlab.UpdateProjectSnippetOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error) { +func (m *MockProjectSnippetsServiceInterface) UpdateSnippet(pid any, snippet int64, opt *gitlab.UpdateProjectSnippetOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, snippet, opt} for _, a := range options { @@ -298,13 +298,13 @@ func (c *MockProjectSnippetsServiceInterfaceUpdateSnippetCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockProjectSnippetsServiceInterfaceUpdateSnippetCall) Do(f func(any, int, *gitlab.UpdateProjectSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceUpdateSnippetCall { +func (c *MockProjectSnippetsServiceInterfaceUpdateSnippetCall) Do(f func(any, int64, *gitlab.UpdateProjectSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceUpdateSnippetCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectSnippetsServiceInterfaceUpdateSnippetCall) DoAndReturn(f func(any, int, *gitlab.UpdateProjectSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceUpdateSnippetCall { +func (c *MockProjectSnippetsServiceInterfaceUpdateSnippetCall) DoAndReturn(f func(any, int64, *gitlab.UpdateProjectSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockProjectSnippetsServiceInterfaceUpdateSnippetCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/projects_mock.go b/testing/projects_mock.go index ef1e2769..c1f4a0ce 100644 --- a/testing/projects_mock.go +++ b/testing/projects_mock.go @@ -358,7 +358,7 @@ func (c *MockProjectsServiceInterfaceCreateProjectApprovalRuleCall) DoAndReturn( } // CreateProjectForUser mocks base method. -func (m *MockProjectsServiceInterface) CreateProjectForUser(user int, opt *gitlab.CreateProjectForUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Project, *gitlab.Response, error) { +func (m *MockProjectsServiceInterface) CreateProjectForUser(user int64, opt *gitlab.CreateProjectForUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Project, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -391,19 +391,19 @@ func (c *MockProjectsServiceInterfaceCreateProjectForUserCall) Return(arg0 *gitl } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceCreateProjectForUserCall) Do(f func(int, *gitlab.CreateProjectForUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.Project, *gitlab.Response, error)) *MockProjectsServiceInterfaceCreateProjectForUserCall { +func (c *MockProjectsServiceInterfaceCreateProjectForUserCall) Do(f func(int64, *gitlab.CreateProjectForUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.Project, *gitlab.Response, error)) *MockProjectsServiceInterfaceCreateProjectForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceCreateProjectForUserCall) DoAndReturn(f func(int, *gitlab.CreateProjectForUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.Project, *gitlab.Response, error)) *MockProjectsServiceInterfaceCreateProjectForUserCall { +func (c *MockProjectsServiceInterfaceCreateProjectForUserCall) DoAndReturn(f func(int64, *gitlab.CreateProjectForUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.Project, *gitlab.Response, error)) *MockProjectsServiceInterfaceCreateProjectForUserCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateProjectForkRelation mocks base method. -func (m *MockProjectsServiceInterface) CreateProjectForkRelation(pid any, fork int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectForkRelation, *gitlab.Response, error) { +func (m *MockProjectsServiceInterface) CreateProjectForkRelation(pid any, fork int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectForkRelation, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, fork} for _, a := range options { @@ -436,13 +436,13 @@ func (c *MockProjectsServiceInterfaceCreateProjectForkRelationCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceCreateProjectForkRelationCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectForkRelation, *gitlab.Response, error)) *MockProjectsServiceInterfaceCreateProjectForkRelationCall { +func (c *MockProjectsServiceInterfaceCreateProjectForkRelationCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectForkRelation, *gitlab.Response, error)) *MockProjectsServiceInterfaceCreateProjectForkRelationCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceCreateProjectForkRelationCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectForkRelation, *gitlab.Response, error)) *MockProjectsServiceInterfaceCreateProjectForkRelationCall { +func (c *MockProjectsServiceInterfaceCreateProjectForkRelationCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectForkRelation, *gitlab.Response, error)) *MockProjectsServiceInterfaceCreateProjectForkRelationCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -492,7 +492,7 @@ func (c *MockProjectsServiceInterfaceDeleteProjectCall) DoAndReturn(f func(any, } // DeleteProjectApprovalRule mocks base method. -func (m *MockProjectsServiceInterface) DeleteProjectApprovalRule(pid any, approvalRule int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectsServiceInterface) DeleteProjectApprovalRule(pid any, approvalRule int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, approvalRule} for _, a := range options { @@ -524,19 +524,19 @@ func (c *MockProjectsServiceInterfaceDeleteProjectApprovalRuleCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceDeleteProjectApprovalRuleCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectApprovalRuleCall { +func (c *MockProjectsServiceInterfaceDeleteProjectApprovalRuleCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectApprovalRuleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceDeleteProjectApprovalRuleCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectApprovalRuleCall { +func (c *MockProjectsServiceInterfaceDeleteProjectApprovalRuleCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectApprovalRuleCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteProjectCustomHeader mocks base method. -func (m *MockProjectsServiceInterface) DeleteProjectCustomHeader(pid any, hook int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectsServiceInterface) DeleteProjectCustomHeader(pid any, hook int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, hook, key} for _, a := range options { @@ -568,13 +568,13 @@ func (c *MockProjectsServiceInterfaceDeleteProjectCustomHeaderCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceDeleteProjectCustomHeaderCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectCustomHeaderCall { +func (c *MockProjectsServiceInterfaceDeleteProjectCustomHeaderCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectCustomHeaderCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceDeleteProjectCustomHeaderCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectCustomHeaderCall { +func (c *MockProjectsServiceInterfaceDeleteProjectCustomHeaderCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectCustomHeaderCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -624,7 +624,7 @@ func (c *MockProjectsServiceInterfaceDeleteProjectForkRelationCall) DoAndReturn( } // DeleteProjectHook mocks base method. -func (m *MockProjectsServiceInterface) DeleteProjectHook(pid any, hook int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectsServiceInterface) DeleteProjectHook(pid any, hook int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, hook} for _, a := range options { @@ -656,13 +656,13 @@ func (c *MockProjectsServiceInterfaceDeleteProjectHookCall) Return(arg0 *gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceDeleteProjectHookCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectHookCall { +func (c *MockProjectsServiceInterfaceDeleteProjectHookCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceDeleteProjectHookCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectHookCall { +func (c *MockProjectsServiceInterfaceDeleteProjectHookCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectHookCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -712,7 +712,7 @@ func (c *MockProjectsServiceInterfaceDeleteProjectPushRuleCall) DoAndReturn(f fu } // DeleteProjectWebhookURLVariable mocks base method. -func (m *MockProjectsServiceInterface) DeleteProjectWebhookURLVariable(pid any, hook int, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectsServiceInterface) DeleteProjectWebhookURLVariable(pid any, hook int64, key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, hook, key} for _, a := range options { @@ -744,19 +744,19 @@ func (c *MockProjectsServiceInterfaceDeleteProjectWebhookURLVariableCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceDeleteProjectWebhookURLVariableCall) Do(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectWebhookURLVariableCall { +func (c *MockProjectsServiceInterfaceDeleteProjectWebhookURLVariableCall) Do(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectWebhookURLVariableCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceDeleteProjectWebhookURLVariableCall) DoAndReturn(f func(any, int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectWebhookURLVariableCall { +func (c *MockProjectsServiceInterfaceDeleteProjectWebhookURLVariableCall) DoAndReturn(f func(any, int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteProjectWebhookURLVariableCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteSharedProjectFromGroup mocks base method. -func (m *MockProjectsServiceInterface) DeleteSharedProjectFromGroup(pid any, groupID int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectsServiceInterface) DeleteSharedProjectFromGroup(pid any, groupID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, groupID} for _, a := range options { @@ -788,13 +788,13 @@ func (c *MockProjectsServiceInterfaceDeleteSharedProjectFromGroupCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceDeleteSharedProjectFromGroupCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteSharedProjectFromGroupCall { +func (c *MockProjectsServiceInterfaceDeleteSharedProjectFromGroupCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteSharedProjectFromGroupCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceDeleteSharedProjectFromGroupCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteSharedProjectFromGroupCall { +func (c *MockProjectsServiceInterfaceDeleteSharedProjectFromGroupCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceDeleteSharedProjectFromGroupCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -890,7 +890,7 @@ func (c *MockProjectsServiceInterfaceEditProjectCall) DoAndReturn(f func(any, *g } // EditProjectHook mocks base method. -func (m *MockProjectsServiceInterface) EditProjectHook(pid any, hook int, opt *gitlab.EditProjectHookOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error) { +func (m *MockProjectsServiceInterface) EditProjectHook(pid any, hook int64, opt *gitlab.EditProjectHookOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, hook, opt} for _, a := range options { @@ -923,13 +923,13 @@ func (c *MockProjectsServiceInterfaceEditProjectHookCall) Return(arg0 *gitlab.Pr } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceEditProjectHookCall) Do(f func(any, int, *gitlab.EditProjectHookOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error)) *MockProjectsServiceInterfaceEditProjectHookCall { +func (c *MockProjectsServiceInterfaceEditProjectHookCall) Do(f func(any, int64, *gitlab.EditProjectHookOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error)) *MockProjectsServiceInterfaceEditProjectHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceEditProjectHookCall) DoAndReturn(f func(any, int, *gitlab.EditProjectHookOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error)) *MockProjectsServiceInterfaceEditProjectHookCall { +func (c *MockProjectsServiceInterfaceEditProjectHookCall) DoAndReturn(f func(any, int64, *gitlab.EditProjectHookOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error)) *MockProjectsServiceInterfaceEditProjectHookCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1115,7 +1115,7 @@ func (c *MockProjectsServiceInterfaceGetProjectCall) DoAndReturn(f func(any, *gi } // GetProjectApprovalRule mocks base method. -func (m *MockProjectsServiceInterface) GetProjectApprovalRule(pid any, ruleID int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error) { +func (m *MockProjectsServiceInterface) GetProjectApprovalRule(pid any, ruleID int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, ruleID} for _, a := range options { @@ -1148,13 +1148,13 @@ func (c *MockProjectsServiceInterfaceGetProjectApprovalRuleCall) Return(arg0 *gi } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceGetProjectApprovalRuleCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetProjectApprovalRuleCall { +func (c *MockProjectsServiceInterfaceGetProjectApprovalRuleCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetProjectApprovalRuleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceGetProjectApprovalRuleCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetProjectApprovalRuleCall { +func (c *MockProjectsServiceInterfaceGetProjectApprovalRuleCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetProjectApprovalRuleCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1205,7 +1205,7 @@ func (c *MockProjectsServiceInterfaceGetProjectApprovalRulesCall) DoAndReturn(f } // GetProjectHook mocks base method. -func (m *MockProjectsServiceInterface) GetProjectHook(pid any, hook int, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error) { +func (m *MockProjectsServiceInterface) GetProjectHook(pid any, hook int64, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, hook} for _, a := range options { @@ -1238,13 +1238,13 @@ func (c *MockProjectsServiceInterfaceGetProjectHookCall) Return(arg0 *gitlab.Pro } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceGetProjectHookCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetProjectHookCall { +func (c *MockProjectsServiceInterfaceGetProjectHookCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetProjectHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceGetProjectHookCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetProjectHookCall { +func (c *MockProjectsServiceInterfaceGetProjectHookCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.ProjectHook, *gitlab.Response, error)) *MockProjectsServiceInterfaceGetProjectHookCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1925,7 +1925,7 @@ func (c *MockProjectsServiceInterfaceRestoreProjectCall) DoAndReturn(f func(any, } // SetProjectCustomHeader mocks base method. -func (m *MockProjectsServiceInterface) SetProjectCustomHeader(pid any, hook int, key string, opt *gitlab.SetHookCustomHeaderOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectsServiceInterface) SetProjectCustomHeader(pid any, hook int64, key string, opt *gitlab.SetHookCustomHeaderOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, hook, key, opt} for _, a := range options { @@ -1957,19 +1957,19 @@ func (c *MockProjectsServiceInterfaceSetProjectCustomHeaderCall) Return(arg0 *gi } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceSetProjectCustomHeaderCall) Do(f func(any, int, string, *gitlab.SetHookCustomHeaderOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceSetProjectCustomHeaderCall { +func (c *MockProjectsServiceInterfaceSetProjectCustomHeaderCall) Do(f func(any, int64, string, *gitlab.SetHookCustomHeaderOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceSetProjectCustomHeaderCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceSetProjectCustomHeaderCall) DoAndReturn(f func(any, int, string, *gitlab.SetHookCustomHeaderOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceSetProjectCustomHeaderCall { +func (c *MockProjectsServiceInterfaceSetProjectCustomHeaderCall) DoAndReturn(f func(any, int64, string, *gitlab.SetHookCustomHeaderOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceSetProjectCustomHeaderCall { c.Call = c.Call.DoAndReturn(f) return c } // SetProjectWebhookURLVariable mocks base method. -func (m *MockProjectsServiceInterface) SetProjectWebhookURLVariable(pid any, hook int, key string, opt *gitlab.SetProjectWebhookURLVariableOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectsServiceInterface) SetProjectWebhookURLVariable(pid any, hook int64, key string, opt *gitlab.SetProjectWebhookURLVariableOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, hook, key, opt} for _, a := range options { @@ -2001,13 +2001,13 @@ func (c *MockProjectsServiceInterfaceSetProjectWebhookURLVariableCall) Return(ar } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceSetProjectWebhookURLVariableCall) Do(f func(any, int, string, *gitlab.SetProjectWebhookURLVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceSetProjectWebhookURLVariableCall { +func (c *MockProjectsServiceInterfaceSetProjectWebhookURLVariableCall) Do(f func(any, int64, string, *gitlab.SetProjectWebhookURLVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceSetProjectWebhookURLVariableCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceSetProjectWebhookURLVariableCall) DoAndReturn(f func(any, int, string, *gitlab.SetProjectWebhookURLVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceSetProjectWebhookURLVariableCall { +func (c *MockProjectsServiceInterfaceSetProjectWebhookURLVariableCall) DoAndReturn(f func(any, int64, string, *gitlab.SetProjectWebhookURLVariableOptions, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceSetProjectWebhookURLVariableCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -2235,7 +2235,7 @@ func (c *MockProjectsServiceInterfaceTransferProjectCall) DoAndReturn(f func(any } // TriggerTestProjectHook mocks base method. -func (m *MockProjectsServiceInterface) TriggerTestProjectHook(pid any, hook int, event gitlab.ProjectHookEvent, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockProjectsServiceInterface) TriggerTestProjectHook(pid any, hook int64, event gitlab.ProjectHookEvent, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, hook, event} for _, a := range options { @@ -2267,13 +2267,13 @@ func (c *MockProjectsServiceInterfaceTriggerTestProjectHookCall) Return(arg0 *gi } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceTriggerTestProjectHookCall) Do(f func(any, int, gitlab.ProjectHookEvent, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceTriggerTestProjectHookCall { +func (c *MockProjectsServiceInterfaceTriggerTestProjectHookCall) Do(f func(any, int64, gitlab.ProjectHookEvent, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceTriggerTestProjectHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceTriggerTestProjectHookCall) DoAndReturn(f func(any, int, gitlab.ProjectHookEvent, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceTriggerTestProjectHookCall { +func (c *MockProjectsServiceInterfaceTriggerTestProjectHookCall) DoAndReturn(f func(any, int64, gitlab.ProjectHookEvent, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockProjectsServiceInterfaceTriggerTestProjectHookCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -2369,7 +2369,7 @@ func (c *MockProjectsServiceInterfaceUnstarProjectCall) DoAndReturn(f func(any, } // UpdateProjectApprovalRule mocks base method. -func (m *MockProjectsServiceInterface) UpdateProjectApprovalRule(pid any, approvalRule int, opt *gitlab.UpdateProjectLevelRuleOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error) { +func (m *MockProjectsServiceInterface) UpdateProjectApprovalRule(pid any, approvalRule int64, opt *gitlab.UpdateProjectLevelRuleOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, approvalRule, opt} for _, a := range options { @@ -2402,13 +2402,13 @@ func (c *MockProjectsServiceInterfaceUpdateProjectApprovalRuleCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockProjectsServiceInterfaceUpdateProjectApprovalRuleCall) Do(f func(any, int, *gitlab.UpdateProjectLevelRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error)) *MockProjectsServiceInterfaceUpdateProjectApprovalRuleCall { +func (c *MockProjectsServiceInterfaceUpdateProjectApprovalRuleCall) Do(f func(any, int64, *gitlab.UpdateProjectLevelRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error)) *MockProjectsServiceInterfaceUpdateProjectApprovalRuleCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockProjectsServiceInterfaceUpdateProjectApprovalRuleCall) DoAndReturn(f func(any, int, *gitlab.UpdateProjectLevelRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error)) *MockProjectsServiceInterfaceUpdateProjectApprovalRuleCall { +func (c *MockProjectsServiceInterfaceUpdateProjectApprovalRuleCall) DoAndReturn(f func(any, int64, *gitlab.UpdateProjectLevelRuleOptions, ...gitlab.RequestOptionFunc) (*gitlab.ProjectApprovalRule, *gitlab.Response, error)) *MockProjectsServiceInterfaceUpdateProjectApprovalRuleCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/releaselinks_mock.go b/testing/releaselinks_mock.go index ced8c4a9..a47aec99 100644 --- a/testing/releaselinks_mock.go +++ b/testing/releaselinks_mock.go @@ -86,7 +86,7 @@ func (c *MockReleaseLinksServiceInterfaceCreateReleaseLinkCall) DoAndReturn(f fu } // DeleteReleaseLink mocks base method. -func (m *MockReleaseLinksServiceInterface) DeleteReleaseLink(pid any, tagName string, link int, options ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error) { +func (m *MockReleaseLinksServiceInterface) DeleteReleaseLink(pid any, tagName string, link int64, options ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, tagName, link} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockReleaseLinksServiceInterfaceDeleteReleaseLinkCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockReleaseLinksServiceInterfaceDeleteReleaseLinkCall) Do(f func(any, string, int, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceDeleteReleaseLinkCall { +func (c *MockReleaseLinksServiceInterfaceDeleteReleaseLinkCall) Do(f func(any, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceDeleteReleaseLinkCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockReleaseLinksServiceInterfaceDeleteReleaseLinkCall) DoAndReturn(f func(any, string, int, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceDeleteReleaseLinkCall { +func (c *MockReleaseLinksServiceInterfaceDeleteReleaseLinkCall) DoAndReturn(f func(any, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceDeleteReleaseLinkCall { c.Call = c.Call.DoAndReturn(f) return c } // GetReleaseLink mocks base method. -func (m *MockReleaseLinksServiceInterface) GetReleaseLink(pid any, tagName string, link int, options ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error) { +func (m *MockReleaseLinksServiceInterface) GetReleaseLink(pid any, tagName string, link int64, options ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, tagName, link} for _, a := range options { @@ -164,13 +164,13 @@ func (c *MockReleaseLinksServiceInterfaceGetReleaseLinkCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockReleaseLinksServiceInterfaceGetReleaseLinkCall) Do(f func(any, string, int, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceGetReleaseLinkCall { +func (c *MockReleaseLinksServiceInterfaceGetReleaseLinkCall) Do(f func(any, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceGetReleaseLinkCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockReleaseLinksServiceInterfaceGetReleaseLinkCall) DoAndReturn(f func(any, string, int, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceGetReleaseLinkCall { +func (c *MockReleaseLinksServiceInterfaceGetReleaseLinkCall) DoAndReturn(f func(any, string, int64, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceGetReleaseLinkCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -221,7 +221,7 @@ func (c *MockReleaseLinksServiceInterfaceListReleaseLinksCall) DoAndReturn(f fun } // UpdateReleaseLink mocks base method. -func (m *MockReleaseLinksServiceInterface) UpdateReleaseLink(pid any, tagName string, link int, opt *gitlab.UpdateReleaseLinkOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error) { +func (m *MockReleaseLinksServiceInterface) UpdateReleaseLink(pid any, tagName string, link int64, opt *gitlab.UpdateReleaseLinkOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, tagName, link, opt} for _, a := range options { @@ -254,13 +254,13 @@ func (c *MockReleaseLinksServiceInterfaceUpdateReleaseLinkCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockReleaseLinksServiceInterfaceUpdateReleaseLinkCall) Do(f func(any, string, int, *gitlab.UpdateReleaseLinkOptions, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceUpdateReleaseLinkCall { +func (c *MockReleaseLinksServiceInterfaceUpdateReleaseLinkCall) Do(f func(any, string, int64, *gitlab.UpdateReleaseLinkOptions, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceUpdateReleaseLinkCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockReleaseLinksServiceInterfaceUpdateReleaseLinkCall) DoAndReturn(f func(any, string, int, *gitlab.UpdateReleaseLinkOptions, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceUpdateReleaseLinkCall { +func (c *MockReleaseLinksServiceInterfaceUpdateReleaseLinkCall) DoAndReturn(f func(any, string, int64, *gitlab.UpdateReleaseLinkOptions, ...gitlab.RequestOptionFunc) (*gitlab.ReleaseLink, *gitlab.Response, error)) *MockReleaseLinksServiceInterfaceUpdateReleaseLinkCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/resource_iteration_events_mock.go b/testing/resource_iteration_events_mock.go index 245ec6f2..008b6f7b 100644 --- a/testing/resource_iteration_events_mock.go +++ b/testing/resource_iteration_events_mock.go @@ -41,7 +41,7 @@ func (m *MockResourceIterationEventsServiceInterface) EXPECT() *MockResourceIter } // GetIssueIterationEvent mocks base method. -func (m *MockResourceIterationEventsServiceInterface) GetIssueIterationEvent(pid any, issue, event int, options ...gitlab.RequestOptionFunc) (*gitlab.IterationEvent, *gitlab.Response, error) { +func (m *MockResourceIterationEventsServiceInterface) GetIssueIterationEvent(pid any, issue, event int64, options ...gitlab.RequestOptionFunc) (*gitlab.IterationEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, event} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockResourceIterationEventsServiceInterfaceGetIssueIterationEventCall) } // Do rewrite *gomock.Call.Do -func (c *MockResourceIterationEventsServiceInterfaceGetIssueIterationEventCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.IterationEvent, *gitlab.Response, error)) *MockResourceIterationEventsServiceInterfaceGetIssueIterationEventCall { +func (c *MockResourceIterationEventsServiceInterfaceGetIssueIterationEventCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.IterationEvent, *gitlab.Response, error)) *MockResourceIterationEventsServiceInterfaceGetIssueIterationEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceIterationEventsServiceInterfaceGetIssueIterationEventCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.IterationEvent, *gitlab.Response, error)) *MockResourceIterationEventsServiceInterfaceGetIssueIterationEventCall { +func (c *MockResourceIterationEventsServiceInterfaceGetIssueIterationEventCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.IterationEvent, *gitlab.Response, error)) *MockResourceIterationEventsServiceInterfaceGetIssueIterationEventCall { c.Call = c.Call.DoAndReturn(f) return c } // ListIssueIterationEvents mocks base method. -func (m *MockResourceIterationEventsServiceInterface) ListIssueIterationEvents(pid any, issue int, opt *gitlab.ListIterationEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.IterationEvent, *gitlab.Response, error) { +func (m *MockResourceIterationEventsServiceInterface) ListIssueIterationEvents(pid any, issue int64, opt *gitlab.ListIterationEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.IterationEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -119,13 +119,13 @@ func (c *MockResourceIterationEventsServiceInterfaceListIssueIterationEventsCall } // Do rewrite *gomock.Call.Do -func (c *MockResourceIterationEventsServiceInterfaceListIssueIterationEventsCall) Do(f func(any, int, *gitlab.ListIterationEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.IterationEvent, *gitlab.Response, error)) *MockResourceIterationEventsServiceInterfaceListIssueIterationEventsCall { +func (c *MockResourceIterationEventsServiceInterfaceListIssueIterationEventsCall) Do(f func(any, int64, *gitlab.ListIterationEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.IterationEvent, *gitlab.Response, error)) *MockResourceIterationEventsServiceInterfaceListIssueIterationEventsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceIterationEventsServiceInterfaceListIssueIterationEventsCall) DoAndReturn(f func(any, int, *gitlab.ListIterationEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.IterationEvent, *gitlab.Response, error)) *MockResourceIterationEventsServiceInterfaceListIssueIterationEventsCall { +func (c *MockResourceIterationEventsServiceInterfaceListIssueIterationEventsCall) DoAndReturn(f func(any, int64, *gitlab.ListIterationEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.IterationEvent, *gitlab.Response, error)) *MockResourceIterationEventsServiceInterfaceListIssueIterationEventsCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/resource_label_events_mock.go b/testing/resource_label_events_mock.go index dbd959dc..c4e3cf28 100644 --- a/testing/resource_label_events_mock.go +++ b/testing/resource_label_events_mock.go @@ -41,7 +41,7 @@ func (m *MockResourceLabelEventsServiceInterface) EXPECT() *MockResourceLabelEve } // GetGroupEpicLabelEvent mocks base method. -func (m *MockResourceLabelEventsServiceInterface) GetGroupEpicLabelEvent(gid any, epic, event int, options ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error) { +func (m *MockResourceLabelEventsServiceInterface) GetGroupEpicLabelEvent(gid any, epic, event int64, options ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, event} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockResourceLabelEventsServiceInterfaceGetGroupEpicLabelEventCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockResourceLabelEventsServiceInterfaceGetGroupEpicLabelEventCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetGroupEpicLabelEventCall { +func (c *MockResourceLabelEventsServiceInterfaceGetGroupEpicLabelEventCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetGroupEpicLabelEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceLabelEventsServiceInterfaceGetGroupEpicLabelEventCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetGroupEpicLabelEventCall { +func (c *MockResourceLabelEventsServiceInterfaceGetGroupEpicLabelEventCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetGroupEpicLabelEventCall { c.Call = c.Call.DoAndReturn(f) return c } // GetIssueLabelEvent mocks base method. -func (m *MockResourceLabelEventsServiceInterface) GetIssueLabelEvent(pid any, issue, event int, options ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error) { +func (m *MockResourceLabelEventsServiceInterface) GetIssueLabelEvent(pid any, issue, event int64, options ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, event} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockResourceLabelEventsServiceInterfaceGetIssueLabelEventCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockResourceLabelEventsServiceInterfaceGetIssueLabelEventCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetIssueLabelEventCall { +func (c *MockResourceLabelEventsServiceInterfaceGetIssueLabelEventCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetIssueLabelEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceLabelEventsServiceInterfaceGetIssueLabelEventCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetIssueLabelEventCall { +func (c *MockResourceLabelEventsServiceInterfaceGetIssueLabelEventCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetIssueLabelEventCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestLabelEvent mocks base method. -func (m *MockResourceLabelEventsServiceInterface) GetMergeRequestLabelEvent(pid any, request, event int, options ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error) { +func (m *MockResourceLabelEventsServiceInterface) GetMergeRequestLabelEvent(pid any, request, event int64, options ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, request, event} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockResourceLabelEventsServiceInterfaceGetMergeRequestLabelEventCall) R } // Do rewrite *gomock.Call.Do -func (c *MockResourceLabelEventsServiceInterfaceGetMergeRequestLabelEventCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetMergeRequestLabelEventCall { +func (c *MockResourceLabelEventsServiceInterfaceGetMergeRequestLabelEventCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetMergeRequestLabelEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceLabelEventsServiceInterfaceGetMergeRequestLabelEventCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetMergeRequestLabelEventCall { +func (c *MockResourceLabelEventsServiceInterfaceGetMergeRequestLabelEventCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceGetMergeRequestLabelEventCall { c.Call = c.Call.DoAndReturn(f) return c } // ListGroupEpicLabelEvents mocks base method. -func (m *MockResourceLabelEventsServiceInterface) ListGroupEpicLabelEvents(gid any, epic int, opt *gitlab.ListLabelEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error) { +func (m *MockResourceLabelEventsServiceInterface) ListGroupEpicLabelEvents(gid any, epic int64, opt *gitlab.ListLabelEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{gid, epic, opt} for _, a := range options { @@ -209,19 +209,19 @@ func (c *MockResourceLabelEventsServiceInterfaceListGroupEpicLabelEventsCall) Re } // Do rewrite *gomock.Call.Do -func (c *MockResourceLabelEventsServiceInterfaceListGroupEpicLabelEventsCall) Do(f func(any, int, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListGroupEpicLabelEventsCall { +func (c *MockResourceLabelEventsServiceInterfaceListGroupEpicLabelEventsCall) Do(f func(any, int64, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListGroupEpicLabelEventsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceLabelEventsServiceInterfaceListGroupEpicLabelEventsCall) DoAndReturn(f func(any, int, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListGroupEpicLabelEventsCall { +func (c *MockResourceLabelEventsServiceInterfaceListGroupEpicLabelEventsCall) DoAndReturn(f func(any, int64, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListGroupEpicLabelEventsCall { c.Call = c.Call.DoAndReturn(f) return c } // ListIssueLabelEvents mocks base method. -func (m *MockResourceLabelEventsServiceInterface) ListIssueLabelEvents(pid any, issue int, opt *gitlab.ListLabelEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error) { +func (m *MockResourceLabelEventsServiceInterface) ListIssueLabelEvents(pid any, issue int64, opt *gitlab.ListLabelEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -254,19 +254,19 @@ func (c *MockResourceLabelEventsServiceInterfaceListIssueLabelEventsCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockResourceLabelEventsServiceInterfaceListIssueLabelEventsCall) Do(f func(any, int, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListIssueLabelEventsCall { +func (c *MockResourceLabelEventsServiceInterfaceListIssueLabelEventsCall) Do(f func(any, int64, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListIssueLabelEventsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceLabelEventsServiceInterfaceListIssueLabelEventsCall) DoAndReturn(f func(any, int, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListIssueLabelEventsCall { +func (c *MockResourceLabelEventsServiceInterfaceListIssueLabelEventsCall) DoAndReturn(f func(any, int64, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListIssueLabelEventsCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMergeRequestsLabelEvents mocks base method. -func (m *MockResourceLabelEventsServiceInterface) ListMergeRequestsLabelEvents(pid any, request int, opt *gitlab.ListLabelEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error) { +func (m *MockResourceLabelEventsServiceInterface) ListMergeRequestsLabelEvents(pid any, request int64, opt *gitlab.ListLabelEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, request, opt} for _, a := range options { @@ -299,13 +299,13 @@ func (c *MockResourceLabelEventsServiceInterfaceListMergeRequestsLabelEventsCall } // Do rewrite *gomock.Call.Do -func (c *MockResourceLabelEventsServiceInterfaceListMergeRequestsLabelEventsCall) Do(f func(any, int, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListMergeRequestsLabelEventsCall { +func (c *MockResourceLabelEventsServiceInterfaceListMergeRequestsLabelEventsCall) Do(f func(any, int64, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListMergeRequestsLabelEventsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceLabelEventsServiceInterfaceListMergeRequestsLabelEventsCall) DoAndReturn(f func(any, int, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListMergeRequestsLabelEventsCall { +func (c *MockResourceLabelEventsServiceInterfaceListMergeRequestsLabelEventsCall) DoAndReturn(f func(any, int64, *gitlab.ListLabelEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.LabelEvent, *gitlab.Response, error)) *MockResourceLabelEventsServiceInterfaceListMergeRequestsLabelEventsCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/resource_milestone_events_mock.go b/testing/resource_milestone_events_mock.go index ac8f7956..0b751c1d 100644 --- a/testing/resource_milestone_events_mock.go +++ b/testing/resource_milestone_events_mock.go @@ -41,7 +41,7 @@ func (m *MockResourceMilestoneEventsServiceInterface) EXPECT() *MockResourceMile } // GetIssueMilestoneEvent mocks base method. -func (m *MockResourceMilestoneEventsServiceInterface) GetIssueMilestoneEvent(pid any, issue, event int, options ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error) { +func (m *MockResourceMilestoneEventsServiceInterface) GetIssueMilestoneEvent(pid any, issue, event int64, options ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, event} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockResourceMilestoneEventsServiceInterfaceGetIssueMilestoneEventCall) } // Do rewrite *gomock.Call.Do -func (c *MockResourceMilestoneEventsServiceInterfaceGetIssueMilestoneEventCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceGetIssueMilestoneEventCall { +func (c *MockResourceMilestoneEventsServiceInterfaceGetIssueMilestoneEventCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceGetIssueMilestoneEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceMilestoneEventsServiceInterfaceGetIssueMilestoneEventCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceGetIssueMilestoneEventCall { +func (c *MockResourceMilestoneEventsServiceInterfaceGetIssueMilestoneEventCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceGetIssueMilestoneEventCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestMilestoneEvent mocks base method. -func (m *MockResourceMilestoneEventsServiceInterface) GetMergeRequestMilestoneEvent(pid any, request, event int, options ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error) { +func (m *MockResourceMilestoneEventsServiceInterface) GetMergeRequestMilestoneEvent(pid any, request, event int64, options ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, request, event} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockResourceMilestoneEventsServiceInterfaceGetMergeRequestMilestoneEven } // Do rewrite *gomock.Call.Do -func (c *MockResourceMilestoneEventsServiceInterfaceGetMergeRequestMilestoneEventCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceGetMergeRequestMilestoneEventCall { +func (c *MockResourceMilestoneEventsServiceInterfaceGetMergeRequestMilestoneEventCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceGetMergeRequestMilestoneEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceMilestoneEventsServiceInterfaceGetMergeRequestMilestoneEventCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceGetMergeRequestMilestoneEventCall { +func (c *MockResourceMilestoneEventsServiceInterfaceGetMergeRequestMilestoneEventCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceGetMergeRequestMilestoneEventCall { c.Call = c.Call.DoAndReturn(f) return c } // ListIssueMilestoneEvents mocks base method. -func (m *MockResourceMilestoneEventsServiceInterface) ListIssueMilestoneEvents(pid any, issue int, opt *gitlab.ListMilestoneEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error) { +func (m *MockResourceMilestoneEventsServiceInterface) ListIssueMilestoneEvents(pid any, issue int64, opt *gitlab.ListMilestoneEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockResourceMilestoneEventsServiceInterfaceListIssueMilestoneEventsCall } // Do rewrite *gomock.Call.Do -func (c *MockResourceMilestoneEventsServiceInterfaceListIssueMilestoneEventsCall) Do(f func(any, int, *gitlab.ListMilestoneEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceListIssueMilestoneEventsCall { +func (c *MockResourceMilestoneEventsServiceInterfaceListIssueMilestoneEventsCall) Do(f func(any, int64, *gitlab.ListMilestoneEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceListIssueMilestoneEventsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceMilestoneEventsServiceInterfaceListIssueMilestoneEventsCall) DoAndReturn(f func(any, int, *gitlab.ListMilestoneEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceListIssueMilestoneEventsCall { +func (c *MockResourceMilestoneEventsServiceInterfaceListIssueMilestoneEventsCall) DoAndReturn(f func(any, int64, *gitlab.ListMilestoneEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceListIssueMilestoneEventsCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMergeMilestoneEvents mocks base method. -func (m *MockResourceMilestoneEventsServiceInterface) ListMergeMilestoneEvents(pid any, request int, opt *gitlab.ListMilestoneEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error) { +func (m *MockResourceMilestoneEventsServiceInterface) ListMergeMilestoneEvents(pid any, request int64, opt *gitlab.ListMilestoneEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, request, opt} for _, a := range options { @@ -209,13 +209,13 @@ func (c *MockResourceMilestoneEventsServiceInterfaceListMergeMilestoneEventsCall } // Do rewrite *gomock.Call.Do -func (c *MockResourceMilestoneEventsServiceInterfaceListMergeMilestoneEventsCall) Do(f func(any, int, *gitlab.ListMilestoneEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceListMergeMilestoneEventsCall { +func (c *MockResourceMilestoneEventsServiceInterfaceListMergeMilestoneEventsCall) Do(f func(any, int64, *gitlab.ListMilestoneEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceListMergeMilestoneEventsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceMilestoneEventsServiceInterfaceListMergeMilestoneEventsCall) DoAndReturn(f func(any, int, *gitlab.ListMilestoneEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceListMergeMilestoneEventsCall { +func (c *MockResourceMilestoneEventsServiceInterfaceListMergeMilestoneEventsCall) DoAndReturn(f func(any, int64, *gitlab.ListMilestoneEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.MilestoneEvent, *gitlab.Response, error)) *MockResourceMilestoneEventsServiceInterfaceListMergeMilestoneEventsCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/resource_state_events_mock.go b/testing/resource_state_events_mock.go index 7a143865..411c58d7 100644 --- a/testing/resource_state_events_mock.go +++ b/testing/resource_state_events_mock.go @@ -41,7 +41,7 @@ func (m *MockResourceStateEventsServiceInterface) EXPECT() *MockResourceStateEve } // GetIssueStateEvent mocks base method. -func (m *MockResourceStateEventsServiceInterface) GetIssueStateEvent(pid any, issue, event int, options ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error) { +func (m *MockResourceStateEventsServiceInterface) GetIssueStateEvent(pid any, issue, event int64, options ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, event} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockResourceStateEventsServiceInterfaceGetIssueStateEventCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockResourceStateEventsServiceInterfaceGetIssueStateEventCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceGetIssueStateEventCall { +func (c *MockResourceStateEventsServiceInterfaceGetIssueStateEventCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceGetIssueStateEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceStateEventsServiceInterfaceGetIssueStateEventCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceGetIssueStateEventCall { +func (c *MockResourceStateEventsServiceInterfaceGetIssueStateEventCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceGetIssueStateEventCall { c.Call = c.Call.DoAndReturn(f) return c } // GetMergeRequestStateEvent mocks base method. -func (m *MockResourceStateEventsServiceInterface) GetMergeRequestStateEvent(pid any, request, event int, options ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error) { +func (m *MockResourceStateEventsServiceInterface) GetMergeRequestStateEvent(pid any, request, event int64, options ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, request, event} for _, a := range options { @@ -119,19 +119,19 @@ func (c *MockResourceStateEventsServiceInterfaceGetMergeRequestStateEventCall) R } // Do rewrite *gomock.Call.Do -func (c *MockResourceStateEventsServiceInterfaceGetMergeRequestStateEventCall) Do(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceGetMergeRequestStateEventCall { +func (c *MockResourceStateEventsServiceInterfaceGetMergeRequestStateEventCall) Do(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceGetMergeRequestStateEventCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceStateEventsServiceInterfaceGetMergeRequestStateEventCall) DoAndReturn(f func(any, int, int, ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceGetMergeRequestStateEventCall { +func (c *MockResourceStateEventsServiceInterfaceGetMergeRequestStateEventCall) DoAndReturn(f func(any, int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceGetMergeRequestStateEventCall { c.Call = c.Call.DoAndReturn(f) return c } // ListIssueStateEvents mocks base method. -func (m *MockResourceStateEventsServiceInterface) ListIssueStateEvents(pid any, issue int, opt *gitlab.ListStateEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error) { +func (m *MockResourceStateEventsServiceInterface) ListIssueStateEvents(pid any, issue int64, opt *gitlab.ListStateEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -164,19 +164,19 @@ func (c *MockResourceStateEventsServiceInterfaceListIssueStateEventsCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockResourceStateEventsServiceInterfaceListIssueStateEventsCall) Do(f func(any, int, *gitlab.ListStateEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceListIssueStateEventsCall { +func (c *MockResourceStateEventsServiceInterfaceListIssueStateEventsCall) Do(f func(any, int64, *gitlab.ListStateEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceListIssueStateEventsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceStateEventsServiceInterfaceListIssueStateEventsCall) DoAndReturn(f func(any, int, *gitlab.ListStateEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceListIssueStateEventsCall { +func (c *MockResourceStateEventsServiceInterfaceListIssueStateEventsCall) DoAndReturn(f func(any, int64, *gitlab.ListStateEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceListIssueStateEventsCall { c.Call = c.Call.DoAndReturn(f) return c } // ListMergeStateEvents mocks base method. -func (m *MockResourceStateEventsServiceInterface) ListMergeStateEvents(pid any, request int, opt *gitlab.ListStateEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error) { +func (m *MockResourceStateEventsServiceInterface) ListMergeStateEvents(pid any, request int64, opt *gitlab.ListStateEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, request, opt} for _, a := range options { @@ -209,13 +209,13 @@ func (c *MockResourceStateEventsServiceInterfaceListMergeStateEventsCall) Return } // Do rewrite *gomock.Call.Do -func (c *MockResourceStateEventsServiceInterfaceListMergeStateEventsCall) Do(f func(any, int, *gitlab.ListStateEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceListMergeStateEventsCall { +func (c *MockResourceStateEventsServiceInterfaceListMergeStateEventsCall) Do(f func(any, int64, *gitlab.ListStateEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceListMergeStateEventsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceStateEventsServiceInterfaceListMergeStateEventsCall) DoAndReturn(f func(any, int, *gitlab.ListStateEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceListMergeStateEventsCall { +func (c *MockResourceStateEventsServiceInterfaceListMergeStateEventsCall) DoAndReturn(f func(any, int64, *gitlab.ListStateEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.StateEvent, *gitlab.Response, error)) *MockResourceStateEventsServiceInterfaceListMergeStateEventsCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/resource_weight_events_mock.go b/testing/resource_weight_events_mock.go index e22da461..ff2b7903 100644 --- a/testing/resource_weight_events_mock.go +++ b/testing/resource_weight_events_mock.go @@ -41,7 +41,7 @@ func (m *MockResourceWeightEventsServiceInterface) EXPECT() *MockResourceWeightE } // ListIssueWeightEvents mocks base method. -func (m *MockResourceWeightEventsServiceInterface) ListIssueWeightEvents(pid any, issue int, opt *gitlab.ListWeightEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.WeightEvent, *gitlab.Response, error) { +func (m *MockResourceWeightEventsServiceInterface) ListIssueWeightEvents(pid any, issue int64, opt *gitlab.ListWeightEventsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.WeightEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, issue, opt} for _, a := range options { @@ -74,13 +74,13 @@ func (c *MockResourceWeightEventsServiceInterfaceListIssueWeightEventsCall) Retu } // Do rewrite *gomock.Call.Do -func (c *MockResourceWeightEventsServiceInterfaceListIssueWeightEventsCall) Do(f func(any, int, *gitlab.ListWeightEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.WeightEvent, *gitlab.Response, error)) *MockResourceWeightEventsServiceInterfaceListIssueWeightEventsCall { +func (c *MockResourceWeightEventsServiceInterfaceListIssueWeightEventsCall) Do(f func(any, int64, *gitlab.ListWeightEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.WeightEvent, *gitlab.Response, error)) *MockResourceWeightEventsServiceInterfaceListIssueWeightEventsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockResourceWeightEventsServiceInterfaceListIssueWeightEventsCall) DoAndReturn(f func(any, int, *gitlab.ListWeightEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.WeightEvent, *gitlab.Response, error)) *MockResourceWeightEventsServiceInterfaceListIssueWeightEventsCall { +func (c *MockResourceWeightEventsServiceInterfaceListIssueWeightEventsCall) DoAndReturn(f func(any, int64, *gitlab.ListWeightEventsOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.WeightEvent, *gitlab.Response, error)) *MockResourceWeightEventsServiceInterfaceListIssueWeightEventsCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/runners_mock.go b/testing/runners_mock.go index ce26fb30..f59f1a00 100644 --- a/testing/runners_mock.go +++ b/testing/runners_mock.go @@ -85,7 +85,7 @@ func (c *MockRunnersServiceInterfaceDeleteRegisteredRunnerCall) DoAndReturn(f fu } // DeleteRegisteredRunnerByID mocks base method. -func (m *MockRunnersServiceInterface) DeleteRegisteredRunnerByID(rid int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockRunnersServiceInterface) DeleteRegisteredRunnerByID(rid int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{rid} for _, a := range options { @@ -117,19 +117,19 @@ func (c *MockRunnersServiceInterfaceDeleteRegisteredRunnerByIDCall) Return(arg0 } // Do rewrite *gomock.Call.Do -func (c *MockRunnersServiceInterfaceDeleteRegisteredRunnerByIDCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockRunnersServiceInterfaceDeleteRegisteredRunnerByIDCall { +func (c *MockRunnersServiceInterfaceDeleteRegisteredRunnerByIDCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockRunnersServiceInterfaceDeleteRegisteredRunnerByIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockRunnersServiceInterfaceDeleteRegisteredRunnerByIDCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockRunnersServiceInterfaceDeleteRegisteredRunnerByIDCall { +func (c *MockRunnersServiceInterfaceDeleteRegisteredRunnerByIDCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockRunnersServiceInterfaceDeleteRegisteredRunnerByIDCall { c.Call = c.Call.DoAndReturn(f) return c } // DisableProjectRunner mocks base method. -func (m *MockRunnersServiceInterface) DisableProjectRunner(pid any, runner int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockRunnersServiceInterface) DisableProjectRunner(pid any, runner int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, runner} for _, a := range options { @@ -161,13 +161,13 @@ func (c *MockRunnersServiceInterfaceDisableProjectRunnerCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockRunnersServiceInterfaceDisableProjectRunnerCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockRunnersServiceInterfaceDisableProjectRunnerCall { +func (c *MockRunnersServiceInterfaceDisableProjectRunnerCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockRunnersServiceInterfaceDisableProjectRunnerCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockRunnersServiceInterfaceDisableProjectRunnerCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockRunnersServiceInterfaceDisableProjectRunnerCall { +func (c *MockRunnersServiceInterfaceDisableProjectRunnerCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockRunnersServiceInterfaceDisableProjectRunnerCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -711,7 +711,7 @@ func (c *MockRunnersServiceInterfaceResetProjectRunnerRegistrationTokenCall) DoA } // ResetRunnerAuthenticationToken mocks base method. -func (m *MockRunnersServiceInterface) ResetRunnerAuthenticationToken(rid int, options ...gitlab.RequestOptionFunc) (*gitlab.RunnerAuthenticationToken, *gitlab.Response, error) { +func (m *MockRunnersServiceInterface) ResetRunnerAuthenticationToken(rid int64, options ...gitlab.RequestOptionFunc) (*gitlab.RunnerAuthenticationToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{rid} for _, a := range options { @@ -744,13 +744,13 @@ func (c *MockRunnersServiceInterfaceResetRunnerAuthenticationTokenCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockRunnersServiceInterfaceResetRunnerAuthenticationTokenCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.RunnerAuthenticationToken, *gitlab.Response, error)) *MockRunnersServiceInterfaceResetRunnerAuthenticationTokenCall { +func (c *MockRunnersServiceInterfaceResetRunnerAuthenticationTokenCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.RunnerAuthenticationToken, *gitlab.Response, error)) *MockRunnersServiceInterfaceResetRunnerAuthenticationTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockRunnersServiceInterfaceResetRunnerAuthenticationTokenCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.RunnerAuthenticationToken, *gitlab.Response, error)) *MockRunnersServiceInterfaceResetRunnerAuthenticationTokenCall { +func (c *MockRunnersServiceInterfaceResetRunnerAuthenticationTokenCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.RunnerAuthenticationToken, *gitlab.Response, error)) *MockRunnersServiceInterfaceResetRunnerAuthenticationTokenCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/secure_files_mock.go b/testing/secure_files_mock.go index db80c4d2..1f1a9832 100644 --- a/testing/secure_files_mock.go +++ b/testing/secure_files_mock.go @@ -87,7 +87,7 @@ func (c *MockSecureFilesServiceInterfaceCreateSecureFileCall) DoAndReturn(f func } // DownloadSecureFile mocks base method. -func (m *MockSecureFilesServiceInterface) DownloadSecureFile(pid any, id int, options ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error) { +func (m *MockSecureFilesServiceInterface) DownloadSecureFile(pid any, id int64, options ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, id} for _, a := range options { @@ -120,13 +120,13 @@ func (c *MockSecureFilesServiceInterfaceDownloadSecureFileCall) Return(arg0 io.R } // Do rewrite *gomock.Call.Do -func (c *MockSecureFilesServiceInterfaceDownloadSecureFileCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockSecureFilesServiceInterfaceDownloadSecureFileCall { +func (c *MockSecureFilesServiceInterfaceDownloadSecureFileCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockSecureFilesServiceInterfaceDownloadSecureFileCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSecureFilesServiceInterfaceDownloadSecureFileCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockSecureFilesServiceInterfaceDownloadSecureFileCall { +func (c *MockSecureFilesServiceInterfaceDownloadSecureFileCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (io.Reader, *gitlab.Response, error)) *MockSecureFilesServiceInterfaceDownloadSecureFileCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -177,7 +177,7 @@ func (c *MockSecureFilesServiceInterfaceListProjectSecureFilesCall) DoAndReturn( } // RemoveSecureFile mocks base method. -func (m *MockSecureFilesServiceInterface) RemoveSecureFile(pid any, id int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockSecureFilesServiceInterface) RemoveSecureFile(pid any, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, id} for _, a := range options { @@ -209,19 +209,19 @@ func (c *MockSecureFilesServiceInterfaceRemoveSecureFileCall) Return(arg0 *gitla } // Do rewrite *gomock.Call.Do -func (c *MockSecureFilesServiceInterfaceRemoveSecureFileCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSecureFilesServiceInterfaceRemoveSecureFileCall { +func (c *MockSecureFilesServiceInterfaceRemoveSecureFileCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSecureFilesServiceInterfaceRemoveSecureFileCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSecureFilesServiceInterfaceRemoveSecureFileCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSecureFilesServiceInterfaceRemoveSecureFileCall { +func (c *MockSecureFilesServiceInterfaceRemoveSecureFileCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSecureFilesServiceInterfaceRemoveSecureFileCall { c.Call = c.Call.DoAndReturn(f) return c } // ShowSecureFileDetails mocks base method. -func (m *MockSecureFilesServiceInterface) ShowSecureFileDetails(pid any, id int, options ...gitlab.RequestOptionFunc) (*gitlab.SecureFile, *gitlab.Response, error) { +func (m *MockSecureFilesServiceInterface) ShowSecureFileDetails(pid any, id int64, options ...gitlab.RequestOptionFunc) (*gitlab.SecureFile, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, id} for _, a := range options { @@ -254,13 +254,13 @@ func (c *MockSecureFilesServiceInterfaceShowSecureFileDetailsCall) Return(arg0 * } // Do rewrite *gomock.Call.Do -func (c *MockSecureFilesServiceInterfaceShowSecureFileDetailsCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.SecureFile, *gitlab.Response, error)) *MockSecureFilesServiceInterfaceShowSecureFileDetailsCall { +func (c *MockSecureFilesServiceInterfaceShowSecureFileDetailsCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.SecureFile, *gitlab.Response, error)) *MockSecureFilesServiceInterfaceShowSecureFileDetailsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSecureFilesServiceInterfaceShowSecureFileDetailsCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.SecureFile, *gitlab.Response, error)) *MockSecureFilesServiceInterfaceShowSecureFileDetailsCall { +func (c *MockSecureFilesServiceInterfaceShowSecureFileDetailsCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.SecureFile, *gitlab.Response, error)) *MockSecureFilesServiceInterfaceShowSecureFileDetailsCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/snippet_repository_storage_move_mock.go b/testing/snippet_repository_storage_move_mock.go index a8108bed..f4ec80be 100644 --- a/testing/snippet_repository_storage_move_mock.go +++ b/testing/snippet_repository_storage_move_mock.go @@ -41,7 +41,7 @@ func (m *MockSnippetRepositoryStorageMoveServiceInterface) EXPECT() *MockSnippet } // GetStorageMove mocks base method. -func (m *MockSnippetRepositoryStorageMoveServiceInterface) GetStorageMove(repositoryStorage int, options ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockSnippetRepositoryStorageMoveServiceInterface) GetStorageMove(repositoryStorage int64, options ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{repositoryStorage} for _, a := range options { @@ -74,19 +74,19 @@ func (c *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) Ret } // Do rewrite *gomock.Call.Do -func (c *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { +func (c *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { +func (c *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveCall { c.Call = c.Call.DoAndReturn(f) return c } // GetStorageMoveForSnippet mocks base method. -func (m *MockSnippetRepositoryStorageMoveServiceInterface) GetStorageMoveForSnippet(snippet, repositoryStorage int, options ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockSnippetRepositoryStorageMoveServiceInterface) GetStorageMoveForSnippet(snippet, repositoryStorage int64, options ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{snippet, repositoryStorage} for _, a := range options { @@ -119,13 +119,13 @@ func (c *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveForSnippe } // Do rewrite *gomock.Call.Do -func (c *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveForSnippetCall) Do(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveForSnippetCall { +func (c *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveForSnippetCall) Do(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveForSnippetCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveForSnippetCall) DoAndReturn(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveForSnippetCall { +func (c *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveForSnippetCall) DoAndReturn(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceGetStorageMoveForSnippetCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -176,7 +176,7 @@ func (c *MockSnippetRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMoves } // RetrieveAllStorageMovesForSnippet mocks base method. -func (m *MockSnippetRepositoryStorageMoveServiceInterface) RetrieveAllStorageMovesForSnippet(snippet int, opts gitlab.RetrieveAllSnippetStorageMovesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockSnippetRepositoryStorageMoveServiceInterface) RetrieveAllStorageMovesForSnippet(snippet int64, opts gitlab.RetrieveAllSnippetStorageMovesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{snippet, opts} for _, a := range options { @@ -209,13 +209,13 @@ func (c *MockSnippetRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMoves } // Do rewrite *gomock.Call.Do -func (c *MockSnippetRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForSnippetCall) Do(f func(int, gitlab.RetrieveAllSnippetStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForSnippetCall { +func (c *MockSnippetRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForSnippetCall) Do(f func(int64, gitlab.RetrieveAllSnippetStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForSnippetCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSnippetRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForSnippetCall) DoAndReturn(f func(int, gitlab.RetrieveAllSnippetStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForSnippetCall { +func (c *MockSnippetRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForSnippetCall) DoAndReturn(f func(int64, gitlab.RetrieveAllSnippetStorageMovesOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceRetrieveAllStorageMovesForSnippetCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -265,7 +265,7 @@ func (c *MockSnippetRepositoryStorageMoveServiceInterfaceScheduleAllStorageMoves } // ScheduleStorageMoveForSnippet mocks base method. -func (m *MockSnippetRepositoryStorageMoveServiceInterface) ScheduleStorageMoveForSnippet(snippet int, opts gitlab.ScheduleStorageMoveForSnippetOptions, options ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error) { +func (m *MockSnippetRepositoryStorageMoveServiceInterface) ScheduleStorageMoveForSnippet(snippet int64, opts gitlab.ScheduleStorageMoveForSnippetOptions, options ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{snippet, opts} for _, a := range options { @@ -298,13 +298,13 @@ func (c *MockSnippetRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForS } // Do rewrite *gomock.Call.Do -func (c *MockSnippetRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForSnippetCall) Do(f func(int, gitlab.ScheduleStorageMoveForSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForSnippetCall { +func (c *MockSnippetRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForSnippetCall) Do(f func(int64, gitlab.ScheduleStorageMoveForSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForSnippetCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSnippetRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForSnippetCall) DoAndReturn(f func(int, gitlab.ScheduleStorageMoveForSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForSnippetCall { +func (c *MockSnippetRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForSnippetCall) DoAndReturn(f func(int64, gitlab.ScheduleStorageMoveForSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.SnippetRepositoryStorageMove, *gitlab.Response, error)) *MockSnippetRepositoryStorageMoveServiceInterfaceScheduleStorageMoveForSnippetCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/snippets_mock.go b/testing/snippets_mock.go index 953e07ec..3594f5d6 100644 --- a/testing/snippets_mock.go +++ b/testing/snippets_mock.go @@ -86,7 +86,7 @@ func (c *MockSnippetsServiceInterfaceCreateSnippetCall) DoAndReturn(f func(*gitl } // DeleteSnippet mocks base method. -func (m *MockSnippetsServiceInterface) DeleteSnippet(snippet int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockSnippetsServiceInterface) DeleteSnippet(snippet int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{snippet} for _, a := range options { @@ -118,13 +118,13 @@ func (c *MockSnippetsServiceInterfaceDeleteSnippetCall) Return(arg0 *gitlab.Resp } // Do rewrite *gomock.Call.Do -func (c *MockSnippetsServiceInterfaceDeleteSnippetCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSnippetsServiceInterfaceDeleteSnippetCall { +func (c *MockSnippetsServiceInterfaceDeleteSnippetCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSnippetsServiceInterfaceDeleteSnippetCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSnippetsServiceInterfaceDeleteSnippetCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSnippetsServiceInterfaceDeleteSnippetCall { +func (c *MockSnippetsServiceInterfaceDeleteSnippetCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSnippetsServiceInterfaceDeleteSnippetCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -175,7 +175,7 @@ func (c *MockSnippetsServiceInterfaceExploreSnippetsCall) DoAndReturn(f func(*gi } // GetSnippet mocks base method. -func (m *MockSnippetsServiceInterface) GetSnippet(snippet int, options ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error) { +func (m *MockSnippetsServiceInterface) GetSnippet(snippet int64, options ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{snippet} for _, a := range options { @@ -208,13 +208,13 @@ func (c *MockSnippetsServiceInterfaceGetSnippetCall) Return(arg0 *gitlab.Snippet } // Do rewrite *gomock.Call.Do -func (c *MockSnippetsServiceInterfaceGetSnippetCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockSnippetsServiceInterfaceGetSnippetCall { +func (c *MockSnippetsServiceInterfaceGetSnippetCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockSnippetsServiceInterfaceGetSnippetCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSnippetsServiceInterfaceGetSnippetCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockSnippetsServiceInterfaceGetSnippetCall { +func (c *MockSnippetsServiceInterfaceGetSnippetCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockSnippetsServiceInterfaceGetSnippetCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -310,7 +310,7 @@ func (c *MockSnippetsServiceInterfaceListSnippetsCall) DoAndReturn(f func(*gitla } // SnippetContent mocks base method. -func (m *MockSnippetsServiceInterface) SnippetContent(snippet int, options ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error) { +func (m *MockSnippetsServiceInterface) SnippetContent(snippet int64, options ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{snippet} for _, a := range options { @@ -343,19 +343,19 @@ func (c *MockSnippetsServiceInterfaceSnippetContentCall) Return(arg0 []byte, arg } // Do rewrite *gomock.Call.Do -func (c *MockSnippetsServiceInterfaceSnippetContentCall) Do(f func(int, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockSnippetsServiceInterfaceSnippetContentCall { +func (c *MockSnippetsServiceInterfaceSnippetContentCall) Do(f func(int64, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockSnippetsServiceInterfaceSnippetContentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSnippetsServiceInterfaceSnippetContentCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockSnippetsServiceInterfaceSnippetContentCall { +func (c *MockSnippetsServiceInterfaceSnippetContentCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockSnippetsServiceInterfaceSnippetContentCall { c.Call = c.Call.DoAndReturn(f) return c } // SnippetFileContent mocks base method. -func (m *MockSnippetsServiceInterface) SnippetFileContent(snippet int, ref, filename string, options ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error) { +func (m *MockSnippetsServiceInterface) SnippetFileContent(snippet int64, ref, filename string, options ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{snippet, ref, filename} for _, a := range options { @@ -388,19 +388,19 @@ func (c *MockSnippetsServiceInterfaceSnippetFileContentCall) Return(arg0 []byte, } // Do rewrite *gomock.Call.Do -func (c *MockSnippetsServiceInterfaceSnippetFileContentCall) Do(f func(int, string, string, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockSnippetsServiceInterfaceSnippetFileContentCall { +func (c *MockSnippetsServiceInterfaceSnippetFileContentCall) Do(f func(int64, string, string, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockSnippetsServiceInterfaceSnippetFileContentCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSnippetsServiceInterfaceSnippetFileContentCall) DoAndReturn(f func(int, string, string, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockSnippetsServiceInterfaceSnippetFileContentCall { +func (c *MockSnippetsServiceInterfaceSnippetFileContentCall) DoAndReturn(f func(int64, string, string, ...gitlab.RequestOptionFunc) ([]byte, *gitlab.Response, error)) *MockSnippetsServiceInterfaceSnippetFileContentCall { c.Call = c.Call.DoAndReturn(f) return c } // UpdateSnippet mocks base method. -func (m *MockSnippetsServiceInterface) UpdateSnippet(snippet int, opt *gitlab.UpdateSnippetOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error) { +func (m *MockSnippetsServiceInterface) UpdateSnippet(snippet int64, opt *gitlab.UpdateSnippetOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{snippet, opt} for _, a := range options { @@ -433,13 +433,13 @@ func (c *MockSnippetsServiceInterfaceUpdateSnippetCall) Return(arg0 *gitlab.Snip } // Do rewrite *gomock.Call.Do -func (c *MockSnippetsServiceInterfaceUpdateSnippetCall) Do(f func(int, *gitlab.UpdateSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockSnippetsServiceInterfaceUpdateSnippetCall { +func (c *MockSnippetsServiceInterfaceUpdateSnippetCall) Do(f func(int64, *gitlab.UpdateSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockSnippetsServiceInterfaceUpdateSnippetCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSnippetsServiceInterfaceUpdateSnippetCall) DoAndReturn(f func(int, *gitlab.UpdateSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockSnippetsServiceInterfaceUpdateSnippetCall { +func (c *MockSnippetsServiceInterfaceUpdateSnippetCall) DoAndReturn(f func(int64, *gitlab.UpdateSnippetOptions, ...gitlab.RequestOptionFunc) (*gitlab.Snippet, *gitlab.Response, error)) *MockSnippetsServiceInterfaceUpdateSnippetCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/system_hooks_mock.go b/testing/system_hooks_mock.go index 9f6686b8..7cd6cdf0 100644 --- a/testing/system_hooks_mock.go +++ b/testing/system_hooks_mock.go @@ -86,7 +86,7 @@ func (c *MockSystemHooksServiceInterfaceAddHookCall) DoAndReturn(f func(*gitlab. } // DeleteHook mocks base method. -func (m *MockSystemHooksServiceInterface) DeleteHook(hook int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockSystemHooksServiceInterface) DeleteHook(hook int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{hook} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockSystemHooksServiceInterfaceDeleteHookCall) Return(arg0 *gitlab.Resp } // Do rewrite *gomock.Call.Do -func (c *MockSystemHooksServiceInterfaceDeleteHookCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSystemHooksServiceInterfaceDeleteHookCall { +func (c *MockSystemHooksServiceInterfaceDeleteHookCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSystemHooksServiceInterfaceDeleteHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSystemHooksServiceInterfaceDeleteHookCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSystemHooksServiceInterfaceDeleteHookCall { +func (c *MockSystemHooksServiceInterfaceDeleteHookCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockSystemHooksServiceInterfaceDeleteHookCall { c.Call = c.Call.DoAndReturn(f) return c } // GetHook mocks base method. -func (m *MockSystemHooksServiceInterface) GetHook(hook int, options ...gitlab.RequestOptionFunc) (*gitlab.Hook, *gitlab.Response, error) { +func (m *MockSystemHooksServiceInterface) GetHook(hook int64, options ...gitlab.RequestOptionFunc) (*gitlab.Hook, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{hook} for _, a := range options { @@ -163,13 +163,13 @@ func (c *MockSystemHooksServiceInterfaceGetHookCall) Return(arg0 *gitlab.Hook, a } // Do rewrite *gomock.Call.Do -func (c *MockSystemHooksServiceInterfaceGetHookCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Hook, *gitlab.Response, error)) *MockSystemHooksServiceInterfaceGetHookCall { +func (c *MockSystemHooksServiceInterfaceGetHookCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Hook, *gitlab.Response, error)) *MockSystemHooksServiceInterfaceGetHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSystemHooksServiceInterfaceGetHookCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Hook, *gitlab.Response, error)) *MockSystemHooksServiceInterfaceGetHookCall { +func (c *MockSystemHooksServiceInterfaceGetHookCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Hook, *gitlab.Response, error)) *MockSystemHooksServiceInterfaceGetHookCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -219,7 +219,7 @@ func (c *MockSystemHooksServiceInterfaceListHooksCall) DoAndReturn(f func(...git } // TestHook mocks base method. -func (m *MockSystemHooksServiceInterface) TestHook(hook int, options ...gitlab.RequestOptionFunc) (*gitlab.HookEvent, *gitlab.Response, error) { +func (m *MockSystemHooksServiceInterface) TestHook(hook int64, options ...gitlab.RequestOptionFunc) (*gitlab.HookEvent, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{hook} for _, a := range options { @@ -252,13 +252,13 @@ func (c *MockSystemHooksServiceInterfaceTestHookCall) Return(arg0 *gitlab.HookEv } // Do rewrite *gomock.Call.Do -func (c *MockSystemHooksServiceInterfaceTestHookCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.HookEvent, *gitlab.Response, error)) *MockSystemHooksServiceInterfaceTestHookCall { +func (c *MockSystemHooksServiceInterfaceTestHookCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.HookEvent, *gitlab.Response, error)) *MockSystemHooksServiceInterfaceTestHookCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockSystemHooksServiceInterfaceTestHookCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.HookEvent, *gitlab.Response, error)) *MockSystemHooksServiceInterfaceTestHookCall { +func (c *MockSystemHooksServiceInterfaceTestHookCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.HookEvent, *gitlab.Response, error)) *MockSystemHooksServiceInterfaceTestHookCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/todos_mock.go b/testing/todos_mock.go index d54e8fc8..f81191d4 100644 --- a/testing/todos_mock.go +++ b/testing/todos_mock.go @@ -129,7 +129,7 @@ func (c *MockTodosServiceInterfaceMarkAllTodosAsDoneCall) DoAndReturn(f func(... } // MarkTodoAsDone mocks base method. -func (m *MockTodosServiceInterface) MarkTodoAsDone(id int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockTodosServiceInterface) MarkTodoAsDone(id int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{id} for _, a := range options { @@ -161,13 +161,13 @@ func (c *MockTodosServiceInterfaceMarkTodoAsDoneCall) Return(arg0 *gitlab.Respon } // Do rewrite *gomock.Call.Do -func (c *MockTodosServiceInterfaceMarkTodoAsDoneCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockTodosServiceInterfaceMarkTodoAsDoneCall { +func (c *MockTodosServiceInterfaceMarkTodoAsDoneCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockTodosServiceInterfaceMarkTodoAsDoneCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockTodosServiceInterfaceMarkTodoAsDoneCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockTodosServiceInterfaceMarkTodoAsDoneCall { +func (c *MockTodosServiceInterfaceMarkTodoAsDoneCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockTodosServiceInterfaceMarkTodoAsDoneCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/topics_mock.go b/testing/topics_mock.go index fba14898..79fa9aca 100644 --- a/testing/topics_mock.go +++ b/testing/topics_mock.go @@ -86,7 +86,7 @@ func (c *MockTopicsServiceInterfaceCreateTopicCall) DoAndReturn(f func(*gitlab.C } // DeleteTopic mocks base method. -func (m *MockTopicsServiceInterface) DeleteTopic(topic int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockTopicsServiceInterface) DeleteTopic(topic int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{topic} for _, a := range options { @@ -118,19 +118,19 @@ func (c *MockTopicsServiceInterfaceDeleteTopicCall) Return(arg0 *gitlab.Response } // Do rewrite *gomock.Call.Do -func (c *MockTopicsServiceInterfaceDeleteTopicCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockTopicsServiceInterfaceDeleteTopicCall { +func (c *MockTopicsServiceInterfaceDeleteTopicCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockTopicsServiceInterfaceDeleteTopicCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockTopicsServiceInterfaceDeleteTopicCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockTopicsServiceInterfaceDeleteTopicCall { +func (c *MockTopicsServiceInterfaceDeleteTopicCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockTopicsServiceInterfaceDeleteTopicCall { c.Call = c.Call.DoAndReturn(f) return c } // GetTopic mocks base method. -func (m *MockTopicsServiceInterface) GetTopic(topic int, options ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error) { +func (m *MockTopicsServiceInterface) GetTopic(topic int64, options ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{topic} for _, a := range options { @@ -163,13 +163,13 @@ func (c *MockTopicsServiceInterfaceGetTopicCall) Return(arg0 *gitlab.Topic, arg1 } // Do rewrite *gomock.Call.Do -func (c *MockTopicsServiceInterfaceGetTopicCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error)) *MockTopicsServiceInterfaceGetTopicCall { +func (c *MockTopicsServiceInterfaceGetTopicCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error)) *MockTopicsServiceInterfaceGetTopicCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockTopicsServiceInterfaceGetTopicCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error)) *MockTopicsServiceInterfaceGetTopicCall { +func (c *MockTopicsServiceInterfaceGetTopicCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error)) *MockTopicsServiceInterfaceGetTopicCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -220,7 +220,7 @@ func (c *MockTopicsServiceInterfaceListTopicsCall) DoAndReturn(f func(*gitlab.Li } // UpdateTopic mocks base method. -func (m *MockTopicsServiceInterface) UpdateTopic(topic int, opt *gitlab.UpdateTopicOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error) { +func (m *MockTopicsServiceInterface) UpdateTopic(topic int64, opt *gitlab.UpdateTopicOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{topic, opt} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockTopicsServiceInterfaceUpdateTopicCall) Return(arg0 *gitlab.Topic, a } // Do rewrite *gomock.Call.Do -func (c *MockTopicsServiceInterfaceUpdateTopicCall) Do(f func(int, *gitlab.UpdateTopicOptions, ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error)) *MockTopicsServiceInterfaceUpdateTopicCall { +func (c *MockTopicsServiceInterfaceUpdateTopicCall) Do(f func(int64, *gitlab.UpdateTopicOptions, ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error)) *MockTopicsServiceInterfaceUpdateTopicCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockTopicsServiceInterfaceUpdateTopicCall) DoAndReturn(f func(int, *gitlab.UpdateTopicOptions, ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error)) *MockTopicsServiceInterfaceUpdateTopicCall { +func (c *MockTopicsServiceInterfaceUpdateTopicCall) DoAndReturn(f func(int64, *gitlab.UpdateTopicOptions, ...gitlab.RequestOptionFunc) (*gitlab.Topic, *gitlab.Response, error)) *MockTopicsServiceInterfaceUpdateTopicCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/users_mock.go b/testing/users_mock.go index 25276992..06a3bdc8 100644 --- a/testing/users_mock.go +++ b/testing/users_mock.go @@ -42,7 +42,7 @@ func (m *MockUsersServiceInterface) EXPECT() *MockUsersServiceInterfaceMockRecor } // ActivateUser mocks base method. -func (m *MockUsersServiceInterface) ActivateUser(user int, options ...gitlab.RequestOptionFunc) error { +func (m *MockUsersServiceInterface) ActivateUser(user int64, options ...gitlab.RequestOptionFunc) error { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -73,13 +73,13 @@ func (c *MockUsersServiceInterfaceActivateUserCall) Return(arg0 error) *MockUser } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceActivateUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceActivateUserCall { +func (c *MockUsersServiceInterfaceActivateUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceActivateUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceActivateUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceActivateUserCall { +func (c *MockUsersServiceInterfaceActivateUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceActivateUserCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -130,7 +130,7 @@ func (c *MockUsersServiceInterfaceAddEmailCall) DoAndReturn(f func(*gitlab.AddEm } // AddEmailForUser mocks base method. -func (m *MockUsersServiceInterface) AddEmailForUser(user int, opt *gitlab.AddEmailOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) AddEmailForUser(user int64, opt *gitlab.AddEmailOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -163,13 +163,13 @@ func (c *MockUsersServiceInterfaceAddEmailForUserCall) Return(arg0 *gitlab.Email } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceAddEmailForUserCall) Do(f func(int, *gitlab.AddEmailOptions, ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceAddEmailForUserCall { +func (c *MockUsersServiceInterfaceAddEmailForUserCall) Do(f func(int64, *gitlab.AddEmailOptions, ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceAddEmailForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceAddEmailForUserCall) DoAndReturn(f func(int, *gitlab.AddEmailOptions, ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceAddEmailForUserCall { +func (c *MockUsersServiceInterfaceAddEmailForUserCall) DoAndReturn(f func(int64, *gitlab.AddEmailOptions, ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceAddEmailForUserCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -220,7 +220,7 @@ func (c *MockUsersServiceInterfaceAddGPGKeyCall) DoAndReturn(f func(*gitlab.AddG } // AddGPGKeyForUser mocks base method. -func (m *MockUsersServiceInterface) AddGPGKeyForUser(user int, opt *gitlab.AddGPGKeyOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) AddGPGKeyForUser(user int64, opt *gitlab.AddGPGKeyOptions, options ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -253,13 +253,13 @@ func (c *MockUsersServiceInterfaceAddGPGKeyForUserCall) Return(arg0 *gitlab.GPGK } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceAddGPGKeyForUserCall) Do(f func(int, *gitlab.AddGPGKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceAddGPGKeyForUserCall { +func (c *MockUsersServiceInterfaceAddGPGKeyForUserCall) Do(f func(int64, *gitlab.AddGPGKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceAddGPGKeyForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceAddGPGKeyForUserCall) DoAndReturn(f func(int, *gitlab.AddGPGKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceAddGPGKeyForUserCall { +func (c *MockUsersServiceInterfaceAddGPGKeyForUserCall) DoAndReturn(f func(int64, *gitlab.AddGPGKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceAddGPGKeyForUserCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -310,7 +310,7 @@ func (c *MockUsersServiceInterfaceAddSSHKeyCall) DoAndReturn(f func(*gitlab.AddS } // AddSSHKeyForUser mocks base method. -func (m *MockUsersServiceInterface) AddSSHKeyForUser(user int, opt *gitlab.AddSSHKeyOptions, options ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) AddSSHKeyForUser(user int64, opt *gitlab.AddSSHKeyOptions, options ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -343,19 +343,19 @@ func (c *MockUsersServiceInterfaceAddSSHKeyForUserCall) Return(arg0 *gitlab.SSHK } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceAddSSHKeyForUserCall) Do(f func(int, *gitlab.AddSSHKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceAddSSHKeyForUserCall { +func (c *MockUsersServiceInterfaceAddSSHKeyForUserCall) Do(f func(int64, *gitlab.AddSSHKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceAddSSHKeyForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceAddSSHKeyForUserCall) DoAndReturn(f func(int, *gitlab.AddSSHKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceAddSSHKeyForUserCall { +func (c *MockUsersServiceInterfaceAddSSHKeyForUserCall) DoAndReturn(f func(int64, *gitlab.AddSSHKeyOptions, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceAddSSHKeyForUserCall { c.Call = c.Call.DoAndReturn(f) return c } // ApproveUser mocks base method. -func (m *MockUsersServiceInterface) ApproveUser(user int, options ...gitlab.RequestOptionFunc) error { +func (m *MockUsersServiceInterface) ApproveUser(user int64, options ...gitlab.RequestOptionFunc) error { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -386,19 +386,19 @@ func (c *MockUsersServiceInterfaceApproveUserCall) Return(arg0 error) *MockUsers } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceApproveUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceApproveUserCall { +func (c *MockUsersServiceInterfaceApproveUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceApproveUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceApproveUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceApproveUserCall { +func (c *MockUsersServiceInterfaceApproveUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceApproveUserCall { c.Call = c.Call.DoAndReturn(f) return c } // BanUser mocks base method. -func (m *MockUsersServiceInterface) BanUser(user int, options ...gitlab.RequestOptionFunc) error { +func (m *MockUsersServiceInterface) BanUser(user int64, options ...gitlab.RequestOptionFunc) error { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -429,19 +429,19 @@ func (c *MockUsersServiceInterfaceBanUserCall) Return(arg0 error) *MockUsersServ } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceBanUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceBanUserCall { +func (c *MockUsersServiceInterfaceBanUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceBanUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceBanUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceBanUserCall { +func (c *MockUsersServiceInterfaceBanUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceBanUserCall { c.Call = c.Call.DoAndReturn(f) return c } // BlockUser mocks base method. -func (m *MockUsersServiceInterface) BlockUser(user int, options ...gitlab.RequestOptionFunc) error { +func (m *MockUsersServiceInterface) BlockUser(user int64, options ...gitlab.RequestOptionFunc) error { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -472,19 +472,19 @@ func (c *MockUsersServiceInterfaceBlockUserCall) Return(arg0 error) *MockUsersSe } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceBlockUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceBlockUserCall { +func (c *MockUsersServiceInterfaceBlockUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceBlockUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceBlockUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceBlockUserCall { +func (c *MockUsersServiceInterfaceBlockUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceBlockUserCall { c.Call = c.Call.DoAndReturn(f) return c } // CreateImpersonationToken mocks base method. -func (m *MockUsersServiceInterface) CreateImpersonationToken(user int, opt *gitlab.CreateImpersonationTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) CreateImpersonationToken(user int64, opt *gitlab.CreateImpersonationTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -517,19 +517,19 @@ func (c *MockUsersServiceInterfaceCreateImpersonationTokenCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceCreateImpersonationTokenCall) Do(f func(int, *gitlab.CreateImpersonationTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceCreateImpersonationTokenCall { +func (c *MockUsersServiceInterfaceCreateImpersonationTokenCall) Do(f func(int64, *gitlab.CreateImpersonationTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceCreateImpersonationTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceCreateImpersonationTokenCall) DoAndReturn(f func(int, *gitlab.CreateImpersonationTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceCreateImpersonationTokenCall { +func (c *MockUsersServiceInterfaceCreateImpersonationTokenCall) DoAndReturn(f func(int64, *gitlab.CreateImpersonationTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceCreateImpersonationTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // CreatePersonalAccessToken mocks base method. -func (m *MockUsersServiceInterface) CreatePersonalAccessToken(user int, opt *gitlab.CreatePersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) CreatePersonalAccessToken(user int64, opt *gitlab.CreatePersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -562,13 +562,13 @@ func (c *MockUsersServiceInterfaceCreatePersonalAccessTokenCall) Return(arg0 *gi } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceCreatePersonalAccessTokenCall) Do(f func(int, *gitlab.CreatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockUsersServiceInterfaceCreatePersonalAccessTokenCall { +func (c *MockUsersServiceInterfaceCreatePersonalAccessTokenCall) Do(f func(int64, *gitlab.CreatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockUsersServiceInterfaceCreatePersonalAccessTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceCreatePersonalAccessTokenCall) DoAndReturn(f func(int, *gitlab.CreatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockUsersServiceInterfaceCreatePersonalAccessTokenCall { +func (c *MockUsersServiceInterfaceCreatePersonalAccessTokenCall) DoAndReturn(f func(int64, *gitlab.CreatePersonalAccessTokenOptions, ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)) *MockUsersServiceInterfaceCreatePersonalAccessTokenCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -842,7 +842,7 @@ func (c *MockUsersServiceInterfaceCurrentUserStatusCall) DoAndReturn(f func(...g } // DeactivateUser mocks base method. -func (m *MockUsersServiceInterface) DeactivateUser(user int, options ...gitlab.RequestOptionFunc) error { +func (m *MockUsersServiceInterface) DeactivateUser(user int64, options ...gitlab.RequestOptionFunc) error { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -873,19 +873,19 @@ func (c *MockUsersServiceInterfaceDeactivateUserCall) Return(arg0 error) *MockUs } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceDeactivateUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceDeactivateUserCall { +func (c *MockUsersServiceInterfaceDeactivateUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceDeactivateUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceDeactivateUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceDeactivateUserCall { +func (c *MockUsersServiceInterfaceDeactivateUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceDeactivateUserCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteEmail mocks base method. -func (m *MockUsersServiceInterface) DeleteEmail(email int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockUsersServiceInterface) DeleteEmail(email int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{email} for _, a := range options { @@ -917,19 +917,19 @@ func (c *MockUsersServiceInterfaceDeleteEmailCall) Return(arg0 *gitlab.Response, } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceDeleteEmailCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteEmailCall { +func (c *MockUsersServiceInterfaceDeleteEmailCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteEmailCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceDeleteEmailCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteEmailCall { +func (c *MockUsersServiceInterfaceDeleteEmailCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteEmailCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteEmailForUser mocks base method. -func (m *MockUsersServiceInterface) DeleteEmailForUser(user, email int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockUsersServiceInterface) DeleteEmailForUser(user, email int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, email} for _, a := range options { @@ -961,19 +961,19 @@ func (c *MockUsersServiceInterfaceDeleteEmailForUserCall) Return(arg0 *gitlab.Re } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceDeleteEmailForUserCall) Do(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteEmailForUserCall { +func (c *MockUsersServiceInterfaceDeleteEmailForUserCall) Do(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteEmailForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceDeleteEmailForUserCall) DoAndReturn(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteEmailForUserCall { +func (c *MockUsersServiceInterfaceDeleteEmailForUserCall) DoAndReturn(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteEmailForUserCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteGPGKey mocks base method. -func (m *MockUsersServiceInterface) DeleteGPGKey(key int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockUsersServiceInterface) DeleteGPGKey(key int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{key} for _, a := range options { @@ -1005,19 +1005,19 @@ func (c *MockUsersServiceInterfaceDeleteGPGKeyCall) Return(arg0 *gitlab.Response } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceDeleteGPGKeyCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteGPGKeyCall { +func (c *MockUsersServiceInterfaceDeleteGPGKeyCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteGPGKeyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceDeleteGPGKeyCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteGPGKeyCall { +func (c *MockUsersServiceInterfaceDeleteGPGKeyCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteGPGKeyCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteGPGKeyForUser mocks base method. -func (m *MockUsersServiceInterface) DeleteGPGKeyForUser(user, key int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockUsersServiceInterface) DeleteGPGKeyForUser(user, key int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, key} for _, a := range options { @@ -1049,19 +1049,19 @@ func (c *MockUsersServiceInterfaceDeleteGPGKeyForUserCall) Return(arg0 *gitlab.R } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceDeleteGPGKeyForUserCall) Do(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteGPGKeyForUserCall { +func (c *MockUsersServiceInterfaceDeleteGPGKeyForUserCall) Do(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteGPGKeyForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceDeleteGPGKeyForUserCall) DoAndReturn(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteGPGKeyForUserCall { +func (c *MockUsersServiceInterfaceDeleteGPGKeyForUserCall) DoAndReturn(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteGPGKeyForUserCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteSSHKey mocks base method. -func (m *MockUsersServiceInterface) DeleteSSHKey(key int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockUsersServiceInterface) DeleteSSHKey(key int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{key} for _, a := range options { @@ -1093,19 +1093,19 @@ func (c *MockUsersServiceInterfaceDeleteSSHKeyCall) Return(arg0 *gitlab.Response } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceDeleteSSHKeyCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteSSHKeyCall { +func (c *MockUsersServiceInterfaceDeleteSSHKeyCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteSSHKeyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceDeleteSSHKeyCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteSSHKeyCall { +func (c *MockUsersServiceInterfaceDeleteSSHKeyCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteSSHKeyCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteSSHKeyForUser mocks base method. -func (m *MockUsersServiceInterface) DeleteSSHKeyForUser(user, key int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockUsersServiceInterface) DeleteSSHKeyForUser(user, key int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, key} for _, a := range options { @@ -1137,19 +1137,19 @@ func (c *MockUsersServiceInterfaceDeleteSSHKeyForUserCall) Return(arg0 *gitlab.R } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceDeleteSSHKeyForUserCall) Do(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteSSHKeyForUserCall { +func (c *MockUsersServiceInterfaceDeleteSSHKeyForUserCall) Do(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteSSHKeyForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceDeleteSSHKeyForUserCall) DoAndReturn(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteSSHKeyForUserCall { +func (c *MockUsersServiceInterfaceDeleteSSHKeyForUserCall) DoAndReturn(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteSSHKeyForUserCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteUser mocks base method. -func (m *MockUsersServiceInterface) DeleteUser(user int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockUsersServiceInterface) DeleteUser(user int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -1181,19 +1181,19 @@ func (c *MockUsersServiceInterfaceDeleteUserCall) Return(arg0 *gitlab.Response, } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceDeleteUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteUserCall { +func (c *MockUsersServiceInterfaceDeleteUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceDeleteUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteUserCall { +func (c *MockUsersServiceInterfaceDeleteUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteUserCall { c.Call = c.Call.DoAndReturn(f) return c } // DeleteUserIdentity mocks base method. -func (m *MockUsersServiceInterface) DeleteUserIdentity(user int, provider string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockUsersServiceInterface) DeleteUserIdentity(user int64, provider string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, provider} for _, a := range options { @@ -1225,19 +1225,19 @@ func (c *MockUsersServiceInterfaceDeleteUserIdentityCall) Return(arg0 *gitlab.Re } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceDeleteUserIdentityCall) Do(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteUserIdentityCall { +func (c *MockUsersServiceInterfaceDeleteUserIdentityCall) Do(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteUserIdentityCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceDeleteUserIdentityCall) DoAndReturn(f func(int, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteUserIdentityCall { +func (c *MockUsersServiceInterfaceDeleteUserIdentityCall) DoAndReturn(f func(int64, string, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceDeleteUserIdentityCall { c.Call = c.Call.DoAndReturn(f) return c } // DisableTwoFactor mocks base method. -func (m *MockUsersServiceInterface) DisableTwoFactor(user int, options ...gitlab.RequestOptionFunc) error { +func (m *MockUsersServiceInterface) DisableTwoFactor(user int64, options ...gitlab.RequestOptionFunc) error { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -1268,19 +1268,19 @@ func (c *MockUsersServiceInterfaceDisableTwoFactorCall) Return(arg0 error) *Mock } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceDisableTwoFactorCall) Do(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceDisableTwoFactorCall { +func (c *MockUsersServiceInterfaceDisableTwoFactorCall) Do(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceDisableTwoFactorCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceDisableTwoFactorCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceDisableTwoFactorCall { +func (c *MockUsersServiceInterfaceDisableTwoFactorCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceDisableTwoFactorCall { c.Call = c.Call.DoAndReturn(f) return c } // GetAllImpersonationTokens mocks base method. -func (m *MockUsersServiceInterface) GetAllImpersonationTokens(user int, opt *gitlab.GetAllImpersonationTokensOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.ImpersonationToken, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) GetAllImpersonationTokens(user int64, opt *gitlab.GetAllImpersonationTokensOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.ImpersonationToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -1313,19 +1313,19 @@ func (c *MockUsersServiceInterfaceGetAllImpersonationTokensCall) Return(arg0 []* } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceGetAllImpersonationTokensCall) Do(f func(int, *gitlab.GetAllImpersonationTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceGetAllImpersonationTokensCall { +func (c *MockUsersServiceInterfaceGetAllImpersonationTokensCall) Do(f func(int64, *gitlab.GetAllImpersonationTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceGetAllImpersonationTokensCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceGetAllImpersonationTokensCall) DoAndReturn(f func(int, *gitlab.GetAllImpersonationTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceGetAllImpersonationTokensCall { +func (c *MockUsersServiceInterfaceGetAllImpersonationTokensCall) DoAndReturn(f func(int64, *gitlab.GetAllImpersonationTokensOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceGetAllImpersonationTokensCall { c.Call = c.Call.DoAndReturn(f) return c } // GetEmail mocks base method. -func (m *MockUsersServiceInterface) GetEmail(email int, options ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) GetEmail(email int64, options ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{email} for _, a := range options { @@ -1358,19 +1358,19 @@ func (c *MockUsersServiceInterfaceGetEmailCall) Return(arg0 *gitlab.Email, arg1 } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceGetEmailCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceGetEmailCall { +func (c *MockUsersServiceInterfaceGetEmailCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceGetEmailCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceGetEmailCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceGetEmailCall { +func (c *MockUsersServiceInterfaceGetEmailCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceGetEmailCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGPGKey mocks base method. -func (m *MockUsersServiceInterface) GetGPGKey(key int, options ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) GetGPGKey(key int64, options ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{key} for _, a := range options { @@ -1403,19 +1403,19 @@ func (c *MockUsersServiceInterfaceGetGPGKeyCall) Return(arg0 *gitlab.GPGKey, arg } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceGetGPGKeyCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetGPGKeyCall { +func (c *MockUsersServiceInterfaceGetGPGKeyCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetGPGKeyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceGetGPGKeyCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetGPGKeyCall { +func (c *MockUsersServiceInterfaceGetGPGKeyCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetGPGKeyCall { c.Call = c.Call.DoAndReturn(f) return c } // GetGPGKeyForUser mocks base method. -func (m *MockUsersServiceInterface) GetGPGKeyForUser(user, key int, options ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) GetGPGKeyForUser(user, key int64, options ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, key} for _, a := range options { @@ -1448,19 +1448,19 @@ func (c *MockUsersServiceInterfaceGetGPGKeyForUserCall) Return(arg0 *gitlab.GPGK } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceGetGPGKeyForUserCall) Do(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetGPGKeyForUserCall { +func (c *MockUsersServiceInterfaceGetGPGKeyForUserCall) Do(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetGPGKeyForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceGetGPGKeyForUserCall) DoAndReturn(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetGPGKeyForUserCall { +func (c *MockUsersServiceInterfaceGetGPGKeyForUserCall) DoAndReturn(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetGPGKeyForUserCall { c.Call = c.Call.DoAndReturn(f) return c } // GetImpersonationToken mocks base method. -func (m *MockUsersServiceInterface) GetImpersonationToken(user, token int, options ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) GetImpersonationToken(user, token int64, options ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, token} for _, a := range options { @@ -1493,19 +1493,19 @@ func (c *MockUsersServiceInterfaceGetImpersonationTokenCall) Return(arg0 *gitlab } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceGetImpersonationTokenCall) Do(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceGetImpersonationTokenCall { +func (c *MockUsersServiceInterfaceGetImpersonationTokenCall) Do(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceGetImpersonationTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceGetImpersonationTokenCall) DoAndReturn(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceGetImpersonationTokenCall { +func (c *MockUsersServiceInterfaceGetImpersonationTokenCall) DoAndReturn(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.ImpersonationToken, *gitlab.Response, error)) *MockUsersServiceInterfaceGetImpersonationTokenCall { c.Call = c.Call.DoAndReturn(f) return c } // GetSSHKey mocks base method. -func (m *MockUsersServiceInterface) GetSSHKey(key int, options ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) GetSSHKey(key int64, options ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{key} for _, a := range options { @@ -1538,19 +1538,19 @@ func (c *MockUsersServiceInterfaceGetSSHKeyCall) Return(arg0 *gitlab.SSHKey, arg } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceGetSSHKeyCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetSSHKeyCall { +func (c *MockUsersServiceInterfaceGetSSHKeyCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetSSHKeyCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceGetSSHKeyCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetSSHKeyCall { +func (c *MockUsersServiceInterfaceGetSSHKeyCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetSSHKeyCall { c.Call = c.Call.DoAndReturn(f) return c } // GetSSHKeyForUser mocks base method. -func (m *MockUsersServiceInterface) GetSSHKeyForUser(user, key int, options ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) GetSSHKeyForUser(user, key int64, options ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, key} for _, a := range options { @@ -1583,19 +1583,19 @@ func (c *MockUsersServiceInterfaceGetSSHKeyForUserCall) Return(arg0 *gitlab.SSHK } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceGetSSHKeyForUserCall) Do(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetSSHKeyForUserCall { +func (c *MockUsersServiceInterfaceGetSSHKeyForUserCall) Do(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetSSHKeyForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceGetSSHKeyForUserCall) DoAndReturn(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetSSHKeyForUserCall { +func (c *MockUsersServiceInterfaceGetSSHKeyForUserCall) DoAndReturn(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.SSHKey, *gitlab.Response, error)) *MockUsersServiceInterfaceGetSSHKeyForUserCall { c.Call = c.Call.DoAndReturn(f) return c } // GetUser mocks base method. -func (m *MockUsersServiceInterface) GetUser(user int, opt gitlab.GetUsersOptions, options ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) GetUser(user int64, opt gitlab.GetUsersOptions, options ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -1628,13 +1628,13 @@ func (c *MockUsersServiceInterfaceGetUserCall) Return(arg0 *gitlab.User, arg1 *g } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceGetUserCall) Do(f func(int, gitlab.GetUsersOptions, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserCall { +func (c *MockUsersServiceInterfaceGetUserCall) Do(f func(int64, gitlab.GetUsersOptions, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceGetUserCall) DoAndReturn(f func(int, gitlab.GetUsersOptions, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserCall { +func (c *MockUsersServiceInterfaceGetUserCall) DoAndReturn(f func(int64, gitlab.GetUsersOptions, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1685,7 +1685,7 @@ func (c *MockUsersServiceInterfaceGetUserActivitiesCall) DoAndReturn(f func(*git } // GetUserAssociationsCount mocks base method. -func (m *MockUsersServiceInterface) GetUserAssociationsCount(user int, options ...gitlab.RequestOptionFunc) (*gitlab.UserAssociationsCount, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) GetUserAssociationsCount(user int64, options ...gitlab.RequestOptionFunc) (*gitlab.UserAssociationsCount, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -1718,19 +1718,19 @@ func (c *MockUsersServiceInterfaceGetUserAssociationsCountCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceGetUserAssociationsCountCall) Do(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.UserAssociationsCount, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserAssociationsCountCall { +func (c *MockUsersServiceInterfaceGetUserAssociationsCountCall) Do(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.UserAssociationsCount, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserAssociationsCountCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceGetUserAssociationsCountCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) (*gitlab.UserAssociationsCount, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserAssociationsCountCall { +func (c *MockUsersServiceInterfaceGetUserAssociationsCountCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) (*gitlab.UserAssociationsCount, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserAssociationsCountCall { c.Call = c.Call.DoAndReturn(f) return c } // GetUserMemberships mocks base method. -func (m *MockUsersServiceInterface) GetUserMemberships(user int, opt *gitlab.GetUserMembershipOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.UserMembership, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) GetUserMemberships(user int64, opt *gitlab.GetUserMembershipOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.UserMembership, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -1763,13 +1763,13 @@ func (c *MockUsersServiceInterfaceGetUserMembershipsCall) Return(arg0 []*gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceGetUserMembershipsCall) Do(f func(int, *gitlab.GetUserMembershipOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.UserMembership, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserMembershipsCall { +func (c *MockUsersServiceInterfaceGetUserMembershipsCall) Do(f func(int64, *gitlab.GetUserMembershipOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.UserMembership, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserMembershipsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceGetUserMembershipsCall) DoAndReturn(f func(int, *gitlab.GetUserMembershipOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.UserMembership, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserMembershipsCall { +func (c *MockUsersServiceInterfaceGetUserMembershipsCall) DoAndReturn(f func(int64, *gitlab.GetUserMembershipOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.UserMembership, *gitlab.Response, error)) *MockUsersServiceInterfaceGetUserMembershipsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1864,7 +1864,7 @@ func (c *MockUsersServiceInterfaceListEmailsCall) DoAndReturn(f func(...gitlab.R } // ListEmailsForUser mocks base method. -func (m *MockUsersServiceInterface) ListEmailsForUser(user int, opt *gitlab.ListEmailsForUserOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Email, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) ListEmailsForUser(user int64, opt *gitlab.ListEmailsForUserOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Email, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -1897,13 +1897,13 @@ func (c *MockUsersServiceInterfaceListEmailsForUserCall) Return(arg0 []*gitlab.E } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceListEmailsForUserCall) Do(f func(int, *gitlab.ListEmailsForUserOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceListEmailsForUserCall { +func (c *MockUsersServiceInterfaceListEmailsForUserCall) Do(f func(int64, *gitlab.ListEmailsForUserOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceListEmailsForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceListEmailsForUserCall) DoAndReturn(f func(int, *gitlab.ListEmailsForUserOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceListEmailsForUserCall { +func (c *MockUsersServiceInterfaceListEmailsForUserCall) DoAndReturn(f func(int64, *gitlab.ListEmailsForUserOptions, ...gitlab.RequestOptionFunc) ([]*gitlab.Email, *gitlab.Response, error)) *MockUsersServiceInterfaceListEmailsForUserCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -1953,7 +1953,7 @@ func (c *MockUsersServiceInterfaceListGPGKeysCall) DoAndReturn(f func(...gitlab. } // ListGPGKeysForUser mocks base method. -func (m *MockUsersServiceInterface) ListGPGKeysForUser(user int, options ...gitlab.RequestOptionFunc) ([]*gitlab.GPGKey, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) ListGPGKeysForUser(user int64, options ...gitlab.RequestOptionFunc) ([]*gitlab.GPGKey, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -1986,13 +1986,13 @@ func (c *MockUsersServiceInterfaceListGPGKeysForUserCall) Return(arg0 []*gitlab. } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceListGPGKeysForUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) ([]*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceListGPGKeysForUserCall { +func (c *MockUsersServiceInterfaceListGPGKeysForUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) ([]*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceListGPGKeysForUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceListGPGKeysForUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) ([]*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceListGPGKeysForUserCall { +func (c *MockUsersServiceInterfaceListGPGKeysForUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) ([]*gitlab.GPGKey, *gitlab.Response, error)) *MockUsersServiceInterfaceListGPGKeysForUserCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -2223,7 +2223,7 @@ func (c *MockUsersServiceInterfaceListUsersCall) DoAndReturn(f func(*gitlab.List } // ModifyUser mocks base method. -func (m *MockUsersServiceInterface) ModifyUser(user int, opt *gitlab.ModifyUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error) { +func (m *MockUsersServiceInterface) ModifyUser(user int64, opt *gitlab.ModifyUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, opt} for _, a := range options { @@ -2256,19 +2256,19 @@ func (c *MockUsersServiceInterfaceModifyUserCall) Return(arg0 *gitlab.User, arg1 } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceModifyUserCall) Do(f func(int, *gitlab.ModifyUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockUsersServiceInterfaceModifyUserCall { +func (c *MockUsersServiceInterfaceModifyUserCall) Do(f func(int64, *gitlab.ModifyUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockUsersServiceInterfaceModifyUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceModifyUserCall) DoAndReturn(f func(int, *gitlab.ModifyUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockUsersServiceInterfaceModifyUserCall { +func (c *MockUsersServiceInterfaceModifyUserCall) DoAndReturn(f func(int64, *gitlab.ModifyUserOptions, ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)) *MockUsersServiceInterfaceModifyUserCall { c.Call = c.Call.DoAndReturn(f) return c } // RejectUser mocks base method. -func (m *MockUsersServiceInterface) RejectUser(user int, options ...gitlab.RequestOptionFunc) error { +func (m *MockUsersServiceInterface) RejectUser(user int64, options ...gitlab.RequestOptionFunc) error { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -2299,19 +2299,19 @@ func (c *MockUsersServiceInterfaceRejectUserCall) Return(arg0 error) *MockUsersS } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceRejectUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceRejectUserCall { +func (c *MockUsersServiceInterfaceRejectUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceRejectUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceRejectUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceRejectUserCall { +func (c *MockUsersServiceInterfaceRejectUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceRejectUserCall { c.Call = c.Call.DoAndReturn(f) return c } // RevokeImpersonationToken mocks base method. -func (m *MockUsersServiceInterface) RevokeImpersonationToken(user, token int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { +func (m *MockUsersServiceInterface) RevokeImpersonationToken(user, token int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{user, token} for _, a := range options { @@ -2343,13 +2343,13 @@ func (c *MockUsersServiceInterfaceRevokeImpersonationTokenCall) Return(arg0 *git } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceRevokeImpersonationTokenCall) Do(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceRevokeImpersonationTokenCall { +func (c *MockUsersServiceInterfaceRevokeImpersonationTokenCall) Do(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceRevokeImpersonationTokenCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceRevokeImpersonationTokenCall) DoAndReturn(f func(int, int, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceRevokeImpersonationTokenCall { +func (c *MockUsersServiceInterfaceRevokeImpersonationTokenCall) DoAndReturn(f func(int64, int64, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockUsersServiceInterfaceRevokeImpersonationTokenCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -2400,7 +2400,7 @@ func (c *MockUsersServiceInterfaceSetUserStatusCall) DoAndReturn(f func(*gitlab. } // UnbanUser mocks base method. -func (m *MockUsersServiceInterface) UnbanUser(user int, options ...gitlab.RequestOptionFunc) error { +func (m *MockUsersServiceInterface) UnbanUser(user int64, options ...gitlab.RequestOptionFunc) error { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -2431,19 +2431,19 @@ func (c *MockUsersServiceInterfaceUnbanUserCall) Return(arg0 error) *MockUsersSe } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceUnbanUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceUnbanUserCall { +func (c *MockUsersServiceInterfaceUnbanUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceUnbanUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceUnbanUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceUnbanUserCall { +func (c *MockUsersServiceInterfaceUnbanUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceUnbanUserCall { c.Call = c.Call.DoAndReturn(f) return c } // UnblockUser mocks base method. -func (m *MockUsersServiceInterface) UnblockUser(user int, options ...gitlab.RequestOptionFunc) error { +func (m *MockUsersServiceInterface) UnblockUser(user int64, options ...gitlab.RequestOptionFunc) error { m.ctrl.T.Helper() varargs := []any{user} for _, a := range options { @@ -2474,13 +2474,13 @@ func (c *MockUsersServiceInterfaceUnblockUserCall) Return(arg0 error) *MockUsers } // Do rewrite *gomock.Call.Do -func (c *MockUsersServiceInterfaceUnblockUserCall) Do(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceUnblockUserCall { +func (c *MockUsersServiceInterfaceUnblockUserCall) Do(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceUnblockUserCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockUsersServiceInterfaceUnblockUserCall) DoAndReturn(f func(int, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceUnblockUserCall { +func (c *MockUsersServiceInterfaceUnblockUserCall) DoAndReturn(f func(int64, ...gitlab.RequestOptionFunc) error) *MockUsersServiceInterfaceUnblockUserCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/time_stats.go b/time_stats.go index c89bbf7d..9b0c9846 100644 --- a/time_stats.go +++ b/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 { diff --git a/todos.go b/todos.go index 7711e725..942a4984 100644 --- a/todos.go +++ b/todos.go @@ -25,7 +25,7 @@ import ( type ( TodosServiceInterface interface { ListTodos(opt *ListTodosOptions, options ...RequestOptionFunc) ([]*Todo, *Response, error) - MarkTodoAsDone(id int, options ...RequestOptionFunc) (*Response, error) + MarkTodoAsDone(id int64, options ...RequestOptionFunc) (*Response, error) MarkAllTodosAsDone(options ...RequestOptionFunc) (*Response, error) } @@ -44,7 +44,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 +67,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 +87,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 +103,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,9 +120,9 @@ 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"` } @@ -150,7 +150,7 @@ func (s *TodosService) ListTodos(opt *ListTodosOptions, options ...RequestOption // 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) diff --git a/todos_test.go b/todos_test.go index a1ef0050..7af1f765 100644 --- a/todos_test.go +++ b/todos_test.go @@ -49,7 +49,7 @@ func TestListTodos(t *testing.T) { { name: "with author_id", opts: &ListTodosOptions{ - AuthorID: Ptr(1), + AuthorID: Ptr(int64(1)), }, handler: func(t *testing.T, w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) @@ -60,7 +60,7 @@ func TestListTodos(t *testing.T) { { name: "with project_id", opts: &ListTodosOptions{ - ProjectID: Ptr(1), + ProjectID: Ptr(int64(1)), }, handler: func(t *testing.T, w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) @@ -71,7 +71,7 @@ func TestListTodos(t *testing.T) { { name: "with group_id", opts: &ListTodosOptions{ - GroupID: Ptr(1), + GroupID: Ptr(int64(1)), }, handler: func(t *testing.T, w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) diff --git a/topics.go b/topics.go index abd4ff45..1b18e9ce 100644 --- a/topics.go +++ b/topics.go @@ -28,10 +28,10 @@ import ( type ( TopicsServiceInterface interface { ListTopics(opt *ListTopicsOptions, options ...RequestOptionFunc) ([]*Topic, *Response, error) - GetTopic(topic int, options ...RequestOptionFunc) (*Topic, *Response, error) + GetTopic(topic int64, options ...RequestOptionFunc) (*Topic, *Response, error) 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(topic int64, opt *UpdateTopicOptions, options ...RequestOptionFunc) (*Topic, *Response, error) + DeleteTopic(topic int64, options ...RequestOptionFunc) (*Response, error) } // TopicsService handles communication with the topics related methods @@ -49,7 +49,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"` @@ -91,7 +91,7 @@ func (s *TopicsService) ListTopics(opt *ListTopicsOptions, options ...RequestOpt // 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) { u := fmt.Sprintf("topics/%d", topic) req, err := s.client.NewRequest(http.MethodGet, u, nil, options) @@ -186,7 +186,7 @@ type UpdateTopicOptions struct { // // 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) { u := fmt.Sprintf("topics/%d", topic) var err error @@ -222,7 +222,7 @@ func (s *TopicsService) UpdateTopic(topic int, opt *UpdateTopicOptions, options // // 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) { u := fmt.Sprintf("topics/%d", topic) req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) diff --git a/types.go b/types.go index c4ea7f01..2ab0a8a5 100644 --- a/types.go +++ b/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 @@ -775,8 +775,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/usage_data.go b/usage_data.go index aaf587a2..c1a0cced 100644 --- a/usage_data.go +++ b/usage_data.go @@ -30,7 +30,7 @@ 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. @@ -85,13 +85,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"` @@ -125,18 +125,18 @@ type ServicePingNonSQLMetrics struct { 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"` @@ -166,8 +166,8 @@ 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"` } diff --git a/usage_data_test.go b/usage_data_test.go index dcdd5539..1c92e265 100644 --- a/usage_data_test.go +++ b/usage_data_test.go @@ -34,10 +34,10 @@ func TestUsageDataService_GetServicePing(t *testing.T) { want := &ServicePingData{ RecordedAt: Ptr(time.Date(2024, time.January, 15, 23, 33, 50, 387000000, time.UTC)), License: map[string]string{}, - Counts: map[string]int{ - "assignee_lists": int(0), - "ci_builds": int(463), - "ci_external_pipelines": int(0), + Counts: map[string]int64{ + "assignee_lists": int64(0), + "ci_builds": int64(463), + "ci_external_pipelines": int64(0), }, } require.Equal(t, want, sp) @@ -142,7 +142,7 @@ func TestUsageDataService_GetQueries(t *testing.T) { LicenseExpiresAt: "2022-02-23", LicensePlan: "starter", LicenseSubscriptionID: "0000", - LicenseAddOns: map[string]int{ + LicenseAddOns: map[string]int64{ "GitLab_FileLocks": 1, "GitLab_Auditor_User": 1, }, @@ -221,7 +221,7 @@ func TestUsageDataService_GetServicePingNonSqlMetrics(t *testing.T) { LicenseStartsAt: "1970-01-01", LicenseExpiresAt: "2022-02-26", LicensePlan: "starter", - LicenseAddOns: map[string]int{ + LicenseAddOns: map[string]int64{ "GitLab_FileLocks": 1, "GitLab_Auditor_User": 1, }, @@ -248,8 +248,8 @@ func TestUsageDataService_TrackEvent(t *testing.T) { }) sendToSnowplow := true - namespaceID := 1 - projectID := 1 + namespaceID := int64(1) + projectID := int64(1) additionalProperties := map[string]string{ "lang": "eng", } @@ -277,10 +277,10 @@ func TestUsageDataService_TrackEvents(t *testing.T) { w.WriteHeader(http.StatusNoContent) }) - namespaceID1 := 1 - projectID1 := 1 - namespaceID2 := 2 - projectID2 := 2 + namespaceID1 := int64(1) + projectID1 := int64(1) + namespaceID2 := int64(2) + projectID2 := int64(2) additionalProperties := map[string]string{ "lang": "eng", diff --git a/users.go b/users.go index 997c7068..7ff4e6d3 100644 --- a/users.go +++ b/users.go @@ -32,60 +32,60 @@ import ( type ( UsersServiceInterface interface { ListUsers(opt *ListUsersOptions, options ...RequestOptionFunc) ([]*User, *Response, error) - GetUser(user int, opt GetUsersOptions, options ...RequestOptionFunc) (*User, *Response, error) + GetUser(user int64, opt GetUsersOptions, options ...RequestOptionFunc) (*User, *Response, error) 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(user int64, opt *ModifyUserOptions, options ...RequestOptionFunc) (*User, *Response, error) + DeleteUser(user int64, options ...RequestOptionFunc) (*Response, error) CurrentUser(options ...RequestOptionFunc) (*User, *Response, error) CurrentUserStatus(options ...RequestOptionFunc) (*UserStatus, *Response, error) GetUserStatus(uid any, options ...RequestOptionFunc) (*UserStatus, *Response, error) SetUserStatus(opt *UserStatusOptions, options ...RequestOptionFunc) (*UserStatus, *Response, error) - GetUserAssociationsCount(user int, options ...RequestOptionFunc) (*UserAssociationsCount, *Response, error) + GetUserAssociationsCount(user int64, options ...RequestOptionFunc) (*UserAssociationsCount, *Response, error) ListSSHKeys(opt *ListSSHKeysOptions, options ...RequestOptionFunc) ([]*SSHKey, *Response, error) 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(key int64, options ...RequestOptionFunc) (*SSHKey, *Response, error) + GetSSHKeyForUser(user int64, key int64, options ...RequestOptionFunc) (*SSHKey, *Response, error) 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(user int64, opt *AddSSHKeyOptions, options ...RequestOptionFunc) (*SSHKey, *Response, error) + DeleteSSHKey(key int64, options ...RequestOptionFunc) (*Response, error) + DeleteSSHKeyForUser(user, key int64, options ...RequestOptionFunc) (*Response, error) ListGPGKeys(options ...RequestOptionFunc) ([]*GPGKey, *Response, error) - GetGPGKey(key int, options ...RequestOptionFunc) (*GPGKey, *Response, error) + GetGPGKey(key int64, options ...RequestOptionFunc) (*GPGKey, *Response, error) 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(key int64, options ...RequestOptionFunc) (*Response, error) + ListGPGKeysForUser(user int64, options ...RequestOptionFunc) ([]*GPGKey, *Response, error) + GetGPGKeyForUser(user, key int64, options ...RequestOptionFunc) (*GPGKey, *Response, error) + AddGPGKeyForUser(user int64, opt *AddGPGKeyOptions, options ...RequestOptionFunc) (*GPGKey, *Response, error) + DeleteGPGKeyForUser(user, key int64, options ...RequestOptionFunc) (*Response, error) 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(user int64, opt *ListEmailsForUserOptions, options ...RequestOptionFunc) ([]*Email, *Response, error) + GetEmail(email int64, options ...RequestOptionFunc) (*Email, *Response, error) 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(user int64, opt *AddEmailOptions, options ...RequestOptionFunc) (*Email, *Response, error) + DeleteEmail(email int64, options ...RequestOptionFunc) (*Response, error) + DeleteEmailForUser(user, email int64, options ...RequestOptionFunc) (*Response, error) + BlockUser(user int64, options ...RequestOptionFunc) error + UnblockUser(user int64, options ...RequestOptionFunc) error + BanUser(user int64, options ...RequestOptionFunc) error + UnbanUser(user int64, options ...RequestOptionFunc) error + DeactivateUser(user int64, options ...RequestOptionFunc) error + ActivateUser(user int64, options ...RequestOptionFunc) error + ApproveUser(user int64, options ...RequestOptionFunc) error + RejectUser(user int64, options ...RequestOptionFunc) error + GetAllImpersonationTokens(user int64, opt *GetAllImpersonationTokensOptions, options ...RequestOptionFunc) ([]*ImpersonationToken, *Response, error) + GetImpersonationToken(user, token int64, options ...RequestOptionFunc) (*ImpersonationToken, *Response, error) + CreateImpersonationToken(user int64, opt *CreateImpersonationTokenOptions, options ...RequestOptionFunc) (*ImpersonationToken, *Response, error) + RevokeImpersonationToken(user, token int64, options ...RequestOptionFunc) (*Response, error) + CreatePersonalAccessToken(user int64, opt *CreatePersonalAccessTokenOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) CreatePersonalAccessTokenForCurrentUser(opt *CreatePersonalAccessTokenForCurrentUserOptions, options ...RequestOptionFunc) (*PersonalAccessToken, *Response, error) 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(user int64, opt *GetUserMembershipOptions, options ...RequestOptionFunc) ([]*UserMembership, *Response, error) + DisableTwoFactor(user int64, options ...RequestOptionFunc) error CreateUserRunner(opts *CreateUserRunnerOptions, options ...RequestOptionFunc) (*UserRunner, *Response, error) CreateServiceAccountUser(opts *CreateServiceAccountUserOptions, options ...RequestOptionFunc) (*User, *Response, error) ListServiceAccounts(opt *ListServiceAccountsOptions, options ...RequestOptionFunc) ([]*ServiceAccount, *Response, error) UploadAvatar(avatar io.Reader, filename string, options ...RequestOptionFunc) (*User, *Response, error) - DeleteUserIdentity(user int, provider string, options ...RequestOptionFunc) (*Response, error) + DeleteUserIdentity(user int64, provider string, options ...RequestOptionFunc) (*Response, error) // events.go ListUserContributionEvents(uid any, opt *ListContributionEventsOptions, options ...RequestOptionFunc) ([]*ContributionEvent, *Response, error) @@ -120,7 +120,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 +135,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 +144,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 +163,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 +183,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"` } @@ -274,7 +274,7 @@ type GetUsersOptions struct { // 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,12 +311,12 @@ 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"` @@ -375,12 +375,12 @@ type ModifyUserOptions 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"` 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"` + 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"` @@ -390,7 +390,7 @@ type ModifyUserOptions struct { // 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) { +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) @@ -428,7 +428,7 @@ func (s *UsersService) ModifyUser(user int, opt *ModifyUserOptions, options ...R // 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) @@ -552,17 +552,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 +583,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"` @@ -652,7 +652,7 @@ func (s *UsersService) ListSSHKeysForUser(uid any, opt *ListSSHKeysForUserOption // 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) @@ -672,7 +672,7 @@ func (s *UsersService) GetSSHKey(key int, options ...RequestOptionFunc) (*SSHKey // 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) @@ -721,7 +721,7 @@ func (s *UsersService) AddSSHKey(opt *AddSSHKeyOptions, options ...RequestOption // 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) @@ -744,7 +744,7 @@ func (s *UsersService) AddSSHKeyForUser(user int, opt *AddSSHKeyOptions, options // // 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) @@ -760,7 +760,7 @@ func (s *UsersService) DeleteSSHKey(key int, options ...RequestOptionFunc) (*Res // // 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) @@ -775,7 +775,7 @@ 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"` } @@ -801,7 +801,7 @@ func (s *UsersService) ListGPGKeys(options ...RequestOptionFunc) ([]*GPGKey, *Re // 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) @@ -846,7 +846,7 @@ func (s *UsersService) AddGPGKey(opt *AddGPGKeyOptions, options ...RequestOption // 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) @@ -861,7 +861,7 @@ func (s *UsersService) DeleteGPGKey(key int, options ...RequestOptionFunc) (*Res // // 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) @@ -881,7 +881,7 @@ func (s *UsersService) ListGPGKeysForUser(user int, options ...RequestOptionFunc // 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) @@ -902,7 +902,7 @@ func (s *UsersService) GetGPGKeyForUser(user, key int, options ...RequestOptionF // // 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) @@ -923,7 +923,7 @@ func (s *UsersService) AddGPGKeyForUser(user int, opt *AddGPGKeyOptions, options // // 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) @@ -939,7 +939,7 @@ 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"` } @@ -976,7 +976,7 @@ type ListEmailsForUserOptions struct { // // 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) @@ -997,7 +997,7 @@ func (s *UsersService) ListEmailsForUser(user int, opt *ListEmailsForUserOptions // // 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) @@ -1047,7 +1047,7 @@ func (s *UsersService) AddEmail(opt *AddEmailOptions, options ...RequestOptionFu // // 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) @@ -1070,7 +1070,7 @@ func (s *UsersService) AddEmailForUser(user int, opt *AddEmailOptions, options . // // 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) @@ -1086,7 +1086,7 @@ func (s *UsersService) DeleteEmail(email int, options ...RequestOptionFunc) (*Re // // 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) @@ -1100,7 +1100,7 @@ func (s *UsersService) DeleteEmailForUser(user, email int, options ...RequestOpt // 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) @@ -1128,7 +1128,7 @@ func (s *UsersService) BlockUser(user int, 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 -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) @@ -1156,7 +1156,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) @@ -1182,7 +1182,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) @@ -1208,7 +1208,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) @@ -1236,7 +1236,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) @@ -1264,7 +1264,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) @@ -1292,7 +1292,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) @@ -1324,7 +1324,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"` @@ -1349,7 +1349,7 @@ type GetAllImpersonationTokensOptions struct { // // 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) @@ -1370,7 +1370,7 @@ func (s *UsersService) GetAllImpersonationTokens(user int, opt *GetAllImpersonat // // 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) @@ -1402,7 +1402,7 @@ type CreateImpersonationTokenOptions struct { // // 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) @@ -1423,7 +1423,7 @@ func (s *UsersService) CreateImpersonationToken(user int, opt *CreateImpersonati // // 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) @@ -1450,7 +1450,7 @@ type CreatePersonalAccessTokenOptions struct { // // 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) @@ -1542,7 +1542,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"` @@ -1561,7 +1561,7 @@ type GetUserMembershipOptions struct { // // 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) @@ -1582,7 +1582,7 @@ func (s *UsersService) GetUserMemberships(user int, opt *GetUserMembershipOption // // 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) @@ -1614,7 +1614,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"` } @@ -1625,15 +1625,15 @@ 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"` } @@ -1738,7 +1738,7 @@ func (s *UsersService) UploadAvatar(avatar io.Reader, filename string, options . // // 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/users_test.go b/users_test.go index 2782725f..9926c36b 100644 --- a/users_test.go +++ b/users_test.go @@ -686,13 +686,13 @@ func TestCreateUserRunner(t *testing.T) { }) createRunnerOpts := &CreateUserRunnerOptions{ - ProjectID: Ptr(1), + ProjectID: Ptr(int64(1)), RunnerType: Ptr("project_type"), } response, _, err := client.Users.CreateUserRunner(createRunnerOpts) assert.NoError(t, err) - assert.Equal(t, 1234, response.ID) + assert.Equal(t, int64(1234), response.ID) assert.Equal(t, "glrt-1234567890ABCD", response.Token) assert.Equal(t, (*time.Time)(nil), response.TokenExpiresAt) } -- GitLab From 1dcb219c343bc5b5622ff49933199c003a231bd4 Mon Sep 17 00:00:00 2001 From: Clayton Carter Date: Fri, 7 Nov 2025 20:18:07 +0000 Subject: [PATCH 22/26] fix(issues): use AssigneeIDValue for ListProjectIssuesOptions.AssigneeID Changelog: Improvements --- issues.go | 66 ++++++++++++++++++++++++++------------------------ issues_test.go | 2 +- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/issues.go b/issues.go index 5fa58773..2ab26564 100644 --- a/issues.go +++ b/issues.go @@ -337,37 +337,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 *[]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 *int64 `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"` + 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 diff --git a/issues_test.go b/issues_test.go index abaa9be0..0f4c2897 100644 --- a/issues_test.go +++ b/issues_test.go @@ -446,7 +446,7 @@ func TestListProjectIssues(t *testing.T) { listProjectIssue := &ListProjectIssuesOptions{ AuthorID: Ptr(int64(0o1)), - AssigneeID: Ptr(int64(0o2)), + AssigneeID: AssigneeID(0o2), } issues, _, err := client.Issues.ListProjectIssues("1", listProjectIssue) if err != nil { -- GitLab From a35020b1d8bb40d623824375d8d31a3ba27109ef Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Wed, 12 Nov 2025 10:38:48 -0600 Subject: [PATCH 23/26] Release 1.0 upgrade guide Changelog: Improvements --- README.md | 13 ++ docs/release-1.0-migration.md | 337 ++++++++++++++++++++++++++++++++++ 2 files changed, 350 insertions(+) create mode 100644 docs/release-1.0-migration.md diff --git a/README.md b/README.md index d8dc8d1a..bf6775bf 100644 --- a/README.md +++ b/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/docs/release-1.0-migration.md b/docs/release-1.0-migration.md new file mode 100644 index 00000000..04006e8e --- /dev/null +++ b/docs/release-1.0-migration.md @@ -0,0 +1,337 @@ +# Client-go Version 1.0 Migration Guide + +Release 1.0 marks a major milestone for the GitLab client-go project, representing its first release which +provides a breaking change guarantee. Moving forward, expect client-go to provide a major version migration with each +update to the Go language version to align supported Go versions to the language support guarantee. + +This guide will walk through how to consume the breaking changes from the release. It's likely (though not guaranteed) +that future versions will have fewer breaking changes, as the library has been in version 0.X for a while. + +## Struct Alias Updates + +Some structs have had alias or names updated or removed to more clearly align them to Golang naming conventions. +In these cases, update struct references to align to the new names. + +- `ListRegistryRepositoriesOptions` has been renamed to `ListProjectRegistryRepositoriesOptions` to clearly express that this +is for project registries as opposed to group registries +- `UpdateMergeRequestApprovalSettingsOptions` has been renamed to `UpdateProjectMergeRequestApprovalSettingsOptions` +- The Approval Settings Options struct for updating Group Approval Settings has been separated from the Project struct and is +now `UpdateGroupMergeRequestApprovalSettingsOptions` +- Several attributes in existing structs have had their casing updated to align to repository standards, including: + - `PipelineId` is now `PipelineID` + - `SelectiveSyncNamespaceIds` is now `SelectiveSyncNamespaceIDs` + - `RefsUrl` is now `RefsURL` + - `BitbucketServerUrl` is now `BitbucketServerURL` + - `CrlUrl` is now `CrlURL` + - `ServicePingNonSqlMetrics` is now `ServicePingNonSQLMetrics` + +Since each of the above struct and attribute changes are in-place renames, consuming the changes is as simple as updating the +references wherever they are used in code: + +```go +// old code +myRepositoryOptions := ListRegistryRepositoriesOptions{} + +// new code +myNewRepositoryOptions := ListProjectRegistryRepositoriesOptions{} +``` + +### Merge Requests That Implement This Change + +- [refactor!: standardize Go naming conventions for ID and URL fields](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2462) by @elC0mpa +- [refactor: decouple group and project request approval settings](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2465) by @elC0mpa + +## Updates to `ListOptions` to avoid Aliases + +Areas that used `ListOptions` before now use dedicated Options structs instead. This prevents us from needing to introduce +breaking changes in the future when individual APIs gain additional arguments. The following are new Structs that are used +instead of `ListOptions` in APIs. Each struct is composed of only the `ListOptions` struct right now, but may add new fields in +the future as needed. + - `ListAccessRequestsOptions` + - `ListApplicationsOptions` + - `ListAwardEmojiOptions` + - `ListIssueBoardsOptions` + - `GetIssueBoardListsOptions` + - `ListBroadcastMessagesOptions` + - `ListCIYMLTemplatesOptions` + - `ListAgentsOptions` + - `ListAgentTokensOptions` + - `GetCommitCommentsOptions` + - `ListGroupRegistryRepositoriesOptions` + - `ListRegistryRepositoryTagsOptions` + - `ListProjectDeployKeysOptions` + - `ListUserProjectDeployKeysOptions` + - `ListProjectDeployTokensOptions` + - `ListGroupDeployTokensOptions` + - `ListIssueDiscussionsOptions` + - `ListSnippetDiscussionsOptions` + - `ListGroupEpicDiscussionsOptions` + - `ListMergeRequestDiscussionsOptions` + - `ListCommitDiscussionsOptions` + - `ListDockerfileTemplatesOptions` + - `ListClientKeysOptions` + - `ListFreezePeriodsOptions` + - `ListGeoNodesOptions` + - `ListGeoSitesOptions` + - `ListStatusOfAllGeoSitesOptions` + - `ListTemplatesOptions` + - `ListGroupIssueBoardsOptions` + - `ListGroupIssueBoardListsOptions` + - `ListGroupEpicBoardsOptions` + - `ListGroupHooksOptions` + - `ListMembershipsForBillableGroupMemberOptions` + - `GetGroupMilestoneIssuesOptions` + - `GetGroupMilestoneMergeRequestsOptions` + - `GetGroupMilestoneBurndownChartEventsOptions` + - `ListGroupProtectedEnvironmentsOptions` + - `RetrieveAllGroupStorageMovesOptions` + - `ListGroupVariablesOptions` + - `ListInstanceVariablesOptions` + - `ListMergeRequestsClosingIssueOptions` + - `ListMergeRequestsRelatedToIssueOptions` + - `GetMergeRequestCommitsOptions` + - `GetIssuesClosedOnMergeOptions` + - `ListRelatedIssuesOptions` + - `GetMergeRequestDiffVersionsOptions` + - `GetMilestoneIssuesOptions` + - `GetMilestoneMergeRequestsOptions` + - `ListPackageFilesOptions` + - `ListPagesDomainsOptions` + - `ListPipelinesTriggeredByScheduleOptions` + - `ListPipelineTriggersOptions` + - `ListProjectMirrorOptions` + - `RetrieveAllProjectStorageMovesOptions` + - `ListProjectSnippetsOptions` + - `ListProjectVariablesOptions` + - `ListProjectHooksOptions` + - `GetProjectApprovalRulesListsOptions` + - `ListProtectedEnvironmentsOptions` + - `ListProtectedTagsOptions` + - `ListReleaseLinksOptions` + - `ListProjectSecureFilesOptions` + - `RetrieveAllSnippetStorageMovesOptions` + - `ListSnippetsOptions` + - `ExploreSnippetsOptions` + - `ListSSHKeysOptions` + - `ListSSHKeysForUserOptions` + - `ListEmailsForUserOptions` + +To consume these updates, the code that currently uses `ListOptions` will need to be updated +to instead use the struct named above, depending on which function is being called. The above +functions are all composed with ListOptions, and wrapping the existing `ListOptions` in the new +struct will be required. + +```go +// old code +reqOptions := ListOptions{ + Page: 1, + PerPage: 20, +} + +// new code +snippetsListOptions := ExploreSnippetsOptions{ + ListOptions: ListOptions{ + Page: 1, + PerPage: 10, + }, +} +``` + +### Merge Requests That Implement This Change + +- [feat!(ListOptions): Update ListOptions to use composition instead of aliasing](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2430) by @PatrickRice + +## Updates Inline struct values to Named Types + +Many structs within the codebase would previously use inlined structs as part of the struct definition. +This caused several problems: + 1. Users who used these structs in tests or code would encounter breaking changes when we added new attributes; +something that shouldn't normally be a breaking change. + 2. Initializing these structs was difficult, requiring repeating the whole struct definition + +Users who are only consuming API responses will be unaffected by this change, but users +who manually create structs may need to update to use the new named structs instead. + +The following structs were impacted, and use the new named structs as specified: + +- AwardEmoji + - BasicUser (reused existing) +- IssueBoard + - BasicUser (reused existing) +- BoardList + - BoardListAssignee +- Deployment + - DeploymentDeployable + - DeploymentDeployablePipeline +- NoteEvent + - NoteEventObjectAttributes +- PushSystemEvent + - PushSystemEventProject + - PushSystemEventCommit + - PushSystemEventCommitAuthor +- TagPushSystemEvent + - TagPushSystemEventProject + - TagPushSystemEventCommit + - TagPushSystemEventCommitAuthor +- RepositoryUpdateSystemEvent + - RepositoryUpdateSystemEventProject + - RepositoryUpdateSystemEventChange +- ContributionEvent + - ContributionEventPushData + - BasicUser (reused existing) +- ProjectEvent + - BasicUser (reused existing) + - ProjectEventData + - ProjectEventNote + - ProjectEventNoteAuthor + - ProjectEventPushData +- GenericPackagesFile + - GenericPackagesFileURL +- ImportRepositoryFromGitHubOptions + - ImportRepositoryFromGitHubOptionalStagesOptions +- IssuesStatistics + - IssuesStatisticsStatistics + - IssuesStatisticsCounts +- Job + - JobPipeline + - JobArtifact + - JobArtifactsFile + - JobRunner +- License + - LicenseLicensee + - LicenseAddOns + + +```go +// old code: +awardEmoji := &AwardEmoji{ + 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"` + }{ + Name: "test1" + } +} + +// new code +newAwardEmoji := &AwardEmoji{ + User: &BasicUser { + Name: "test1" + } +} +``` + +### Merge Requests That Implement This Change + +- [refactor(no-release): refactor inline structs to reusable types](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2477) by @heidi.berry + +## Fix Several Structs with Spelling Errors + +Several structs used throughout the code base had spelling errors in their names. While this doesn't impact +functionality, it can make the structs difficult to search for. These spelling errors have been fixed, which +will require an update when initializing the struct in code. + +- `CISeperateCache` -> `CISeparatedCaches` +- `SharedVisiableOnly` -> `SharedVisibleOnly` +- `IncludeDescendantGrouops` -> `IncludeDescendantGroups` +- `ProjectReposityStorage` -> `ProjectRepositoryStorage` +- `UpdateEpicIsssueAssignmentOptions` -> `UpdateEpicIssueAssignmentOptions` +- `ListProjectInvidedGroupOptions` -> `ListProjectInvitedGroupOptions` + +### Merge Requests That Implement This Change + +- [refactor(no-release): fix revive.var-naming lint issues](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2437) by @alexandear +- [refactor!: Fix typos in struct names](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2429) by @PatrickRice +- [fix!(epics): remove UpdateEpicIsssueAssignmentOptions in favor to UpdateEpicIssueAssignmentOptions](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2407) by @alexandear +- [fix!: remove ProjectReposityStorage in favor to ProjectRepositoryStorage](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2366) by @alexandear + + +## Migrate `int` to `int64` + +All structs and functions in `client-go` have been updated to use `int64` types where they previously used `int`. +This ensures there is no ambiguity about the fact that GitLab can use large integers to all integer values, and +prevents some cross-platform issues. + +When referencing `int64` returns from `client-go`, either update the referencing code to use `int64`, or cast it +to an `int` instead. + +```go +// old code +var myNum int +myNum = gitlabProject.ID + +// new code +var myNewNum int64 +myNewNum = gitlabProject.ID +``` + +### Merge Requests That Implement This Change + +- [chore(no-release): Update `int` in the first batch of files to `int64`](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2505) by @PatrickRice +- [chore(no-release): Round 2 of int-> int64 refactoring](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2530) by @PatrickRice +- [chore: Batch 3 of int -> int64 conversations](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2538) by @PatrickRice +- [Finalize migration from int -> int64](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2540) by @PatrickRice + +## Update `AssigneeID` from an `int` to `AssigneeIDValue` in `ListProjectIssuesOptions` + +Previously, there was no way to search for `any` or `none` explicitly in the List Project Issues API, since those are not valid +integer values. The `AssigneeIDValue` type allows using those values, so the `AssigneeID` argument has been updated to use that +type instead. + +When setting or referencing that type, cast from the `int` value to `AssigneeIDValue` instead + +```go +// old code +listProjectIssue := &ListProjectIssuesOptions{ + AuthorID: Ptr(int(1)), + AssigneeID: Ptr(int(2)), +} + +// new code +listProjectIssue := &ListProjectIssuesOptions{ + AuthorID: Ptr(int64(1)), + AssigneeID: AssigneeID(2), +} +``` + +### Merge Requests That Implement This Change + +- [fix(issues): use AssigneeIDValue for ListProjectIssuesOptions.AssigneeID](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2571) by @claytonrcarter + +## Header Value Casing has Been Updated + +In several cases, the casing on HTTP Headers has been updated to better align to GitLab's documentation. While +this shouldn't be a breaking change, tests that compare headers in a case sensitive fashion may break. + +The following header values have been updated: +- `RateLimit-Limit` -> `Ratelimit-Limit` +- `RateLimit-Reset` -> `Ratelimit-Reset` +- `PRIVATE-TOKEN` -> `Private-Token` +- `JOB-TOKEN` -> `Job-Token` + +### Merge Requests That Implement This Change + +- [refactor!: Canonicalize request headers](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2531) by @alexandear + +## Added Integration Tests for some tests + +As part of continuing to improve comprehensive testing, a new integration test capability has +been added that runs tests against a locally running GitLab Ultimate instance. The initial +set of User API tests runs on every merge to ensure that the APIs work as expected when run against +GitLab. + +### Merge Requests That Implement This Change + +- [chore(no-release): Add integration test support using a real instance](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2466) by @PatrickRice + +## Go Version Upgrades + +This update increases the version of Go that's required from 1.23 to 1.24. This follows Golang's supported language versions. + +### Merge Requests That Implement This Change + +- [chore(deps): update dependency go to v1.24.0](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2424) by @gitlab-dependency-update-bot \ No newline at end of file -- GitLab From 1f75eb7d7ab8a7cacff2fd1de46180cbeb9d39d5 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Thu, 13 Nov 2025 17:26:27 +0000 Subject: [PATCH 24/26] Fix issues with merge Co-authored-by: Ona --- .devcontainer/devcontainer.json | 2 +- .tool-versions | 2 +- alert_management.go | 4 +- event_parsing_webhook_test.go | 26 +-- gitlab.go | 2 +- gitlab_test.go | 20 -- project_aliases_test.go | 28 +-- project_members.go | 9 - testing/api_generated.go | 304 +++++++++++++++-------------- testing/model_registry_mock.go | 3 +- testing/pipelines_mock.go | 6 +- testing/project_aliases_mock.go | 3 +- testing/project_statistics_mock.go | 3 +- testing/protected_packages_mock.go | 3 +- 14 files changed, 195 insertions(+), 220 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8b5d0688..abdfba7c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,7 +11,7 @@ "ghcr.io/devcontainers/features/docker-in-docker:2": {}, "ghcr.io/devcontainers-extra/features/mise:1": {}, "ghcr.io/devcontainers/features/go:1": { - "version": "1.23" + "version": "1.24" } }, "postStartCommand": "eval \"$(mise activate bash --shims)\" && mise install", diff --git a/.tool-versions b/.tool-versions index 65cd4353..1704438c 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,5 +1,5 @@ golang 1.24 -golangci-lint 2.3.1 +golangci-lint 2.6.1 gofumpt 0.8.0 buf 1.55.1 node 24.8.0 \ No newline at end of file diff --git a/alert_management.go b/alert_management.go index 78a670ba..5fa0ee6b 100644 --- a/alert_management.go +++ b/alert_management.go @@ -129,7 +129,7 @@ type UpdateMetricImageOptions struct { URLText *string `url:"url_text,omitempty" json:"url_text,omitempty"` } -func (s *AlertManagementService) UpdateMetricImage(pid any, alertIID int64, 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 int64, id i ) } -func (s *AlertManagementService) DeleteMetricImage(pid any, alertIID int64, 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/event_parsing_webhook_test.go b/event_parsing_webhook_test.go index ca0c2b84..9fb1d220 100644 --- a/event_parsing_webhook_test.go +++ b/event_parsing_webhook_test.go @@ -56,7 +56,7 @@ func TestParseBuildHook(t *testing.T) { assert.True(t, ok, "Expected BuildEvent, but parsing produced %T", parsedEvent) assert.Equal(t, "build", event.ObjectKind) - assert.Equal(t, 1977, event.BuildID) + assert.Equal(t, int64(1977), event.BuildID) assert.False(t, event.BuildAllowFailure) assert.Equal(t, "2293ada6b400935a1378653304eaf6221e0fdb8f", event.Commit.SHA) assert.Equal(t, "2021-02-23T02:41:37.886Z", event.BuildCreatedAt) @@ -73,7 +73,7 @@ func TestParseCommitCommentHook(t *testing.T) { assert.True(t, ok, "Expected CommitCommentEvent, but parsing produced %T", parsedEvent) assert.Equal(t, string(NoteEventTargetType), event.ObjectKind) - assert.Equal(t, 5, event.ProjectID) + assert.Equal(t, int64(5), event.ProjectID) assert.Equal(t, "Commit", event.ObjectAttributes.NoteableType) assert.Equal(t, "cfe32cf61b73a0d5e9f13e774abde7ff789b1660", event.Commit.ID) } @@ -89,10 +89,10 @@ func TestParseFeatureFlagHook(t *testing.T) { assert.True(t, ok, "Expected FeatureFlagEvent, but parsing produced %T", parsedEvent) assert.Equal(t, "feature_flag", event.ObjectKind) - assert.Equal(t, 1, event.Project.ID) - assert.Equal(t, 1, event.User.ID) + assert.Equal(t, int64(1), event.Project.ID) + assert.Equal(t, int64(1), event.User.ID) assert.Equal(t, "Administrator", event.User.Name) - assert.Equal(t, 6, event.ObjectAttributes.ID) + assert.Equal(t, int64(6), event.ObjectAttributes.ID) assert.Equal(t, "test-feature-flag", event.ObjectAttributes.Name) assert.Equal(t, "test-feature-flag-description", event.ObjectAttributes.Description) assert.True(t, event.ObjectAttributes.Active) @@ -133,7 +133,7 @@ func TestParseIssueCommentHook(t *testing.T) { assert.True(t, ok, "Expected IssueCommentEvent, but parsing produced %T", parsedEvent) assert.Equal(t, string(NoteEventTargetType), event.ObjectKind) - assert.Equal(t, 5, event.ProjectID) + assert.Equal(t, int64(5), event.ProjectID) assert.Equal(t, "Issue", event.ObjectAttributes.NoteableType) assert.Equal(t, "test_issue", event.Issue.Title) assert.Len(t, event.Issue.Labels, 2) @@ -175,9 +175,9 @@ func TestParseMergeRequestCommentHook(t *testing.T) { assert.True(t, ok, "Expected MergeCommentEvent, but parsing produced %T", parsedEvent) assert.Equal(t, string(NoteEventTargetType), event.ObjectKind) - assert.Equal(t, 5, event.ProjectID) + assert.Equal(t, int64(5), event.ProjectID) assert.Equal(t, "MergeRequest", event.ObjectAttributes.NoteableType) - assert.Equal(t, 7, event.MergeRequest.ID) + assert.Equal(t, int64(7), event.MergeRequest.ID) assert.Equal(t, "Merge branch 'another-branch' into 'master'", event.MergeRequest.LastCommit.Title) } @@ -226,9 +226,9 @@ func TestParsePipelineHook(t *testing.T) { assert.True(t, ok, "Expected PipelineEvent, but parsing produced %T", parsedEvent) assert.Equal(t, "pipeline", event.ObjectKind) - assert.Equal(t, 63, event.ObjectAttributes.Duration) + assert.Equal(t, int64(63), event.ObjectAttributes.Duration) assert.Equal(t, "bcbb5ec396a2c0f828686f14fac9b80b780504f2", event.Commit.ID) - assert.Equal(t, 380, event.Builds[0].ID) + assert.Equal(t, int64(380), event.Builds[0].ID) assert.Equal(t, "instance_type", event.Builds[0].Runner.RunnerType) } @@ -256,7 +256,7 @@ func TestParsePushHook(t *testing.T) { assert.True(t, ok, "Expected PushEvent, but parsing produced %T", parsedEvent) assert.Equal(t, eventObjectKindPush, event.ObjectKind) - assert.Equal(t, 15, event.ProjectID) + assert.Equal(t, int64(15), event.ProjectID) assert.Equal(t, exampleEventUserName, event.UserName) assert.NotNil(t, event.Commits[0]) assert.NotNil(t, event.Commits[0].Timestamp) @@ -308,7 +308,7 @@ func TestParseSnippetCommentHook(t *testing.T) { assert.True(t, ok, "Expected SnippetCommentEvent, but parsing produced %T", parsedEvent) assert.Equal(t, string(NoteEventTargetType), event.ObjectKind) - assert.Equal(t, 5, event.ProjectID) + assert.Equal(t, int64(5), event.ProjectID) assert.Equal(t, "Snippet", event.ObjectAttributes.NoteableType) assert.Equal(t, "test", event.Snippet.Title) } @@ -337,7 +337,7 @@ func TestParseTagHook(t *testing.T) { assert.True(t, ok, "Expected TagEvent, but parsing produced %T", parsedEvent) assert.Equal(t, eventObjectKindTagPush, event.ObjectKind) - assert.Equal(t, 1, event.ProjectID) + assert.Equal(t, int64(1), event.ProjectID) assert.Equal(t, exampleEventUserName, event.UserName) assert.Equal(t, exampleEventUserUsername, event.UserUsername) assert.Equal(t, "refs/tags/v1.0.0", event.Ref) diff --git a/gitlab.go b/gitlab.go index 8d6a4381..34247a26 100644 --- a/gitlab.go +++ b/gitlab.go @@ -1026,7 +1026,7 @@ func (r *Response) populatePageValues() { 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 diff --git a/gitlab_test.go b/gitlab_test.go index 75e1b015..2dc00df9 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -851,8 +851,6 @@ func TestNewAuthSourceClient(t *testing.T) { func TestHasStatusCode(t *testing.T) { t.Parallel() - t.Parallel() - // GIVEN tests := []struct { name string @@ -896,8 +894,6 @@ func TestHasStatusCode(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - t.Parallel() - // WHEN actual := HasStatusCode(tt.err, tt.hasStatusCode) @@ -910,8 +906,6 @@ func TestHasStatusCode(t *testing.T) { func TestNewRequestToURL_disallowedURL(t *testing.T) { t.Parallel() - t.Parallel() - // GIVEN tests := []struct { name string @@ -939,8 +933,6 @@ func TestNewRequestToURL_disallowedURL(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - t.Parallel() - u, err := url.Parse(tt.url) require.NoError(t, err) @@ -954,8 +946,6 @@ func TestNewRequestToURL_disallowedURL(t *testing.T) { func TestNewRequestToURL_allowedURL(t *testing.T) { t.Parallel() - t.Parallel() - // GIVEN tests := []struct { url string @@ -976,8 +966,6 @@ func TestNewRequestToURL_allowedURL(t *testing.T) { t.Run(tt.url, func(t *testing.T) { t.Parallel() - t.Parallel() - u, err := url.Parse(tt.url) require.NoError(t, err) @@ -1045,8 +1033,6 @@ func TestWithInterceptor(t *testing.T) { t.Run("when nil interceptor has been passed, then it will result in an error", func(t *testing.T) { t.Parallel() - t.Parallel() - _, err := NewClient("", WithInterceptor(nil)) require.Error(t, err) }) @@ -1054,8 +1040,6 @@ func TestWithInterceptor(t *testing.T) { t.Run("when interceptor option is provided, then it is used in the client as part of the http round tripping of the transportation", func(t *testing.T) { t.Parallel() - t.Parallel() - client, err := NewClient("", WithInterceptor(func(next http.RoundTripper) http.RoundTripper { assert.NotNil(t, next, "it was expected that the next middleware is not empty, most likely being the default transport in worse case scenario") @@ -1075,8 +1059,6 @@ func TestWithInterceptor(t *testing.T) { t.Run("enables request manipulation", func(t *testing.T) { t.Parallel() - t.Parallel() - client, err := NewClient("", WithInterceptor(func(next http.RoundTripper) http.RoundTripper { assert.NotNil(t, next, "it was expected that the next middleware is not empty, most likely being the default transport in worse case scenario") @@ -1139,8 +1121,6 @@ func TestWithInterceptor(t *testing.T) { t.Run("e2e", func(t *testing.T) { t.Parallel() - t.Parallel() - const endpoint = "/api/v4/user" mux := http.NewServeMux() diff --git a/project_aliases_test.go b/project_aliases_test.go index 07057672..c53b51fe 100644 --- a/project_aliases_test.go +++ b/project_aliases_test.go @@ -16,16 +16,22 @@ func TestProjectAliasesService_CreateProjectAlias(t *testing.T) { mux, client := setup(t) mux.HandleFunc("/api/v4/project_aliases", func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "POST", r.Method) + testMethod(t, r, "POST") body, err := io.ReadAll(r.Body) - require.NoError(t, err) + if err != nil { + t.Fatalf("Failed to read request body: %v", err) + } var payload CreateProjectAliasOptions err = json.Unmarshal(body, &payload) - require.NoError(t, err) + if err != nil { + t.Fatalf("Failed to unmarshal JSON: %v", err) + } - require.NotNil(t, payload.Name) + if payload.Name == nil { + t.Fatal("Expected Name to be non-nil") + } assert.Equal(t, "my-alias", *payload.Name) assert.Equal(t, int64(1), payload.ProjectID) @@ -52,7 +58,7 @@ func TestProjectAliasesService_DeleteProjectAlias(t *testing.T) { mux, client := setup(t) mux.HandleFunc("/api/v4/project_aliases/my-alias", func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "DELETE", r.Method) + testMethod(t, r, "DELETE") w.WriteHeader(http.StatusNoContent) }) @@ -68,7 +74,7 @@ func TestProjectAliasesService_GetProjectAlias(t *testing.T) { mux, client := setup(t) mux.HandleFunc("/api/v4/project_aliases/my-alias", func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "GET", r.Method) + testMethod(t, r, "GET") w.WriteHeader(http.StatusOK) w.Write([]byte(`{"id": 10, "name": "my-alias", "project_id": 1}`)) }) @@ -88,7 +94,7 @@ func TestProjectAliasesService_ListProjectAliases(t *testing.T) { mux, client := setup(t) mux.HandleFunc("/api/v4/project_aliases", func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "GET", r.Method) + testMethod(t, r, "GET") w.WriteHeader(http.StatusOK) w.Write([]byte(`[{"id": 10, "name": "my-alias", "project_id": 1}]`)) }) @@ -112,7 +118,7 @@ func TestProjectAliasesService_GetProjectAlias_WithSpecialCharacters(t *testing. expectedEscaped := "my%2Falias%3Fwith%3Dspecial%26chars" mux.HandleFunc("/api/v4/project_aliases/"+expectedEscaped, func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "GET", r.Method) + testMethod(t, r, "GET") w.WriteHeader(http.StatusOK) w.Write([]byte(`{"id": 10, "name": "my/alias?with=special&chars", "project_id": 1}`)) }) @@ -135,7 +141,7 @@ func TestProjectAliasesService_DeleteProjectAlias_WithSpecialCharacters(t *testi expectedEscaped := "my%2Falias%3Fwith%3Dspecial%26chars" mux.HandleFunc("/api/v4/project_aliases/"+expectedEscaped, func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "DELETE", r.Method) + testMethod(t, r, "DELETE") w.WriteHeader(http.StatusNoContent) }) @@ -154,7 +160,7 @@ func TestProjectAliasesService_GetProjectAlias_WithSpacesAndDots(t *testing.T) { expectedEscaped := "my%20alias%2Ename" mux.HandleFunc("/api/v4/project_aliases/"+expectedEscaped, func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "GET", r.Method) + testMethod(t, r, "GET") w.WriteHeader(http.StatusOK) w.Write([]byte(`{"id": 20, "name": "my alias.name", "project_id": 2}`)) }) @@ -177,7 +183,7 @@ func TestProjectAliasesService_DeleteProjectAlias_WithSpacesAndDots(t *testing.T expectedEscaped := "my%20alias%2Ename" mux.HandleFunc("/api/v4/project_aliases/"+expectedEscaped, func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "DELETE", r.Method) + testMethod(t, r, "DELETE") w.WriteHeader(http.StatusNoContent) }) diff --git a/project_members.go b/project_members.go index 3072104d..92907048 100644 --- a/project_members.go +++ b/project_members.go @@ -64,15 +64,6 @@ type ProjectMember struct { IsUsingSeat bool `json:"is_using_seat,omitempty"` } -type MemberCreatedBy 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"` -} - type MemberCreatedBy struct { ID int64 `json:"id"` Username string `json:"username"` diff --git a/testing/api_generated.go b/testing/api_generated.go index 3b414d25..e41b54a5 100644 --- a/testing/api_generated.go +++ b/testing/api_generated.go @@ -2,154 +2,156 @@ package testing -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=access_requests_mock.go -package=testing gitlab.com/gitlab-org/api/client-go AccessRequestsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=alert_management_mock.go -package=testing gitlab.com/gitlab-org/api/client-go AlertManagementServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=appearance_mock.go -package=testing gitlab.com/gitlab-org/api/client-go AppearanceServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=application_statistics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ApplicationStatisticsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=applications_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ApplicationsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=audit_events_mock.go -package=testing gitlab.com/gitlab-org/api/client-go AuditEventsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=avatar_mock.go -package=testing gitlab.com/gitlab-org/api/client-go AvatarRequestsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=award_emojis_mock.go -package=testing gitlab.com/gitlab-org/api/client-go AwardEmojiServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=boards_mock.go -package=testing gitlab.com/gitlab-org/api/client-go IssueBoardsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=branches_mock.go -package=testing gitlab.com/gitlab-org/api/client-go BranchesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=broadcast_messages_mock.go -package=testing gitlab.com/gitlab-org/api/client-go BroadcastMessagesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=bulk_imports_mock.go -package=testing gitlab.com/gitlab-org/api/client-go BulkImportsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=ci_yml_templates_mock.go -package=testing gitlab.com/gitlab-org/api/client-go CIYMLTemplatesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=cluster_agents_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ClusterAgentsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=commits_mock.go -package=testing gitlab.com/gitlab-org/api/client-go CommitsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=container_registry_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ContainerRegistryServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=container_registry_protection_rules_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ContainerRegistryProtectionRulesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=custom_attributes_mock.go -package=testing gitlab.com/gitlab-org/api/client-go CustomAttributesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=database_migrations_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DatabaseMigrationsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=dependencies_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DependenciesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=dependency_list_export_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DependencyListExportServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=dependency_proxy_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DependencyProxyServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=deploy_keys_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DeployKeysServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=deploy_tokens_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DeployTokensServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=deployments_merge_requests_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DeploymentMergeRequestsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=deployments_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DeploymentsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=discussions_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DiscussionsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=dockerfile_templates_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DockerfileTemplatesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=dora_metrics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DORAMetricsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=draft_notes_mock.go -package=testing gitlab.com/gitlab-org/api/client-go DraftNotesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=enterprise_users_mock.go -package=testing gitlab.com/gitlab-org/api/client-go EnterpriseUsersServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=environments_mock.go -package=testing gitlab.com/gitlab-org/api/client-go EnvironmentsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=epic_issues_mock.go -package=testing gitlab.com/gitlab-org/api/client-go EpicIssuesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=epics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go EpicsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=error_tracking_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ErrorTrackingServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=events_mock.go -package=testing gitlab.com/gitlab-org/api/client-go EventsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=external_status_checks_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ExternalStatusChecksServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=feature_flag_user_lists_mock.go -package=testing gitlab.com/gitlab-org/api/client-go FeatureFlagUserListsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=feature_flags_mock.go -package=testing gitlab.com/gitlab-org/api/client-go FeaturesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=freeze_periods_mock.go -package=testing gitlab.com/gitlab-org/api/client-go FreezePeriodsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=generic_packages_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GenericPackagesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=geo_nodes_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GeoNodesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=geo_sites_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GeoSitesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=gitignore_templates_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GitIgnoreTemplatesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=graphql_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GraphQLInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_access_tokens_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupAccessTokensServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_activity_analytics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupActivityAnalyticsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_badges_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupBadgesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_boards_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupIssueBoardsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_clusters_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupClustersServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_epic_boards_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupEpicBoardsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_import_export_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupImportExportServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_iterations_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupIterationsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_labels_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupLabelsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_markdown_uploads_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupMarkdownUploadsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_members_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupMembersServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_milestones_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupMilestonesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_protected_environments_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupProtectedEnvironmentsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_releases_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupReleasesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_repository_storage_move_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupRepositoryStorageMoveServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_scim_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupSCIMServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_security_settings_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupSecuritySettingsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_ssh_certificates_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupSSHCertificatesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_variables_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupVariablesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_wikis_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupWikisServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=groups_mock.go -package=testing gitlab.com/gitlab-org/api/client-go GroupsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=import_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ImportServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=instance_clusters_mock.go -package=testing gitlab.com/gitlab-org/api/client-go InstanceClustersServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=instance_variables_mock.go -package=testing gitlab.com/gitlab-org/api/client-go InstanceVariablesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=integrations_mock.go -package=testing gitlab.com/gitlab-org/api/client-go IntegrationsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=invites_mock.go -package=testing gitlab.com/gitlab-org/api/client-go InvitesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=issue_links_mock.go -package=testing gitlab.com/gitlab-org/api/client-go IssueLinksServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=issues_mock.go -package=testing gitlab.com/gitlab-org/api/client-go IssuesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=issues_statistics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go IssuesStatisticsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=job_token_scope_mock.go -package=testing gitlab.com/gitlab-org/api/client-go JobTokenScopeServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=jobs_mock.go -package=testing gitlab.com/gitlab-org/api/client-go JobsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=keys_mock.go -package=testing gitlab.com/gitlab-org/api/client-go KeysServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=labels_mock.go -package=testing gitlab.com/gitlab-org/api/client-go LabelsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=license_mock.go -package=testing gitlab.com/gitlab-org/api/client-go LicenseServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=license_templates_mock.go -package=testing gitlab.com/gitlab-org/api/client-go LicenseTemplatesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=markdown_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MarkdownServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=member_roles_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MemberRolesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=merge_request_approval_settings_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MergeRequestApprovalSettingsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=merge_request_approvals_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MergeRequestApprovalsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=merge_requests_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MergeRequestsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=merge_trains_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MergeTrainsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=metadata_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MetadataServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=milestones_mock.go -package=testing gitlab.com/gitlab-org/api/client-go MilestonesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=model_registry_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ModelRegistryServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=namespaces_mock.go -package=testing gitlab.com/gitlab-org/api/client-go NamespacesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=notes_mock.go -package=testing gitlab.com/gitlab-org/api/client-go NotesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=notifications_mock.go -package=testing gitlab.com/gitlab-org/api/client-go NotificationSettingsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=packages_mock.go -package=testing gitlab.com/gitlab-org/api/client-go PackagesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pages_domains_mock.go -package=testing gitlab.com/gitlab-org/api/client-go PagesDomainsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pages_mock.go -package=testing gitlab.com/gitlab-org/api/client-go PagesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=personal_access_tokens_mock.go -package=testing gitlab.com/gitlab-org/api/client-go PersonalAccessTokensServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pipeline_schedules_mock.go -package=testing gitlab.com/gitlab-org/api/client-go PipelineSchedulesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pipeline_triggers_mock.go -package=testing gitlab.com/gitlab-org/api/client-go PipelineTriggersServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pipelines_mock.go -package=testing gitlab.com/gitlab-org/api/client-go PipelinesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=plan_limits_mock.go -package=testing gitlab.com/gitlab-org/api/client-go PlanLimitsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_access_tokens_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectAccessTokensServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_aliases_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectAliasesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_badges_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectBadgesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_clusters_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectClustersServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_feature_flags_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectFeatureFlagServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_import_export_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectImportExportServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_iterations_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectIterationsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_markdown_uploads_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectMarkdownUploadsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_members_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectMembersServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_mirror_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectMirrorServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_repository_storage_move_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectRepositoryStorageMoveServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_security_settings_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectSecuritySettingsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_snippets_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectSnippetsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_statistics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectStatisticsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_templates_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectTemplatesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_variables_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectVariablesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_vulnerabilities_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectVulnerabilitiesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=projects_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_branches_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProtectedBranchesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_environments_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProtectedEnvironmentsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_packages_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProtectedPackagesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_tags_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProtectedTagsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=releaselinks_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ReleaseLinksServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=releases_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ReleasesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=repositories_mock.go -package=testing gitlab.com/gitlab-org/api/client-go RepositoriesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=repository_files_mock.go -package=testing gitlab.com/gitlab-org/api/client-go RepositoryFilesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=repository_submodules_mock.go -package=testing gitlab.com/gitlab-org/api/client-go RepositorySubmodulesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_group_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ResourceGroupServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_iteration_events_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ResourceIterationEventsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_label_events_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ResourceLabelEventsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_milestone_events_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ResourceMilestoneEventsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_state_events_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ResourceStateEventsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_weight_events_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ResourceWeightEventsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=runners_mock.go -package=testing gitlab.com/gitlab-org/api/client-go RunnersServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=search_mock.go -package=testing gitlab.com/gitlab-org/api/client-go SearchServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=secure_files_mock.go -package=testing gitlab.com/gitlab-org/api/client-go SecureFilesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=services_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ServicesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=settings_mock.go -package=testing gitlab.com/gitlab-org/api/client-go SettingsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=sidekiq_metrics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go SidekiqServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=snippet_repository_storage_move_mock.go -package=testing gitlab.com/gitlab-org/api/client-go SnippetRepositoryStorageMoveServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=snippets_mock.go -package=testing gitlab.com/gitlab-org/api/client-go SnippetsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=system_hooks_mock.go -package=testing gitlab.com/gitlab-org/api/client-go SystemHooksServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=tags_mock.go -package=testing gitlab.com/gitlab-org/api/client-go TagsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=terraform_states_mock.go -package=testing gitlab.com/gitlab-org/api/client-go TerraformStatesServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=todos_mock.go -package=testing gitlab.com/gitlab-org/api/client-go TodosServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=topics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go TopicsServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=usage_data_mock.go -package=testing gitlab.com/gitlab-org/api/client-go UsageDataServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=users_mock.go -package=testing gitlab.com/gitlab-org/api/client-go UsersServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=validate_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ValidateServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=version_mock.go -package=testing gitlab.com/gitlab-org/api/client-go VersionServiceInterface -//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=wikis_mock.go -package=testing gitlab.com/gitlab-org/api/client-go WikisServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=access_requests_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go AccessRequestsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=alert_management_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go AlertManagementServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=appearance_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go AppearanceServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=application_statistics_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ApplicationStatisticsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=applications_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ApplicationsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=audit_events_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go AuditEventsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=avatar_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go AvatarRequestsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=award_emojis_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go AwardEmojiServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=boards_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go IssueBoardsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=branches_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go BranchesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=broadcast_messages_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go BroadcastMessagesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=bulk_imports_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go BulkImportsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=ci_yml_templates_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go CIYMLTemplatesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=cluster_agents_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ClusterAgentsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=commits_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go CommitsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=container_registry_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ContainerRegistryServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=container_registry_protection_rules_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ContainerRegistryProtectionRulesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=custom_attributes_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go CustomAttributesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=database_migrations_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DatabaseMigrationsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=dependencies_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DependenciesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=dependency_list_export_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DependencyListExportServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=dependency_proxy_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DependencyProxyServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=deploy_keys_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DeployKeysServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=deploy_tokens_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DeployTokensServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=deployments_merge_requests_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DeploymentMergeRequestsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=deployments_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DeploymentsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=discussions_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DiscussionsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=dockerfile_templates_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DockerfileTemplatesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=dora_metrics_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DORAMetricsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=draft_notes_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go DraftNotesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=enterprise_users_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go EnterpriseUsersServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=environments_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go EnvironmentsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=epic_issues_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go EpicIssuesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=epics_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go EpicsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=error_tracking_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ErrorTrackingServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=events_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go EventsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=external_status_checks_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ExternalStatusChecksServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=feature_flag_user_lists_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go FeatureFlagUserListsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=feature_flags_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go FeaturesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=freeze_periods_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go FreezePeriodsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=generic_packages_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GenericPackagesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=geo_nodes_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GeoNodesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=geo_sites_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GeoSitesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=gitignore_templates_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GitIgnoreTemplatesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=graphql_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GraphQLInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_access_tokens_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupAccessTokensServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_activity_analytics_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupActivityAnalyticsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_badges_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupBadgesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_boards_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupIssueBoardsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_clusters_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupClustersServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_epic_boards_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupEpicBoardsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_import_export_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupImportExportServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_iterations_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupIterationsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_labels_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupLabelsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_markdown_uploads_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupMarkdownUploadsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_members_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupMembersServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_milestones_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupMilestonesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_protected_environments_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupProtectedEnvironmentsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_relations_export_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupRelationsExportServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_releases_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupReleasesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_repository_storage_move_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupRepositoryStorageMoveServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_scim_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupSCIMServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_security_settings_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupSecuritySettingsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_ssh_certificates_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupSSHCertificatesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_variables_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupVariablesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=group_wikis_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupWikisServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=groups_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go GroupsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=import_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ImportServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=instance_clusters_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go InstanceClustersServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=instance_variables_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go InstanceVariablesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=integrations_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go IntegrationsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=invites_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go InvitesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=issue_links_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go IssueLinksServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=issues_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go IssuesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=issues_statistics_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go IssuesStatisticsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=job_token_scope_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go JobTokenScopeServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=jobs_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go JobsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=keys_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go KeysServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=labels_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go LabelsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=license_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go LicenseServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=license_templates_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go LicenseTemplatesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=markdown_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go MarkdownServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=member_roles_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go MemberRolesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=merge_request_approval_settings_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go MergeRequestApprovalSettingsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=merge_request_approvals_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go MergeRequestApprovalsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=merge_request_context_commits_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go MergeRequestContextCommitsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=merge_requests_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go MergeRequestsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=merge_trains_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go MergeTrainsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=metadata_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go MetadataServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=milestones_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go MilestonesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=model_registry_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ModelRegistryServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=namespaces_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go NamespacesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=notes_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go NotesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=notifications_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go NotificationSettingsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=packages_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go PackagesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pages_domains_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go PagesDomainsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pages_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go PagesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=personal_access_tokens_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go PersonalAccessTokensServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pipeline_schedules_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go PipelineSchedulesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pipeline_triggers_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go PipelineTriggersServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=pipelines_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go PipelinesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=plan_limits_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go PlanLimitsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_access_tokens_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectAccessTokensServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_aliases_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectAliasesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_badges_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectBadgesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_clusters_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectClustersServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_feature_flags_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectFeatureFlagServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_import_export_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectImportExportServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_iterations_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectIterationsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_markdown_uploads_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectMarkdownUploadsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_members_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectMembersServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_mirror_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectMirrorServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_repository_storage_move_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectRepositoryStorageMoveServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_security_settings_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectSecuritySettingsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_snippets_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectSnippetsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_statistics_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectStatisticsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_templates_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectTemplatesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_variables_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectVariablesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=project_vulnerabilities_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectVulnerabilitiesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=projects_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_branches_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProtectedBranchesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_environments_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProtectedEnvironmentsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_packages_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProtectedPackagesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=protected_tags_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProtectedTagsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=releaselinks_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ReleaseLinksServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=releases_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ReleasesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=repositories_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go RepositoriesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=repository_files_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go RepositoryFilesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=repository_submodules_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go RepositorySubmodulesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_group_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ResourceGroupServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_iteration_events_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ResourceIterationEventsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_label_events_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ResourceLabelEventsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_milestone_events_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ResourceMilestoneEventsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_state_events_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ResourceStateEventsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=resource_weight_events_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ResourceWeightEventsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=runners_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go RunnersServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=search_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go SearchServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=secure_files_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go SecureFilesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=services_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ServicesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=settings_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go SettingsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=sidekiq_metrics_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go SidekiqServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=snippet_repository_storage_move_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go SnippetRepositoryStorageMoveServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=snippets_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go SnippetsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=system_hooks_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go SystemHooksServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=tags_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go TagsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=terraform_states_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go TerraformStatesServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=todos_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go TodosServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=topics_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go TopicsServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=usage_data_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go UsageDataServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=users_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go UsersServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=validate_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ValidateServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=version_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go VersionServiceInterface +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -typed -destination=wikis_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go WikisServiceInterface diff --git a/testing/model_registry_mock.go b/testing/model_registry_mock.go index 44ccecbf..da467b12 100644 --- a/testing/model_registry_mock.go +++ b/testing/model_registry_mock.go @@ -3,10 +3,9 @@ // // Generated by this command: // -// mockgen -typed -destination=model_registry_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ModelRegistryServiceInterface +// mockgen -typed -destination=model_registry_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ModelRegistryServiceInterface // -// Package testing is a generated GoMock package. package testing import ( diff --git a/testing/pipelines_mock.go b/testing/pipelines_mock.go index e3872781..526a6387 100644 --- a/testing/pipelines_mock.go +++ b/testing/pipelines_mock.go @@ -309,7 +309,7 @@ func (c *MockPipelinesServiceInterfaceGetPipelineTestReportCall) DoAndReturn(f f } // GetPipelineTestReportSummary mocks base method. -func (m *MockPipelinesServiceInterface) GetPipelineTestReportSummary(pid any, pipeline int, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReportSummary, *gitlab.Response, error) { +func (m *MockPipelinesServiceInterface) GetPipelineTestReportSummary(pid any, pipeline int64, options ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReportSummary, *gitlab.Response, error) { m.ctrl.T.Helper() varargs := []any{pid, pipeline} for _, a := range options { @@ -342,13 +342,13 @@ func (c *MockPipelinesServiceInterfaceGetPipelineTestReportSummaryCall) Return(a } // Do rewrite *gomock.Call.Do -func (c *MockPipelinesServiceInterfaceGetPipelineTestReportSummaryCall) Do(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReportSummary, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineTestReportSummaryCall { +func (c *MockPipelinesServiceInterfaceGetPipelineTestReportSummaryCall) Do(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReportSummary, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineTestReportSummaryCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockPipelinesServiceInterfaceGetPipelineTestReportSummaryCall) DoAndReturn(f func(any, int, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReportSummary, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineTestReportSummaryCall { +func (c *MockPipelinesServiceInterfaceGetPipelineTestReportSummaryCall) DoAndReturn(f func(any, int64, ...gitlab.RequestOptionFunc) (*gitlab.PipelineTestReportSummary, *gitlab.Response, error)) *MockPipelinesServiceInterfaceGetPipelineTestReportSummaryCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/testing/project_aliases_mock.go b/testing/project_aliases_mock.go index 4ac6894b..1a569843 100644 --- a/testing/project_aliases_mock.go +++ b/testing/project_aliases_mock.go @@ -3,10 +3,9 @@ // // Generated by this command: // -// mockgen -typed -destination=project_aliases_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectAliasesServiceInterface +// mockgen -typed -destination=project_aliases_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectAliasesServiceInterface // -// Package testing is a generated GoMock package. package testing import ( diff --git a/testing/project_statistics_mock.go b/testing/project_statistics_mock.go index c9ccbca8..cba0687b 100644 --- a/testing/project_statistics_mock.go +++ b/testing/project_statistics_mock.go @@ -3,10 +3,9 @@ // // Generated by this command: // -// mockgen -typed -destination=project_statistics_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProjectStatisticsServiceInterface +// mockgen -typed -destination=project_statistics_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProjectStatisticsServiceInterface // -// Package testing is a generated GoMock package. package testing import ( diff --git a/testing/protected_packages_mock.go b/testing/protected_packages_mock.go index 0da1cffb..74f5e323 100644 --- a/testing/protected_packages_mock.go +++ b/testing/protected_packages_mock.go @@ -3,10 +3,9 @@ // // Generated by this command: // -// mockgen -typed -destination=protected_packages_mock.go -package=testing gitlab.com/gitlab-org/api/client-go ProtectedPackagesServiceInterface +// mockgen -typed -destination=protected_packages_mock.go -write_package_comment=false -package=testing gitlab.com/gitlab-org/api/client-go ProtectedPackagesServiceInterface // -// Package testing is a generated GoMock package. package testing import ( -- GitLab From 92abaf4edba75faa79d916fbd471df9663a5b455 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Thu, 13 Nov 2025 18:16:07 +0000 Subject: [PATCH 25/26] Add newlines to file ends --- .vscode/settings.json | 2 +- AGENTS.md | 2 +- Makefile | 2 +- docs/release-1.0-migration.md | 2 +- scripts/await_healthy.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f0b08b5f..9446ffa5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,4 +4,4 @@ "GITLAB_TOKEN": "glpat-ACCTEST1234567890123", "GITLAB_BASE_URL": "http://127.0.0.1:8095/api/v4" } -} \ No newline at end of file +} diff --git a/AGENTS.md b/AGENTS.md index da52c4c8..234019da 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -381,4 +381,4 @@ When working with this repository: 3. **Align with GitLab API docs** - Every function must reference official documentation 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/Makefile b/Makefile index 28c0f607..4c6a1897 100644 --- a/Makefile +++ b/Makefile @@ -51,4 +51,4 @@ testacc-down: ## Teardown a GitLab instance. 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') \ No newline at end of file +CONTAINER_COMPOSE_ENGINE ?= $(shell docker compose version >/dev/null 2>&1 && echo 'docker compose' || echo 'docker-compose') diff --git a/docs/release-1.0-migration.md b/docs/release-1.0-migration.md index 04006e8e..9b9ad083 100644 --- a/docs/release-1.0-migration.md +++ b/docs/release-1.0-migration.md @@ -334,4 +334,4 @@ This update increases the version of Go that's required from 1.23 to 1.24. This ### Merge Requests That Implement This Change -- [chore(deps): update dependency go to v1.24.0](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2424) by @gitlab-dependency-update-bot \ No newline at end of file +- [chore(deps): update dependency go to v1.24.0](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2424) by @gitlab-dependency-update-bot diff --git a/scripts/await_healthy.sh b/scripts/await_healthy.sh index 8b7d1cf4..099e184f 100755 --- a/scripts/await_healthy.sh +++ b/scripts/await_healthy.sh @@ -24,4 +24,4 @@ echo # We use git imports during integration tests, so the import sources need to have git enabled as of 16.0. Otherwise they're all disabled. echo "Setting import sources to 'git' for testing purposes" -curl --silent --show-error --request PUT --header "Authorization: Bearer $GITLAB_TOKEN" "$GITLAB_BASE_URL/application/settings?import_sources=git,gitlab_project" \ No newline at end of file +curl --silent --show-error --request PUT --header "Authorization: Bearer $GITLAB_TOKEN" "$GITLAB_BASE_URL/application/settings?import_sources=git,gitlab_project" -- GitLab From 640b5ba6a67cbf768736ecf410cba3be705466d0 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Fri, 14 Nov 2025 15:14:19 +0000 Subject: [PATCH 26/26] update project_aliases to use assert, and update pipelines to use int64 Co-authored-by: Ona --- pipelines.go | 22 +++++++++++----------- pipelines_test.go | 2 +- project_aliases_test.go | 12 +++--------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/pipelines.go b/pipelines.go index ddf35517..78527638 100644 --- a/pipelines.go +++ b/pipelines.go @@ -194,11 +194,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"` } @@ -206,12 +206,12 @@ 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"` } diff --git a/pipelines_test.go b/pipelines_test.go index 049d52b8..f2fcded2 100644 --- a/pipelines_test.go +++ b/pipelines_test.go @@ -213,7 +213,7 @@ func TestGetPipelineTestReportSummary(t *testing.T) { FailedCount: 0, SkippedCount: 12, ErrorCount: 0, - BuildIDs: []int{66004}, + BuildIDs: []int64{66004}, SuiteError: Ptr("JUnit XML parsing failed: 1:1: FATAL: Document is empty"), }, }, diff --git a/project_aliases_test.go b/project_aliases_test.go index c53b51fe..db476e7c 100644 --- a/project_aliases_test.go +++ b/project_aliases_test.go @@ -19,19 +19,13 @@ func TestProjectAliasesService_CreateProjectAlias(t *testing.T) { testMethod(t, r, "POST") body, err := io.ReadAll(r.Body) - if err != nil { - t.Fatalf("Failed to read request body: %v", err) - } + assert.NoError(t, err, "Failed to read request body") var payload CreateProjectAliasOptions err = json.Unmarshal(body, &payload) - if err != nil { - t.Fatalf("Failed to unmarshal JSON: %v", err) - } + assert.NoError(t, err, "Failed to unmarshal JSON") - if payload.Name == nil { - t.Fatal("Expected Name to be non-nil") - } + assert.NotNil(t, payload.Name, "Expected Name to be non-nil") assert.Equal(t, "my-alias", *payload.Name) assert.Equal(t, int64(1), payload.ProjectID) -- GitLab