Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Make all option struct fields pointers
Browse files Browse the repository at this point in the history
Fixes #427 #1292
  • Loading branch information
svanharmelen committed Jan 4, 2022
1 parent 609ee71 commit 683eca8
Show file tree
Hide file tree
Showing 29 changed files with 313 additions and 314 deletions.
2 changes: 1 addition & 1 deletion boards.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ 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"`
Labels Labels `url:"labels,omitempty" json:"labels,omitempty"`
Labels *Labels `url:"labels,omitempty" json:"labels,omitempty"`
Weight *int `url:"weight,omitempty" json:"weight,omitempty"`
}

Expand Down
4 changes: 2 additions & 2 deletions deploy_tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ type CreateProjectDeployTokenOptions struct {
Name *string `url:"name,omitempty" json:"name,omitempty"`
ExpiresAt *time.Time `url:"expires_at,omitempty" json:"expires_at,omitempty"`
Username *string `url:"username,omitempty" json:"username,omitempty"`
Scopes []string `url:"scopes,omitempty" json:"scopes,omitempty"`
Scopes *[]string `url:"scopes,omitempty" json:"scopes,omitempty"`
}

// CreateProjectDeployToken creates a new deploy token for a project.
Expand Down Expand Up @@ -190,7 +190,7 @@ type CreateGroupDeployTokenOptions struct {
Name *string `url:"name,omitempty" json:"name,omitempty"`
ExpiresAt *time.Time `url:"expires_at,omitempty" json:"expires_at,omitempty"`
Username *string `url:"username,omitempty" json:"username,omitempty"`
Scopes []string `url:"scopes,omitempty" json:"scopes,omitempty"`
Scopes *[]string `url:"scopes,omitempty" json:"scopes,omitempty"`
}

// CreateGroupDeployToken creates a new deploy token for a group.
Expand Down
4 changes: 2 additions & 2 deletions deploy_tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestCreateProjectDeployToken(t *testing.T) {
Name: String("My deploy token"),
Username: String("custom-user"),
ExpiresAt: &expiresAt,
Scopes: []string{
Scopes: &[]string{
"read_repository",
},
})
Expand Down Expand Up @@ -263,7 +263,7 @@ func TestCreateGroupDeployToken(t *testing.T) {
Name: String("My deploy token"),
Username: String("custom-user"),
ExpiresAt: &expiresAt,
Scopes: []string{
Scopes: &[]string{
"read_repository",
},
})
Expand Down
6 changes: 3 additions & 3 deletions epics.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (e Epic) String() string {
type ListGroupEpicsOptions struct {
ListOptions
AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"`
Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
Labels *Labels `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"`
Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
Expand Down Expand Up @@ -174,7 +174,7 @@ func (s *EpicsService) GetEpicLinks(gid interface{}, epic int, options ...Reques
type CreateEpicOptions struct {
Title *string `url:"title,omitempty" json:"title,omitempty"`
Description *string `url:"description,omitempty" json:"description,omitempty"`
Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
Labels *Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
StartDateIsFixed *bool `url:"start_date_is_fixed,omitempty" json:"start_date_is_fixed,omitempty"`
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"`
Expand Down Expand Up @@ -211,7 +211,7 @@ func (s *EpicsService) CreateEpic(gid interface{}, opt *CreateEpicOptions, optio
type UpdateEpicOptions struct {
Title *string `url:"title,omitempty" json:"title,omitempty"`
Description *string `url:"description,omitempty" json:"description,omitempty"`
Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
Labels *Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
StartDateIsFixed *bool `url:"start_date_is_fixed,omitempty" json:"start_date_is_fixed,omitempty"`
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"`
Expand Down
56 changes: 28 additions & 28 deletions geo_nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ type GeoNodesService struct {
// GitLab API docs:
// https://docs.gitlab.com/ee/api/geo_nodes.html#create-a-new-geo-node
type CreateGeoNodesOptions struct {
Primary *bool `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"`
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"`
Primary *bool `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"`
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"`
}

// CreateGeoNode creates a new Geo Node.
Expand Down Expand Up @@ -155,20 +155,20 @@ func (s *GeoNodesService) GetGeoNode(id int, options ...RequestOptionFunc) (*Geo
// GitLab API docs:
// https://docs.gitlab.com/ee/api/geo_nodes.html#edit-a-geo-node
type UpdateGeoNodesOptions struct {
ID *int `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"`
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"`
ID *int `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"`
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"`
}

// EditGeoNode updates settings of an existing Geo node.
Expand Down
2 changes: 1 addition & 1 deletion group_boards.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ 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"`
Labels Labels `url:"labels,omitempty" json:"labels,omitempty"`
Labels *Labels `url:"labels,omitempty" json:"labels,omitempty"`
Weight *int `url:"weight,omitempty" json:"weight,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion group_milestones.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (m GroupMilestone) String() string {
// https://docs.gitlab.com/ce/api/group_milestones.html#list-group-milestones
type ListGroupMilestonesOptions struct {
ListOptions
IIDs []int `url:"iids[],omitempty" json:"iids,omitempty"`
IIDs *[]int `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"`
Expand Down
2 changes: 1 addition & 1 deletion groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ type ListGroupsOptions struct {
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
Owned *bool `url:"owned,omitempty" json:"owned,omitempty"`
Search *string `url:"search,omitempty" json:"search,omitempty"`
SkipGroups []int `url:"skip_groups,omitempty" json:"skip_groups,omitempty"`
SkipGroups *[]int `url:"skip_groups,omitempty" json:"skip_groups,omitempty"`
Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
Statistics *bool `url:"statistics,omitempty" json:"statistics,omitempty"`
TopLevelOnly *bool `url:"top_level_only,omitempty" json:"top_level_only,omitempty"`
Expand Down
Loading

0 comments on commit 683eca8

Please sign in to comment.