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

// ListHookDeliveries lists deliveries of an App webhook.
//
// GitHub API docs: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook
//
//meta:operation GET /app/hook/deliveries
func ( *AppsService) ( context.Context,  *ListCursorOptions) ([]*HookDelivery, *Response, error) {
	,  := addOptions("app/hook/deliveries", )
	if  != nil {
		return nil, nil, 
	}

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

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

	return , , nil
}

// GetHookDelivery returns the App webhook delivery with the specified ID.
//
// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook
//
//meta:operation GET /app/hook/deliveries/{delivery_id}
func ( *AppsService) ( context.Context,  int64) (*HookDelivery, *Response, error) {
	 := fmt.Sprintf("app/hook/deliveries/%v", )
	,  := .client.NewRequest("GET", , nil)
	if  != nil {
		return nil, nil, 
	}

	 := new(HookDelivery)
	,  := .client.Do(, , )
	if  != nil {
		return nil, , 
	}

	return , , nil
}

// RedeliverHookDelivery redelivers a delivery for an App webhook.
//
// GitHub API docs: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook
//
//meta:operation POST /app/hook/deliveries/{delivery_id}/attempts
func ( *AppsService) ( context.Context,  int64) (*HookDelivery, *Response, error) {
	 := fmt.Sprintf("app/hook/deliveries/%v/attempts", )
	,  := .client.NewRequest("POST", , nil)
	if  != nil {
		return nil, nil, 
	}

	 := new(HookDelivery)
	,  := .client.Do(, , )
	if  != nil {
		return nil, , 
	}

	return , , nil
}