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

Code before:
// GetImmutableReleasesSettings gets immutable releases settings for an organization.
//
// This endpoint returns the immutable releases configuration that applies to repositories
// within the given organization.
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-immutable-releases-settings-for-an-organization
//
//meta:operation GET /orgs/{org}/settings/immutable-releases
func (s *OrganizationsService) GetImmutableReleasesSettings(ctx context.Context, org string) (*ImmutableReleaseSettings, *Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases", org)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var settings *ImmutableReleaseSettings
	resp, err := s.client.Do(ctx, req, &settings)
	if err != nil {
		return nil, resp, err
	}

	return settings, resp, nil
}

// SetImmutableReleasesPolicy sets immutable releases settings for an organization/
//
// This endpoint sets the immutable releases policy for repositories in an organization.
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-immutable-releases-settings-for-an-organization
//
//meta:operation PUT /orgs/{org}/settings/immutable-releases
func (s *OrganizationsService) SetImmutableReleasesPolicy(ctx context.Context, org string, opts *ImmutableReleaseRepository) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases", org)

	req, err := s.client.NewRequest("PUT", u, opts)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// ListImmutableReleaseRepositories lists selected repositories for immutable releases enforcement.
//
// This endpoint gives a list of all the repositories that have been selected for immutable releases enforcement in an organization.

Review comment (suggestion):
```suggestion
// SetImmutableReleasesPolicy sets immutable releases settings for an organization.
```

Code after:
//meta:operation GET /orgs/{org}/settings/immutable-releases
func (s *OrganizationsService) GetImmutableReleasesSettings(ctx context.Context, org string) (*ImmutableReleaseSettings, *Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases", org)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var settings *ImmutableReleaseSettings
	resp, err := s.client.Do(ctx, req, &settings)
	if err != nil {
		return nil, resp, err
	}

	return settings, resp, nil
}

// UpdateImmutableReleasesSettings sets immutable releases settings for an organization.
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-immutable-releases-settings-for-an-organization
//
//meta:operation PUT /orgs/{org}/settings/immutable-releases
func (s *OrganizationsService) UpdateImmutableReleasesSettings(ctx context.Context, org string, opts ImmutableReleasePolicy) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases", org)

	req, err := s.client.NewRequest("PUT", u, opts)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// ListImmutableReleaseRepositories lists selected repositories for immutable releases enforcement in an organization.
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-selected-repositories-for-immutable-releases-enforcement
//
//meta:operation GET /orgs/{org}/settings/immutable-releases/repositories
func (s *OrganizationsService) ListImmutableReleaseRepositories(ctx context.Context, org string, opts *ListOptions) (*ListRepositories, *Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases/repositories", org)

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