Repository: google/go-github
File: github/enterprise_app_installation.go (Go)

Code before:
// Copyright 2025 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package github

import (
	"context"
	"fmt"
)

// InstallableOrganization represents an organization in an enterprise in which a GitHub app can be installed.
type InstallableOrganization struct {
	ID    *int64  `json:"id,omitempty"`
	Login *string `json:"login,omitempty"`
}

// AccessibleRepository represents a repository that can be made accessible to a GitHub app.
type AccessibleRepository struct {
	ID       *int64  `json:"id,omitempty"`
	Name     *string `json:"name,omitempty"`
	FullName *string `json:"full_name,omitempty"`
}

// AppInstallationRequest represents the request to install a GitHub app on an enterprise-owned organization.
type AppInstallationRequest struct {
	// The Client ID of the GitHub App to install.
	ClientID string `json:"client_id"`
	// The selection of repositories that the GitHub app can access.
	// Can be one of: all, selected, none
	RepositorySelection string `json:"repository_selection"`
	// A list of repository names that the GitHub App can access, if the repository_selection is set to selected.
	Repository []string `json:"repository,omitempty"`
}

// ListAppInstallableOrganizations lists the organizations in an enterprise that are installable for an app.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#get-enterprise-owned-organizations-that-can-have-github-apps-installed
//
//meta:operation GET /enterprises/{enterprise}/apps/installable_organizations
func (s *EnterpriseService) ListAppInstallableOrganizations(ctx context.Context, enterprise string, opts *ListOptions) ([]*InstallableOrganization, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/apps/installable_organizations", enterprise)

	u, err := addOptions(u, opts)
	if err != nil {
		return nil, nil, err
	}

Review comment (suggestion):
I'm guessing should be

```suggestion
	ID       int64  `json:"id"`
	Name     string `json:"name"`
	FullName string `json:"full_name"`
```

according to the schema
```json
{
  "type": "array",
  "items": {
    "title": "Accessible Repository",
    "description": "A repository that may be made accessible to a GitHub App.",
    "type": "object",
    "properties": {
      "id": {
        "description": "Unique identifier of the repository",
        "type": "integer",
        "format": "int64",
        "examples": [
          1
        ]
      },
      "name": {
        "description": "The name of the repository.",
        "type": "string",
        "examples": [
          "Team Environment"
        ]
      },
      "full_name": {
        "type": "string",
        "examples": [
          "octocat/Hello-World"
        ]
      }
    },
    "required": [
      "full_name",
      "id",
      "name"
    ]
  }
}

```


Code after:
// Copyright 2025 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package github

import (
	"context"
	"fmt"
)

// InstallableOrganization represents an organization in an enterprise in which a GitHub app can be installed.
type InstallableOrganization struct {
	ID                        int64   `json:"id"`
	Login                     string  `json:"login"`
	AccessibleRepositoriesURL *string `json:"accessible_repositories_url,omitempty"`
}

// AccessibleRepository represents a repository that can be made accessible to a GitHub app.
type AccessibleRepository struct {
	ID       int64  `json:"id"`
	Name     string `json:"name"`
	FullName string `json:"full_name"`
}

// InstallAppRequest represents the request to install a GitHub app on an enterprise-owned organization.
type InstallAppRequest struct {
	// The Client ID of the GitHub App to install.
	ClientID string `json:"client_id"`
	// The selection of repositories that the GitHub app can access.
	// Can be one of: all, selected, none
	RepositorySelection string `json:"repository_selection"`
	// A list of repository names that the GitHub App can access, if the repository_selection is set to selected.
	Repositories []string `json:"repositories,omitempty"`
}

// ListAppInstallableOrganizations lists the organizations in an enterprise that are installable for an app.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#get-enterprise-owned-organizations-that-can-have-github-apps-installed
//
//meta:operation GET /enterprises/{enterprise}/apps/installable_organizations
func (s *EnterpriseService) ListAppInstallableOrganizations(ctx context.Context, enterprise string, opts *ListOptions) ([]*InstallableOrganization, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/apps/installable_organizations", enterprise)

	u, err := addOptions(u, opts)
	if err != nil {
		return nil, nil, err