Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | /** |
| 3 | * Provisioner contract. |
| 4 | * |
| 5 | * @package automattic/jetpack-send |
| 6 | */ |
| 7 | |
| 8 | namespace Automattic\Jetpack\Send; |
| 9 | |
| 10 | use WP_Error; |
| 11 | |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit( 0 ); |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Creates and manages the site's MailChannels sub-account. |
| 18 | */ |
| 19 | interface Provisioner { |
| 20 | |
| 21 | /** |
| 22 | * `wpcom` or `local`. |
| 23 | * |
| 24 | * @return string |
| 25 | */ |
| 26 | public function get_type(); |
| 27 | |
| 28 | /** |
| 29 | * Create (or re-key) the site's sub-account for a domain. |
| 30 | * |
| 31 | * @param string $domain Sending domain. |
| 32 | * @return array|WP_Error `{handle, api_key, lockdown_auth_id, monthly_limit, dns_records[]}`. |
| 33 | */ |
| 34 | public function provision( $domain ); |
| 35 | |
| 36 | /** |
| 37 | * Usage this billing period. |
| 38 | * |
| 39 | * @param array $account Stored account. |
| 40 | * @return array|WP_Error `{total_usage, monthly_limit, period_start, period_end}`. |
| 41 | */ |
| 42 | public function get_usage( array $account ); |
| 43 | |
| 44 | /** |
| 45 | * Remove the site's sub-account. |
| 46 | * |
| 47 | * @param array $account Stored account. |
| 48 | * @return true|WP_Error |
| 49 | */ |
| 50 | public function deprovision( array $account ); |
| 51 | } |