From 365b0a613834b5adaa5df19a5b033d0d7a49826b Mon Sep 17 00:00:00 2001 From: Taj Pereira Date: Mon, 26 Sep 2022 16:50:24 +0930 Subject: [PATCH 1/2] fix: use string array for scopes type --- sentry/organization_integrations.go | 2 +- sentry/organization_integrations_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sentry/organization_integrations.go b/sentry/organization_integrations.go index cb52c68..205237c 100644 --- a/sentry/organization_integrations.go +++ b/sentry/organization_integrations.go @@ -25,7 +25,7 @@ type OrganizationIntegration struct { Icon string `json:"icon"` DomainName string `json:"domainName"` AccountType string `json:"accountType"` - Scopes *string `json:"scopes"` + Scopes *[]string `json:"scopes"` Status string `json:"status"` Provider OrganizationIntegrationProvider `json:"provider"` diff --git a/sentry/organization_integrations_test.go b/sentry/organization_integrations_test.go index edca9f9..afa414e 100644 --- a/sentry/organization_integrations_test.go +++ b/sentry/organization_integrations_test.go @@ -24,7 +24,7 @@ func TestOrganizationIntegrationsService_List(t *testing.T) { "icon": "https://avatars.githubusercontent.com/u/583231?v=4", "domainName": "github.com/octocat", "accountType": "Organization", - "scopes": null, + "scopes": ["read", "write"], "status": "active", "provider": { "key": "github", @@ -65,7 +65,7 @@ func TestOrganizationIntegrationsService_List(t *testing.T) { Icon: "https://avatars.githubusercontent.com/u/583231?v=4", DomainName: "github.com/octocat", AccountType: "Organization", - Scopes: nil, + Scopes: &[]string{"read", "write"}, Status: "active", Provider: OrganizationIntegrationProvider{ Key: "github", From fbe3df19e32aa605c224683aa03521951330ed60 Mon Sep 17 00:00:00 2001 From: Taj Pereira Date: Tue, 27 Sep 2022 09:22:24 +0930 Subject: [PATCH 2/2] Apply suggestions from code review --- sentry/organization_integrations.go | 2 +- sentry/organization_integrations_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sentry/organization_integrations.go b/sentry/organization_integrations.go index 205237c..2653889 100644 --- a/sentry/organization_integrations.go +++ b/sentry/organization_integrations.go @@ -25,7 +25,7 @@ type OrganizationIntegration struct { Icon string `json:"icon"` DomainName string `json:"domainName"` AccountType string `json:"accountType"` - Scopes *[]string `json:"scopes"` + Scopes []string `json:"scopes"` Status string `json:"status"` Provider OrganizationIntegrationProvider `json:"provider"` diff --git a/sentry/organization_integrations_test.go b/sentry/organization_integrations_test.go index afa414e..028afcd 100644 --- a/sentry/organization_integrations_test.go +++ b/sentry/organization_integrations_test.go @@ -65,7 +65,7 @@ func TestOrganizationIntegrationsService_List(t *testing.T) { Icon: "https://avatars.githubusercontent.com/u/583231?v=4", DomainName: "github.com/octocat", AccountType: "Organization", - Scopes: &[]string{"read", "write"}, + Scopes: []string{"read", "write"}, Status: "active", Provider: OrganizationIntegrationProvider{ Key: "github",