• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tylernathanreed / jira-client-php / 13634794100

03 Mar 2025 03:19PM UTC coverage: 2.067% (-0.1%) from 2.21%
13634794100

push

github

web-flow
~ Try coveralls action

140 of 6773 relevant lines covered (2.07%)

0.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Operations/Webhooks.php
1
<?php
2

3
namespace Jira\Client\Operations;
4

5
use Jira\Client\Client;
6
use Jira\Client\Schema;
7

8
/** @phpstan-require-extends Client */
9
trait Webhooks
10
{
11
    /**
12
     * Returns a "paginated" list of the webhooks registered by the calling app
13
     * 
14
     * **"Permissions" required:** Only "Connect" and "OAuth 2.0" apps can use this operation.
15
     * 
16
     * @link https://developer.atlassian.com/cloud/jira/platform/#connect-apps
17
     * @link https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps
18
     * 
19
     * @param int $startAt The index of the first item to return in a page of results (page offset).
20
     * @param int $maxResults The maximum number of items to return per page.
21
     */
22
    public function getDynamicWebhooksForApp(
×
23
        ?int $startAt = 0,
24
        ?int $maxResults = 100,
25
    ): Schema\PageBeanWebhook {
26
        return $this->call(
×
27
            uri: '/rest/api/3/webhook',
×
28
            method: 'get',
×
29
            query: compact('startAt', 'maxResults'),
×
30
            success: 200,
×
31
            schema: Schema\PageBeanWebhook::class,
×
32
        );
×
33
    }
34

35
    /**
36
     * Registers webhooks
37
     * 
38
     * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the user who registered a dynamic webhook
39
     * 
40
     * **"Permissions" required:** Only "Connect" and "OAuth 2.0" apps can use this operation.
41
     * 
42
     * @link https://developer.atlassian.com/cloud/jira/platform/#connect-apps
43
     * @link https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps
44
     */
45
    public function registerDynamicWebhooks(
×
46
        Schema\WebhookRegistrationDetails $request,
47
    ): Schema\ContainerForRegisteredWebhooks {
48
        return $this->call(
×
49
            uri: '/rest/api/3/webhook',
×
50
            method: 'post',
×
51
            body: $request,
×
52
            success: 200,
×
53
            schema: Schema\ContainerForRegisteredWebhooks::class,
×
54
        );
×
55
    }
56

57
    /**
58
     * Removes webhooks by ID.
59
     * Only webhooks registered by the calling app are removed.
60
     * If webhooks created by other apps are specified, they are ignored
61
     * 
62
     * **"Permissions" required:** Only "Connect" and "OAuth 2.0" apps can use this operation.
63
     * 
64
     * @link https://developer.atlassian.com/cloud/jira/platform/#connect-apps
65
     * @link https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps
66
     */
67
    public function deleteWebhookById(
×
68
        Schema\ContainerForWebhookIDs $request,
69
    ): true {
70
        return $this->call(
×
71
            uri: '/rest/api/3/webhook',
×
72
            method: 'delete',
×
73
            body: $request,
×
74
            success: 202,
×
75
            schema: true,
×
76
        );
×
77
    }
78

79
    /**
80
     * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of retries
81
     * 
82
     * After 72 hours the failure may no longer be returned by this operation
83
     * 
84
     * The oldest failure is returned first
85
     * 
86
     * This method uses a cursor-based pagination.
87
     * To request the next page use the failure time of the last webhook on the list as the `failedAfter` value or use the URL provided in `next`
88
     * 
89
     * **"Permissions" required:** Only "Connect apps" can use this operation.
90
     * 
91
     * @link https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps
92
     * 
93
     * @param int $maxResults The maximum number of webhooks to return per page.
94
     *                        If obeying the maxResults directive would result in records with the same failure time being split across pages, the directive is ignored and all records with the same failure time included on the page.
95
     * @param int $after The time after which any webhook failure must have occurred for the record to be returned, expressed as milliseconds since the UNIX epoch.
96
     */
97
    public function getFailedWebhooks(
×
98
        ?int $maxResults = null,
99
        ?int $after = null,
100
    ): Schema\FailedWebhooks {
101
        return $this->call(
×
102
            uri: '/rest/api/3/webhook/failed',
×
103
            method: 'get',
×
104
            query: compact('maxResults', 'after'),
×
105
            success: 200,
×
106
            schema: Schema\FailedWebhooks::class,
×
107
        );
×
108
    }
109

110
    /**
111
     * Extends the life of webhook.
112
     * Webhooks registered through the REST API expire after 30 days.
113
     * Call this operation to keep them alive
114
     * 
115
     * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored
116
     * 
117
     * **"Permissions" required:** Only "Connect" and "OAuth 2.0" apps can use this operation.
118
     * 
119
     * @link https://developer.atlassian.com/cloud/jira/platform/#connect-apps
120
     * @link https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps
121
     */
122
    public function refreshWebhooks(
×
123
        Schema\ContainerForWebhookIDs $request,
124
    ): Schema\WebhooksExpirationDate {
125
        return $this->call(
×
126
            uri: '/rest/api/3/webhook/refresh',
×
127
            method: 'put',
×
128
            body: $request,
×
129
            success: 200,
×
130
            schema: Schema\WebhooksExpirationDate::class,
×
131
        );
×
132
    }
133
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc