*/ protected function input_properties(): array { return array( 'include_personal_data' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Required. Without it this refuses.', 'acrossai-abilities-manager' ) ), 'reason' => array( 'type' => 'string', 'description' => __( 'Why the export is needed. Recorded with who asked and how many records were released.', 'acrossai-abilities-manager' ) ), 'format' => array( 'type' => 'string', 'enum' => array( 'json', 'csv' ), 'default' => 'json', 'description' => __( 'Return structured rows or a CSV payload.', 'acrossai-abilities-manager' ) ), 'limit' => array( 'type' => 'integer', 'default' => 100, 'minimum' => 1, 'maximum' => 500, 'description' => __( 'How many records to release.', 'acrossai-abilities-manager' ) ), 'offset' => array( 'type' => 'integer', 'default' => 0, 'minimum' => 0, 'description' => __( 'Where to start, for paging.', 'acrossai-abilities-manager' ) ), ); } /** * @since 0.0.34 * @return array */ protected function required_input(): array { return array(); } /** * @since 0.0.34 * @return array */ protected function output_properties(): array { return array( 'format' => array( 'type' => 'string' ), 'customers' => array( 'type' => 'array', 'items' => array( 'type' => 'object', 'additionalProperties' => true ) ), 'csv' => array( 'type' => 'string' ), 'disclosed_count' => array( 'type' => 'integer' ), 'total_matching' => array( 'type' => 'integer' ), 'offset' => array( 'type' => 'integer' ), 'has_more' => array( 'type' => 'boolean' ), 'reason' => array( 'type' => 'string' ), 'personal_data_included' => array( 'type' => 'boolean' ), 'withheld' => array( 'type' => 'array', 'items' => array( 'type' => 'string' ) ), 'note' => array( 'type' => 'string' ), ); } /** * @since 0.0.34 * @return array */ protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ); } /** * @since 0.0.34 * @return bool */ protected function requires_confirmation(): bool { return true; } /** * @since 0.0.34 * @return string */ protected function confirmation_message(): string { return __( 'This releases named customer records with their email addresses and postal addresses. The disclosure is recorded. Pass confirm: true to proceed.', 'acrossai-abilities-manager' ); } /** * @since 0.0.34 * @param array $input Input. * @return array|WP_Error */ protected function run( array $input ) { return Customer_Repository::export( $input ); } }