array( 'type' => 'integer', 'minimum' => 1, 'description' => __( 'Brand id. List brands with Rank Math\'s rank-math/get-ai-visibility-overview ability.', 'acrossai-abilities-manager' ), ), ); } protected function output_properties(): array { return array( 'brand_id' => array( 'type' => 'integer' ), 'brand' => array( 'type' => array( 'object', 'array', 'null' ) ), ); } protected function required_input(): array { return array( 'brand_id' ); } protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true ); } /** * @param array $input * @return array|WP_Error */ protected function run( array $input ) { $result = Entitlement_Repository::get_brand( isset( $input['brand_id'] ) ? absint( $input['brand_id'] ) : 0 ); if ( is_wp_error( $result ) ) { return $result; } $result['message'] = sprintf( /* translators: %d: brand id */ __( 'Returned AI Visibility brand %d.', 'acrossai-abilities-manager' ), $result['brand_id'] ); return $result; } }