// Copyright 2017 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 (
	
	
)

// ListBlockedUsers lists all the blocked users by the authenticated user.
//
// GitHub API docs: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user
//
//meta:operation GET /user/blocks
func ( *UsersService) ( context.Context,  *ListOptions) ([]*User, *Response, error) {
	 := "user/blocks"
	,  := addOptions(, )
	if  != nil {
		return nil, nil, 
	}

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

	// TODO: remove custom Accept header when this API fully launches.
	.Header.Set("Accept", mediaTypeBlockUsersPreview)

	var  []*User
	,  := .client.Do(, , &)
	if  != nil {
		return nil, , 
	}

	return , , nil
}

// IsBlocked reports whether specified user is blocked by the authenticated user.
//
// GitHub API docs: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user
//
//meta:operation GET /user/blocks/{username}
func ( *UsersService) ( context.Context,  string) (bool, *Response, error) {
	 := fmt.Sprintf("user/blocks/%v", )

	,  := .client.NewRequest("GET", , nil)
	if  != nil {
		return false, nil, 
	}

	// TODO: remove custom Accept header when this API fully launches.
	.Header.Set("Accept", mediaTypeBlockUsersPreview)

	,  := .client.Do(, , nil)
	,  := parseBoolResponse()
	return , , 
}

// BlockUser blocks specified user for the authenticated user.
//
// GitHub API docs: https://docs.github.com/rest/users/blocking#block-a-user
//
//meta:operation PUT /user/blocks/{username}
func ( *UsersService) ( context.Context,  string) (*Response, error) {
	 := fmt.Sprintf("user/blocks/%v", )

	,  := .client.NewRequest("PUT", , nil)
	if  != nil {
		return nil, 
	}

	// TODO: remove custom Accept header when this API fully launches.
	.Header.Set("Accept", mediaTypeBlockUsersPreview)

	return .client.Do(, , nil)
}

// UnblockUser unblocks specified user for the authenticated user.
//
// GitHub API docs: https://docs.github.com/rest/users/blocking#unblock-a-user
//
//meta:operation DELETE /user/blocks/{username}
func ( *UsersService) ( context.Context,  string) (*Response, error) {
	 := fmt.Sprintf("user/blocks/%v", )

	,  := .client.NewRequest("DELETE", , nil)
	if  != nil {
		return nil, 
	}

	// TODO: remove custom Accept header when this API fully launches.
	.Header.Set("Accept", mediaTypeBlockUsersPreview)

	return .client.Do(, , nil)
}