*/ protected function input_properties(): array { return array( 'bundle' => array( 'type' => 'string', 'description' => __( 'Bundle id, handle or slug, for example loco-translate.', 'acrossai-abilities-manager' ), ), ); } /** * @since 0.0.34 * @return array */ protected function required_input(): array { return array( 'bundle' ); } /** * @since 0.0.34 * @return array */ protected function output_properties(): array { return array( 'bundle' => array( 'type' => 'object', 'additionalProperties' => true ), ); } /** * @since 0.0.34 * @return array */ protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true ); } /** * @since 0.0.34 * @param array $input Input. * @return array|WP_Error */ protected function run( array $input ) { $bundle = Bundle_Repository::find( (string) ( $input['bundle'] ?? '' ) ); if ( is_wp_error( $bundle ) ) { return $bundle; } return array( 'bundle' => Bundle_Repository::shape( $bundle, true ) ); } }