diff --git a/github/github-accessors.go b/github/github-accessors.go index a99a06aa314..a025f781faf 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4414,6 +4414,14 @@ func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { return *c.Name } +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateOrgRoleOptions) GetDescription() string { if c == nil || c.Description == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 2db51bab3dd..ae380160dc7 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5179,6 +5179,16 @@ func TestCreateOrUpdateCustomRepoRoleOptions_GetName(tt *testing.T) { c.GetName() } +func TestCreateOrUpdateOrgRoleOptions_GetBaseRole(tt *testing.T) { + var zeroValue string + c := &CreateOrUpdateOrgRoleOptions{BaseRole: &zeroValue} + c.GetBaseRole() + c = &CreateOrUpdateOrgRoleOptions{} + c.GetBaseRole() + c = nil + c.GetBaseRole() +} + func TestCreateOrUpdateOrgRoleOptions_GetDescription(tt *testing.T) { var zeroValue string c := &CreateOrUpdateOrgRoleOptions{Description: &zeroValue} diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index ca0c6d7bcba..086c4a824f0 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -54,6 +54,7 @@ type CreateOrUpdateOrgRoleOptions struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` Permissions []string `json:"permissions"` + BaseRole *string `json:"base_role,omitempty"` } // CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role.