Skip to content

Commit

Permalink
Update field ordering to match api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrie30 committed May 27, 2024
1 parent 07551d4 commit ebc97f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions project_snippets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ func TestProjectSnippetsService_ListSnippets(t *testing.T) {
Name: "Venkatesh Thalluri",
State: "active",
},
ProjectID: 1,
WebURL: "http://example.com/example/example/snippets/1",
RawURL: "http://example.com/example/example/snippets/1/raw",
ProjectID: 1,
}}

ss, resp, err := client.ProjectSnippets.ListSnippets(1, nil, nil)
Expand Down Expand Up @@ -125,9 +125,9 @@ func TestProjectSnippetsService_GetSnippet(t *testing.T) {
Name: "Venkatesh Thalluri",
State: "active",
},
ProjectID: 1,
WebURL: "http://example.com/example/example/snippets/1",
RawURL: "http://example.com/example/example/snippets/1/raw",
ProjectID: 1,
}

s, resp, err := client.ProjectSnippets.GetSnippet(1, 1, nil, nil)
Expand Down Expand Up @@ -201,8 +201,9 @@ func TestProjectSnippetsService_CreateSnippet(t *testing.T) {
Name: "Venkatesh Thalluri",
State: "active",
},
WebURL: "http://example.com/example/example/snippets/1",
RawURL: "http://example.com/example/example/snippets/1/raw",
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"`
Expand All @@ -212,7 +213,6 @@ func TestProjectSnippetsService_CreateSnippet(t *testing.T) {
RawURL: "http://example.com/example/example/-/snippets/1/raw/main/add.rb",
},
},
ProjectID: 1,
}

s, resp, err := client.ProjectSnippets.CreateSnippet(1, nil, nil, nil)
Expand Down Expand Up @@ -280,9 +280,9 @@ func TestProjectSnippetsService_UpdateSnippet(t *testing.T) {
Name: "Venkatesh Thalluri",
State: "active",
},
ProjectID: 1,
WebURL: "http://example.com/example/example/snippets/1",
RawURL: "http://example.com/example/example/snippets/1/raw",
ProjectID: 1,
}

s, resp, err := client.ProjectSnippets.UpdateSnippet(1, 1, nil, nil, nil)
Expand Down
2 changes: 1 addition & 1 deletion snippets.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ type Snippet struct {
} `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"`
ProjectID int `json:"project_id"`
}

func (s Snippet) String() string {
Expand Down

0 comments on commit ebc97f0

Please sign in to comment.