Skip to content

Commit 7fceec6

Browse files
Add IconUrl, InstallationType, and InstallationURL to githubAppInstallation (#1191)
* Add fields to githubAppInstallation * Updated changelog * Updated changelog * Updated changelog * chore: appease linter --------- Co-authored-by: jpadrianoGo <[email protected]> Co-authored-by: JP Adriano <[email protected]>
1 parent aae07e9 commit 7fceec6

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Enhancements
44

55
* Adds `Logs` method to `QueryRuns`, which is EXPERIMENTAL, SUBJECT TO CHANGE, and may not be available to all users by @brandonc [#1186](https://github.com/hashicorp/go-tfe/pull/1186)
6+
* Adds `IconUrl`, `InstallationType`, and `InstallationURL` to githubAppInstallation, by @jpadrianoGo [#1191](https://github.com/hashicorp/go-tfe/pull/1143)
67
* Adds `CanceledAt`, `RunEvents`, `TriggerReason` field to `Run` by @jpadrianoGo [#1161](https://github.com/hashicorp/go-tfe/pull/1161)
78
* Adds `CreatedAt` field to `AgentPool` by @jpadrianoGo [#1150](https://github.com/hashicorp/go-tfe/pull/1150)
89
* Adds `CreatedBy` relation to `AgentToken` by @jpadrianoGo [#1149](https://github.com/hashicorp/go-tfe/pull/1149)

github_app_installation.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ type GHAInstallationList struct {
3737

3838
// GHAInstallation represents a github app installation
3939
type GHAInstallation struct {
40-
ID *string `jsonapi:"primary,github-app-installations"`
41-
InstallationID *int `jsonapi:"attr,installation-id"`
42-
Name *string `jsonapi:"attr,name"`
40+
ID *string `jsonapi:"primary,github-app-installations"`
41+
IconURL *string `jsonapi:"attr,icon-url"`
42+
InstallationID *int `jsonapi:"attr,installation-id"`
43+
InstallationType *string `jsonapi:"attr,installation-type"`
44+
InstallationURL *string `jsonapi:"attr,installation-url"`
45+
Name *string `jsonapi:"attr,name"`
4346
}
4447

4548
// GHAInstallationListOptions represents the options for listing.
@@ -51,7 +54,6 @@ type GHAInstallationListOptions struct {
5154
func (s *gHAInstallations) List(ctx context.Context, options *GHAInstallationListOptions) (*GHAInstallationList, error) {
5255
u := "github-app/installations"
5356
req, err := s.client.NewRequest("GET", u, options)
54-
fmt.Println(u)
5557
if err != nil {
5658
return nil, err
5759
}

github_app_installation_integration_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ package tfe
55

66
import (
77
"context"
8-
"github.com/stretchr/testify/assert"
9-
"github.com/stretchr/testify/require"
108
"os"
119
"testing"
10+
11+
"github.com/stretchr/testify/assert"
12+
"github.com/stretchr/testify/require"
1213
)
1314

1415
func TestGHAInstallationList(t *testing.T) {
@@ -39,8 +40,11 @@ func TestGHAInstallationRead(t *testing.T) {
3940
t.Run("when installation id exists", func(t *testing.T) {
4041
ghais, err := client.GHAInstallations.Read(ctx, GHAInstallationID)
4142
require.NoError(t, err)
42-
assert.NotEmpty(t, ghais.InstallationID)
43+
assert.NotEmpty(t, ghais.IconURL)
4344
assert.NotEmpty(t, ghais.ID)
45+
assert.NotEmpty(t, ghais.InstallationID)
46+
assert.NotEmpty(t, ghais.InstallationType)
47+
assert.NotEmpty(t, ghais.InstallationURL)
4448
assert.NotEmpty(t, ghais.Name)
4549
assert.Equal(t, *ghais.ID, gHAInstallationID)
4650
})

0 commit comments

Comments
 (0)